2006-12-06 17:25:32 -06:00
|
|
|
# Makefile -- Makefile for util-linux Linux utilities
|
|
|
|
# Created: Sat Dec 26 20:09:40 1992
|
2006-12-06 17:25:34 -06:00
|
|
|
# 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
|
|
|
|
|
2006-12-06 17:26:16 -06:00
|
|
|
# scriptreplay not added yet
|
2006-12-06 17:25:49 -06:00
|
|
|
|
2006-12-06 17:25:32 -06:00
|
|
|
# Where to put man pages?
|
|
|
|
|
2006-12-06 17:25:53 -06:00
|
|
|
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. . .
|
|
|
|
|
2006-12-06 17:25:53 -06:00
|
|
|
BIN=
|
2006-12-06 17:25:32 -06:00
|
|
|
|
2006-12-06 17:25:35 -06:00
|
|
|
USRBIN= cal chkdupexe ddate logger look mcookie \
|
2006-12-06 17:25:48 -06:00
|
|
|
namei rename script whereis
|
2006-12-06 17:25:34 -06:00
|
|
|
|
2006-12-06 17:25:46 -06:00
|
|
|
MAYBE= reset setterm
|
2006-12-06 17:25:44 -06:00
|
|
|
|
2006-12-06 17:25:34 -06:00
|
|
|
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
|
|
|
|
2006-12-06 17:25:48 -06:00
|
|
|
ifeq "$(HAVE_WRITE)" "no"
|
|
|
|
USRBIN:=$(USRBIN) write
|
|
|
|
MAN1:=$(MAN1) write.1
|
|
|
|
endif
|
|
|
|
|
2006-12-06 17:25:53 -06:00
|
|
|
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:34 -06:00
|
|
|
|
2006-12-06 17:25:32 -06:00
|
|
|
# Programs requiring special compilation
|
2006-12-06 17:25:34 -06:00
|
|
|
NEEDS_CURSES= setterm
|
2006-12-06 17:25:39 -06:00
|
|
|
NEEDS_OPENPTY= script
|
2006-12-06 17:25:32 -06:00
|
|
|
|
2006-12-06 17:25:49 -06:00
|
|
|
all: $(BIN) $(USRBIN) $(USRBIN.NONSHADOW)
|
2006-12-06 17:25:32 -06:00
|
|
|
|
2006-12-06 17:25:34 -06:00
|
|
|
$(NEEDS_CURSES):
|
2006-12-06 17:25:35 -06:00
|
|
|
ifeq "$(HAVE_NCURSES)" "yes"
|
2006-12-06 17:25:34 -06:00
|
|
|
$(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:26:24 -06:00
|
|
|
ifeq "$(HAVE_NCURSES)" "yes"
|
|
|
|
cal:
|
|
|
|
$(CC) $(LDFLAGS) $^ -o $@ $(LIBCURSES)
|
|
|
|
else
|
|
|
|
ifeq "$(HAVE_TERMCAP)" "yes"
|
|
|
|
cal:
|
|
|
|
$(CC) $(LDFLAGS) $^ -o $@ $(LIBTERMCAP)
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
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
|
|
|
|
|
2006-12-06 17:25:41 -06:00
|
|
|
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
|
2006-12-06 17:25:49 -06:00
|
|
|
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
|
2006-12-06 17:26:05 -06:00
|
|
|
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
|
2006-12-06 17:25:44 -06:00
|
|
|
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)
|
2006-12-06 17:25:54 -06:00
|
|
|
ifneq "$(BIN)" ""
|
2006-12-06 17:25:32 -06:00
|
|
|
$(INSTALLBIN) $(BIN) $(BINDIR)
|
2006-12-06 17:25:54 -06:00
|
|
|
endif
|
2006-12-06 17:25:32 -06:00
|
|
|
$(INSTALLBIN) $(USRBIN) $(USRBINDIR)
|
2006-12-06 17:25:49 -06:00
|
|
|
$(INSTALLDIR) $(MAN1DIR)
|
2006-12-06 17:25:32 -06:00
|
|
|
$(INSTALLMAN) $(MAN1) $(MAN1DIR)
|
2006-12-06 17:25:48 -06:00
|
|
|
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
|
2006-12-06 17:25:48 -06:00
|
|
|
endif
|
2006-12-06 17:25:32 -06:00
|
|
|
|
|
|
|
.PHONY: clean
|
|
|
|
clean:
|
2006-12-06 17:25:44 -06:00
|
|
|
-rm -f *.o *~ core $(BIN) $(USRBIN) $(MAYBE)
|