]>
Commit | Line | Data |
---|---|---|
6dbe3af9 KZ |
1 | # Makefile -- Makefile for util-linux Linux utilities |
2 | # Created: Sat Dec 26 20:09:40 1992 | |
fd6b7a7f | 3 | # Revised: Mon Nov 11 10:12:16 1996 by faith@cs.unc.edu |
6dbe3af9 | 4 | # Copyright 1992, 1993, 1994, 1995 Rickard E. Faith (faith@cs.unc.edu) |
726f69e2 | 5 | # May be distirbuted under the GPL |
6dbe3af9 | 6 | # |
7eda085c | 7 | include ../make_include |
6dbe3af9 KZ |
8 | include ../MCONFIG |
9 | ||
10 | # Where to put man pages? | |
11 | ||
2b6fc908 | 12 | MAN1= cal.1 chkdupexe.1 ddate.1 kill.1 \ |
eb63b9b8 KZ |
13 | logger.1 look.1 mcookie.1 namei.1 rename.1 script.1 \ |
14 | whereis.1 write.1 | |
726f69e2 | 15 | |
6dbe3af9 KZ |
16 | # Where to put binaries? |
17 | # See the "install" rule for the links. . . | |
18 | ||
fd6b7a7f | 19 | BIN= kill |
6dbe3af9 | 20 | |
2b6fc908 | 21 | USRBIN= cal chkdupexe ddate logger look mcookie \ |
eb63b9b8 | 22 | namei rename script whereis write |
fd6b7a7f | 23 | |
66ee8158 KZ |
24 | MAYBE= reset setterm tsort |
25 | ||
fd6b7a7f KZ |
26 | ifeq "$(HAVE_RESET)" "no" |
27 | USRBIN:=$(USRBIN) reset | |
28 | MAN1:=$(MAN1) reset.1 | |
726f69e2 | 29 | endif |
6dbe3af9 | 30 | |
7eda085c KZ |
31 | ifeq "$(HAVE_NCURSES)" "yes" |
32 | USRBIN:=$(USRBIN) setterm | |
33 | MAN1:=$(MAN1) setterm.1 | |
34 | endif | |
35 | ||
eb63b9b8 KZ |
36 | ifeq "$(HAVE_TSORT)" "no" |
37 | USRBIN:=$(USRBIN) tsort | |
38 | MAN1:=$(MAN1) tsort.1 | |
39 | endif | |
40 | ||
5c36a0eb | 41 | # For script only |
7eda085c | 42 | LIBPTY= |
5c36a0eb | 43 | ifeq "$(HAVE_OPENPTY)" "yes" |
7eda085c | 44 | LIBPTY:=$(LIBPTY) -lutil |
5c36a0eb | 45 | endif |
fd6b7a7f | 46 | |
6dbe3af9 KZ |
47 | # Programs requiring special compilation |
48 | ||
fd6b7a7f | 49 | NEEDS_CURSES= setterm |
7eda085c | 50 | NEEDS_OPENPTY= script |
6dbe3af9 | 51 | |
2b6fc908 | 52 | all: $(BIN) $(USRBIN) $(USRBIN.NONSHADOW) $(USRGAMES) |
6dbe3af9 | 53 | |
fd6b7a7f | 54 | $(NEEDS_CURSES): |
2b6fc908 | 55 | ifeq "$(HAVE_NCURSES)" "yes" |
fd6b7a7f | 56 | $(CC) $(LDFLAGS) $^ -o $@ $(LIBCURSES) |
2b6fc908 KZ |
57 | else |
58 | @echo $@ not made since it requires ncurses | |
59 | endif | |
6dbe3af9 | 60 | |
7eda085c KZ |
61 | $(NEEDS_OPENPTY): |
62 | $(CC) $(LDFLAGS) $^ -o $@ $(LIBPTY) | |
63 | ||
726f69e2 | 64 | %: %.sh |
6dbe3af9 | 65 | cp $@.sh $@ |
726f69e2 KZ |
66 | chmod 755 $@ |
67 | ||
68 | %: %.pl | |
69 | cp $@.pl $@ | |
70 | chmod 755 $@ | |
6dbe3af9 KZ |
71 | |
72 | # Rules for everything else | |
73 | ||
eb63b9b8 | 74 | cal.o: $(LIB)/errs.h |
5c36a0eb | 75 | cal: cal.o $(ERR_O) |
726f69e2 | 76 | chkdupexe: chkdupexe.pl |
6dbe3af9 | 77 | kill: kill.o procs.o |
5c36a0eb | 78 | logger: logger.o |
726f69e2 | 79 | mcookie: mcookie.o md5.o |
fd6b7a7f KZ |
80 | mcookie.o: mcookie.c md5.h |
81 | md5.o: md5.c md5.h | |
6dbe3af9 | 82 | reset: reset.sh |
7eda085c | 83 | script: script.o |
66ee8158 KZ |
84 | write.o: $(LIB)/carefulputc.h |
85 | write: write.o $(LIB)/carefulputc.o | |
5c36a0eb | 86 | |
2b6fc908 KZ |
87 | ifeq "$(HAVE_NCURSES)" "yes" |
88 | setterm: setterm.o | |
89 | endif | |
90 | ||
6dbe3af9 KZ |
91 | install: all |
92 | $(INSTALLDIR) $(BINDIR) $(USRBINDIR) | |
93 | $(INSTALLBIN) $(BIN) $(BINDIR) | |
94 | $(INSTALLBIN) $(USRBIN) $(USRBINDIR) | |
6dbe3af9 KZ |
95 | $(INSTALLDIR) $(MAN1DIR) $(MAN8DIR) |
96 | $(INSTALLMAN) $(MAN1) $(MAN1DIR) | |
726f69e2 KZ |
97 | ifeq "$(USE_TTY_GROUP)" "yes" |
98 | chgrp tty $(USRBINDIR)/write | |
99 | chmod g+s $(USRBINDIR)/write | |
100 | endif | |
6dbe3af9 KZ |
101 | |
102 | .PHONY: clean | |
103 | clean: | |
66ee8158 | 104 | -rm -f *.o *~ core $(BIN) $(USRBIN) $(MAYBE) |