Commit | Line | Data |
---|---|---|
051b1e55 DF |
1 | # |
2 | # Copyright (c) 1980 Regents of the University of California. | |
3 | # All rights reserved. The Berkeley software License Agreement | |
4 | # specifies the terms and conditions for redistribution. | |
5 | # | |
6 | # @(#)Makefile 5.1 (Berkeley) %G% | |
069fab95 KM |
7 | # |
8 | DESTDIR= | |
9 | CFLAGS= -O | |
10 | ||
11 | # Programs that live in subdirectories, and have makefiles of their own. | |
12 | # | |
8e792d0c | 13 | SUBDIR= lib2648 libF77 libI77 libU77 libcurses libdbm libg libln \ |
e81bce72 | 14 | libm libmp libnm libpc libplot libtermlib lpr me sendmail |
069fab95 KM |
15 | |
16 | # Shell scripts that need only be installed and are never removed. | |
17 | # | |
18 | SCRIPT= makewhatis | |
19 | ||
20 | # C programs that live in the current directory and do not need | |
21 | # explicit make lines. | |
22 | # | |
dcb9aa88 | 23 | STD= getNAME makekey |
069fab95 KM |
24 | |
25 | # C programs that live in the current directory and need explicit make lines. | |
26 | # | |
27 | NSTD= | |
28 | ||
29 | all: ${SUBDIR} ${STD} ${NSTD} | |
30 | ||
31 | ${SUBDIR}: /tmp | |
32 | cd $@; make ${MFLAGS} | |
33 | ||
34 | ${STD}: | |
35 | cc ${CFLAGS} -o $@ $@.c | |
36 | ||
37 | install: | |
38 | for i in ${SUBDIR}; do \ | |
39 | (cd $$i; make ${MFLAGS} DESTDIR=${DESTDIR} install); done | |
5d73db6e SL |
40 | for i in ${SCRIPT}; do (install -c $$i.sh ${DESTDIR}/usr/lib/$$i); done |
41 | for i in ${STD} ${NSTD}; do (install $$i ${DESTDIR}/usr/lib/$$i); done | |
42 | install -c lib.b ${DESTDIR}/usr/lib/lib.b | |
069fab95 KM |
43 | |
44 | clean: | |
45 | rm -f a.out core *.s *.o | |
46 | for i in ${SUBDIR}; do (cd $$i; make ${MFLAGS} clean); done | |
47 | rm -f ${STD} ${NSTD} | |
48 | ||
49 | depend: | |
50 | cat </dev/null >x.c | |
51 | for i in ${STD} ${NSTD}; do \ | |
52 | (echo $$i: $$i.c >>makedep; \ | |
53 | /bin/grep '^#[ ]*include' x.c $$i.c | sed \ | |
54 | -e '/\.\.\/h/d' \ | |
55 | -e 's,<\(.*\)>,"/usr/include/\1",' \ | |
56 | -e 's/:[^"]*"\([^"]*\)".*/: \1/' \ | |
57 | -e 's/\.c//' >>makedep); done | |
58 | echo '/^# DO NOT DELETE THIS LINE/+2,$$d' >eddep | |
59 | echo '$$r makedep' >>eddep | |
60 | echo 'w' >>eddep | |
61 | cp Makefile Makefile.bak | |
62 | ed - Makefile < eddep | |
63 | rm eddep makedep x.c | |
64 | echo '# DEPENDENCIES MUST END AT END OF FILE' >> Makefile | |
65 | echo '# IF YOU PUT STUFF HERE IT WILL GO AWAY' >> Makefile | |
66 | echo '# see make depend above' >> Makefile | |
67 | ||
68 | # Files listed in ${NSTD} have explicit make lines given below. | |
69 | ||
70 | # DO NOT DELETE THIS LINE -- make depend uses it | |
71 | ||
72 | getNAME: getNAME.c | |
73 | getNAME: /usr/include/stdio.h | |
74 | makekey: makekey.c | |
75 | # DEPENDENCIES MUST END AT END OF FILE | |
76 | # IF YOU PUT STUFF HERE IT WILL GO AWAY | |
77 | # see make depend above |