util-linux/misc-utils/Makefile

115 lines
2.2 KiB
Makefile
Raw Normal View History

2006-12-06 17:25:32 -06:00
# Makefile -- Makefile for util-linux Linux utilities
# Created: Sat Dec 26 20:09:40 1992
# Revised: Mon Nov 11 10:12:16 1996 by faith@cs.unc.edu
2006-12-06 17:25:32 -06:00
# Copyright 1992, 1993, 1994, 1995 Rickard E. Faith (faith@cs.unc.edu)
2006-12-06 17:25:33 -06:00
# May be distirbuted under the GPL
2006-12-06 17:25:32 -06:00
#
2006-12-06 17:25:39 -06:00
include ../make_include
2006-12-06 17:25:32 -06:00
include ../MCONFIG
# replay not added yet
2006-12-06 17:25:32 -06:00
# Where to put man pages?
MAN1= cal.1 chkdupexe.1 ddate.1 logger.1 look.1 mcookie.1 \
namei.1 rename.1 script.1 whereis.1
2006-12-06 17:25:33 -06:00
2006-12-06 17:25:32 -06:00
# Where to put binaries?
# See the "install" rule for the links. . .
BIN=
2006-12-06 17:25:32 -06:00
2006-12-06 17:25:35 -06:00
USRBIN= cal chkdupexe ddate logger look mcookie \
namei rename script whereis
MAYBE= reset setterm
ifeq "$(HAVE_RESET)" "no"
USRBIN:=$(USRBIN) reset
MAN1:=$(MAN1) reset.1
2006-12-06 17:25:33 -06:00
endif
2006-12-06 17:25:32 -06:00
ifeq "$(HAVE_WRITE)" "no"
USRBIN:=$(USRBIN) write
MAN1:=$(MAN1) write.1
endif
ifeq "$(HAVE_KILL)" "no"
BIN:=$(BIN) kill
MAN1:=$(MAN1) kill.1
endif
2006-12-06 17:25:39 -06:00
ifeq "$(HAVE_NCURSES)" "yes"
USRBIN:=$(USRBIN) setterm
MAN1:=$(MAN1) setterm.1
endif
2006-12-06 17:25:37 -06:00
# For script only
2006-12-06 17:25:39 -06:00
LIBPTY=
2006-12-06 17:25:37 -06:00
ifeq "$(HAVE_OPENPTY)" "yes"
2006-12-06 17:25:39 -06:00
LIBPTY:=$(LIBPTY) -lutil
2006-12-06 17:25:37 -06:00
endif
2006-12-06 17:25:32 -06:00
# Programs requiring special compilation
NEEDS_CURSES= setterm
2006-12-06 17:25:39 -06:00
NEEDS_OPENPTY= script
2006-12-06 17:25:32 -06:00
all: $(BIN) $(USRBIN) $(USRBIN.NONSHADOW)
2006-12-06 17:25:32 -06:00
$(NEEDS_CURSES):
2006-12-06 17:25:35 -06:00
ifeq "$(HAVE_NCURSES)" "yes"
$(CC) $(LDFLAGS) $^ -o $@ $(LIBCURSES)
2006-12-06 17:25:35 -06:00
else
@echo $@ not made since it requires ncurses
endif
2006-12-06 17:25:32 -06:00
2006-12-06 17:25:39 -06:00
$(NEEDS_OPENPTY):
$(CC) $(LDFLAGS) $^ -o $@ $(LIBPTY)
2006-12-06 17:25:33 -06:00
%: %.sh
2006-12-06 17:25:32 -06:00
cp $@.sh $@
2006-12-06 17:25:33 -06:00
chmod 755 $@
%: %.pl
cp $@.pl $@
chmod 755 $@
2006-12-06 17:25:32 -06:00
# Rules for everything else
cal.o: $(LIB)/errs.h
2006-12-06 17:25:37 -06:00
cal: cal.o $(ERR_O)
2006-12-06 17:25:33 -06:00
chkdupexe: chkdupexe.pl
ddate: ddate.o
2006-12-06 17:25:32 -06:00
kill: kill.o procs.o
2006-12-06 17:25:37 -06:00
logger: logger.o
mcookie: mcookie.o $(LIB)/md5.o
mcookie.o: mcookie.c $(LIB)/md5.h
2006-12-06 17:25:32 -06:00
reset: reset.sh
2006-12-06 17:25:39 -06:00
script: script.o
write.o: $(LIB)/carefulputc.h
write: write.o $(LIB)/carefulputc.o
2006-12-06 17:25:37 -06:00
2006-12-06 17:25:35 -06:00
ifeq "$(HAVE_NCURSES)" "yes"
setterm: setterm.o
endif
2006-12-06 17:25:32 -06:00
install: all
$(INSTALLDIR) $(BINDIR) $(USRBINDIR)
ifneq "$(BIN)" ""
2006-12-06 17:25:32 -06:00
$(INSTALLBIN) $(BIN) $(BINDIR)
endif
2006-12-06 17:25:32 -06:00
$(INSTALLBIN) $(USRBIN) $(USRBINDIR)
$(INSTALLDIR) $(MAN1DIR)
2006-12-06 17:25:32 -06:00
$(INSTALLMAN) $(MAN1) $(MAN1DIR)
ifeq "$(HAVE_WRITE)" "no"
2006-12-06 17:25:33 -06:00
ifeq "$(USE_TTY_GROUP)" "yes"
chgrp tty $(USRBINDIR)/write
chmod g+s $(USRBINDIR)/write
endif
endif
2006-12-06 17:25:32 -06:00
.PHONY: clean
clean:
-rm -f *.o *~ core $(BIN) $(USRBIN) $(MAYBE)