Commit | Line | Data |
---|---|---|
051b1e55 | 1 | # |
d0aeaf5a | 2 | # Copyright (c) 1983 Regents of the University of California. |
051b1e55 DF |
3 | # All rights reserved. The Berkeley software License Agreement |
4 | # specifies the terms and conditions for redistribution. | |
5 | # | |
97f841da | 6 | # @(#)Makefile 5.10 (Berkeley) %G% |
069fab95 KM |
7 | # |
8 | DESTDIR= | |
9 | CFLAGS= -O | |
74d5a2b2 SL |
10 | TAGSFILE=tags |
11 | ||
12 | # Subdirectories whose routines are included in the making of the | |
13 | # master tags file (/usr/lib/tags); the Fortran libraries should | |
14 | # be on this list, but we don't control them.... | |
15 | # | |
16 | TAGSDIR=libcurses libdbm libln libm libmp libpc libtermlib | |
069fab95 KM |
17 | |
18 | # Programs that live in subdirectories, and have makefiles of their own. | |
19 | # | |
97f841da | 20 | SUBDIR= learn lib2648 libF77 libI77 libU77 libcurses libdbm libg libln \ |
1a84272e | 21 | libom libm libmp libpc libplot libtermlib liby lpr me sendmail |
069fab95 KM |
22 | |
23 | # Shell scripts that need only be installed and are never removed. | |
24 | # | |
25 | SCRIPT= makewhatis | |
26 | ||
27 | # C programs that live in the current directory and do not need | |
28 | # explicit make lines. | |
29 | # | |
dcb9aa88 | 30 | STD= getNAME makekey |
069fab95 KM |
31 | |
32 | # C programs that live in the current directory and need explicit make lines. | |
33 | # | |
34 | NSTD= | |
35 | ||
36 | all: ${SUBDIR} ${STD} ${NSTD} | |
37 | ||
f0f83cf4 | 38 | ${SUBDIR}: FRC |
069fab95 KM |
39 | cd $@; make ${MFLAGS} |
40 | ||
f0f83cf4 KM |
41 | FRC: |
42 | ||
069fab95 KM |
43 | ${STD}: |
44 | cc ${CFLAGS} -o $@ $@.c | |
45 | ||
46 | install: | |
3ceb07a7 | 47 | -for i in ${SUBDIR}; do \ |
069fab95 | 48 | (cd $$i; make ${MFLAGS} DESTDIR=${DESTDIR} install); done |
3ceb07a7 | 49 | -for i in ${SCRIPT}; do (install -c $$i.sh ${DESTDIR}/usr/lib/$$i); done |
b84e9ea4 | 50 | -for i in ${STD} ${NSTD}; do (install -s $$i ${DESTDIR}/usr/lib/$$i); done |
5d73db6e | 51 | install -c lib.b ${DESTDIR}/usr/lib/lib.b |
069fab95 | 52 | |
74d5a2b2 | 53 | tags: |
3ceb07a7 | 54 | -for i in ${TAGSDIR}; do \ |
74d5a2b2 SL |
55 | (cd $$i; make ${MFLAGS} TAGSFILE=../${TAGSFILE} tags); \ |
56 | done | |
57 | ||
069fab95 | 58 | clean: |
74d5a2b2 | 59 | rm -f a.out core *.s *.o tags |
3ceb07a7 | 60 | -for i in ${SUBDIR}; do (cd $$i; make ${MFLAGS} clean); done |
069fab95 KM |
61 | rm -f ${STD} ${NSTD} |
62 | ||
63 | depend: | |
e34dfa89 KM |
64 | for i in ${STD} ${NSTD}; do \ |
65 | cc -M ${INCPATH} $$i.c | sed 's/\.o//' | \ | |
66 | awk ' { if ($$1 != prev) \ | |
67 | { if (rec != "") print rec; rec = $$0; prev = $$1; } \ | |
68 | else { if (length(rec $$2) > 78) { print rec; rec = $$0; } \ | |
69 | else rec = rec " " $$2 } } \ | |
70 | END { print rec } ' >> makedep; done | |
069fab95 KM |
71 | echo '/^# DO NOT DELETE THIS LINE/+2,$$d' >eddep |
72 | echo '$$r makedep' >>eddep | |
73 | echo 'w' >>eddep | |
74 | cp Makefile Makefile.bak | |
75 | ed - Makefile < eddep | |
e34dfa89 | 76 | rm eddep makedep |
069fab95 KM |
77 | echo '# DEPENDENCIES MUST END AT END OF FILE' >> Makefile |
78 | echo '# IF YOU PUT STUFF HERE IT WILL GO AWAY' >> Makefile | |
79 | echo '# see make depend above' >> Makefile | |
80 | ||
81 | # Files listed in ${NSTD} have explicit make lines given below. | |
82 | ||
83 | # DO NOT DELETE THIS LINE -- make depend uses it | |
84 | ||
e34dfa89 | 85 | getNAME: getNAME.c /usr/include/strings.h /usr/include/stdio.h |
069fab95 KM |
86 | makekey: makekey.c |
87 | # DEPENDENCIES MUST END AT END OF FILE | |
88 | # IF YOU PUT STUFF HERE IT WILL GO AWAY | |
89 | # see make depend above |