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