ANSIfication; bug report 4.3BSD/bin/223
[unix-history] / usr / src / lib / Makefile
index a2471fe..8e317f0 100644 (file)
@@ -1,77 +1,84 @@
-#      @(#)Makefile    4.5     (Berkeley)      %G%
 #
 #
-DESTDIR=
+# Copyright (c) 1987 Regents of the University of California.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms are permitted
+# provided that this notice is preserved and that due credit is given
+# to the University of California at Berkeley. The name of the University
+# may not be used to endorse or promote products derived from this
+# software without specific prior written permission. This software
+# is provided ``as is'' without express or implied warranty.
+#
+#      @(#)Makefile    5.13 (Berkeley) %G%
+#
 CFLAGS=        -O
 CFLAGS=        -O
+LIBC=  /lib/libc.a
+TAGSFILE=tags
+
+# Subdirectories whose routines are included in the making of the
+# master tags file (/usr/lib/tags); the Fortran libraries should
+# be on this list, but we don't control them....
+#
+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 libdbm libg libjobs libln libm libmp \
-       libnm libplot libtermlib lpr sendmail
+SUBDIR=        learn lib2648 libF77 libI77 libU77 libcurses libdbm libg libln \
+       libm libmp libpc libplot libtermlib liby lpr me sendmail
 
 
-# Shell scripts that need only be installed and are never removed.
+# C source that lives in the current directory
 #
 #
-SCRIPT=        makewhatis
+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.
 #
-STD=   atrun getNAME makekey
+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}
 
 
-${SUBDIR}: /tmp
+${SUBDIR}: FRC
        cd $@; make ${MFLAGS}
 
        cd $@; make ${MFLAGS}
 
-${STD}:
-       cc ${CFLAGS} -o $@ $@.c
+${STD}: ${LIBC}
+       ${CC} ${CFLAGS} -o $@ $@.c
 
 
-install:
-       for i in ${SUBDIR}; do \
-               (cd $$i; make ${MFLAGS} DESTDIR=${DESTDIR} install); done
-       for i in ${SCRIPT}; do (install -c $$i.sh ${DESTDIR}/etc/$$i); done
-       for i in ${STD} ${NSTD}; do (install $$i ${DESTDIR}/etc/$$i); done
+install: FRC
+       -for i in ${SUBDIR}; do \
+               (cd $$i; make ${MFLAGS} DESTDIR=${DESTDIR} install); \
+       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
 
 
-clean:
-       rm -f a.out core *.s *.o
+tags: FRC
+       -for i in ${TAGSDIR}; do \
+               (cd $$i; make ${MFLAGS} TAGSFILE=../${TAGSFILE} tags); \
+       done
+
+clean: FRC
+       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:
-       cat </dev/null >x.c
-       for i in ${STD} ${NSTD}; do \
-               (echo $$i: $$i.c >>makedep; \
-               /bin/grep '^#[  ]*include' x.c $$i.c | sed \
-                       -e '/\.\.\/h/d' \
-                       -e 's,<\(.*\)>,"/usr/include/\1",' \
-                       -e 's/:[^"]*"\([^"]*\)".*/: \1/' \
-                       -e 's/\.c//' >>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 x.c
-       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
+
+depend: ldepend
+       for i in ${SUBDIR}; do (cd $$i; make ${MFLAGS} depend); done
+
+ldepend: FRC
+       mkdep -p ${CFLAGS} ${SRCS}
+
+FRC:
 
 # 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.
 
 
-atrun: atrun.c
-atrun: /usr/include/stdio.h
-atrun: /usr/include/sys/param.h
-atrun: /usr/include/sys/dir.h
-atrun: /usr/include/time.h
-atrun: /usr/include/sys/stat.h
-getNAME: getNAME.c
-getNAME: /usr/include/stdio.h
+getNAME: getNAME.c /usr/include/strings.h /usr/include/stdio.h
 makekey: makekey.c
 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