jsb->callf; 1:->9:
[unix-history] / usr / src / lib / Makefile
index 9bd9e77..12ffbe7 100644 (file)
@@ -1,9 +1,9 @@
 #
 #
-# Copyright (c) 1983 Regents of the University of California.
+# Copyright (c) 1987 Regents of the University of California.
 # All rights reserved.  The Berkeley software License Agreement
 # specifies the terms and conditions for redistribution.
 #
 # All rights reserved.  The Berkeley software License Agreement
 # specifies the terms and conditions for redistribution.
 #
-#      @(#)Makefile    5.9 (Berkeley) %G%
+#      @(#)Makefile    5.11 (Berkeley) %G%
 #
 DESTDIR=
 CFLAGS=        -O
 #
 DESTDIR=
 CFLAGS=        -O
@@ -17,13 +17,17 @@ TAGSDIR=libcurses libdbm libln libm libmp libpc libtermlib
 
 # Programs that live in subdirectories, and have makefiles of their own.
 #
 
 # Programs that live in subdirectories, and have makefiles of their own.
 #
-SUBDIR=        lib2648 libF77 libI77 libU77 libcurses libdbm libg libln \
+SUBDIR=        learn lib2648 libF77 libI77 libU77 libcurses libdbm libg libln \
        libom libm libmp libpc libplot libtermlib liby lpr me sendmail
 
 # Shell scripts that need only be installed and are never removed.
 #
 SCRIPT=        makewhatis
 
        libom libm libmp libpc libplot libtermlib liby lpr me sendmail
 
 # Shell scripts that need only be installed and are never removed.
 #
 SCRIPT=        makewhatis
 
+# C source that lives in the current directory
+#
+SRCS=  getNAME.c makekey.c
+
 # C programs that live in the current directory and do not need
 # explicit make lines.
 #
 # C programs that live in the current directory and do not need
 # explicit make lines.
 #
@@ -31,7 +35,7 @@ STD=  getNAME makekey
 
 # C programs that live in the current directory and need explicit make lines.
 #
 
 # C programs that live in the current directory and need explicit make lines.
 #
-NSTD=  
+NSTD=
 
 all:   ${SUBDIR} ${STD} ${NSTD}
 
 
 all:   ${SUBDIR} ${STD} ${NSTD}
 
@@ -41,14 +45,19 @@ ${SUBDIR}: FRC
 FRC:
 
 ${STD}:
 FRC:
 
 ${STD}:
-       cc ${CFLAGS} -o $@ $@.c
+       ${CC} ${CFLAGS} -o $@ $@.c
 
 install:
        -for i in ${SUBDIR}; do \
 
 install:
        -for i in ${SUBDIR}; do \
-               (cd $$i; make ${MFLAGS} DESTDIR=${DESTDIR} install); done
-       -for i in ${SCRIPT}; do (install -c $$i.sh ${DESTDIR}/usr/lib/$$i); done
-       -for i in ${STD} ${NSTD}; do (install -s $$i ${DESTDIR}/usr/lib/$$i); done
-       install -c lib.b ${DESTDIR}/usr/lib/lib.b
+               (cd $$i; make ${MFLAGS} DESTDIR=${DESTDIR} install); \
+       done
+       -for i in ${SCRIPT}; do \
+               (install -c -o bin -g bin -m 755 $$i.sh ${DESTDIR}/usr/lib/$$i); \
+       done
+       -for i in ${STD} ${NSTD}; do \
+               (install -s -o bin -g bin -m 755 $$i ${DESTDIR}/usr/lib/$$i); \
+       done
+       install -c -o bin -g bin -m 755 lib.b ${DESTDIR}/usr/lib/lib.b
 
 tags:
        -for i in ${TAGSDIR}; do \
 
 tags:
        -for i in ${TAGSDIR}; do \
@@ -56,34 +65,19 @@ tags:
        done
 
 clean:
        done
 
 clean:
-       rm -f a.out core *.s *.o tags
+       rm -f a.out core *.s *.o tags ${STD} ${NSTD}
        -for i in ${SUBDIR}; do (cd $$i; make ${MFLAGS} clean); done
        -for i in ${SUBDIR}; do (cd $$i; make ${MFLAGS} clean); done
-       rm -f ${STD} ${NSTD}
 
 depend:
 
 depend:
-       for i in ${STD} ${NSTD}; do \
-           cc -M ${INCPATH} $$i.c | sed 's/\.o//' | \
-           awk ' { if ($$1 != prev) \
-               { if (rec != "") print rec; rec = $$0; prev = $$1; } \
-               else { if (length(rec $$2) > 78) { print rec; rec = $$0; } \
-               else rec = rec " " $$2 } } \
-               END { print rec } ' >> makedep; done
-       echo '/^# DO NOT DELETE THIS LINE/+2,$$d' >eddep
-       echo '$$r makedep' >>eddep
-       echo 'w' >>eddep
-       cp Makefile Makefile.bak
-       ed - Makefile < eddep
-       rm eddep makedep
-       echo '# DEPENDENCIES MUST END AT END OF FILE' >> Makefile
-       echo '# IF YOU PUT STUFF HERE IT WILL GO AWAY' >> Makefile
-       echo '# see make depend above' >> Makefile
+       mkdep -p ${CFLAGS} ${SRCS}
+       -for i in ${SUBDIR}; do (cd $$i; make ${MFLAGS} depend); done
 
 # Files listed in ${NSTD} have explicit make lines given below.
 
 
 # Files listed in ${NSTD} have explicit make lines given below.
 
-# DO NOT DELETE THIS LINE -- make depend uses it
+# DO NOT DELETE THIS LINE -- mkdep uses it.
+# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.
 
 getNAME: getNAME.c /usr/include/strings.h /usr/include/stdio.h
 makekey: makekey.c
 
 getNAME: getNAME.c /usr/include/strings.h /usr/include/stdio.h
 makekey: makekey.c
-# DEPENDENCIES MUST END AT END OF FILE
-# IF YOU PUT STUFF HERE IT WILL GO AWAY
-# see make depend above
+
+# IF YOU PUT ANYTHING HERE IT WILL GO AWAY