BSD 4_3_Tahoe release
[unix-history] / usr / src / usr.bin / find / Makefile
index e30fbff..bfbcb2f 100644 (file)
@@ -1,69 +1,62 @@
-#      @(#)Makefile    4.3     (Berkeley)      85/06/01
 #
 #
-DESTDIR=
-CFLAGS=        -O
-LFLAGS=        
-
-# The programs themselves
+# Copyright (c) 1987 Regents of the University of California.
+# All rights reserved.  The Berkeley software License Agreement
+# specifies the terms and conditions for redistribution.
 #
 #
-PROG=  find
-LIBS=  bigram code
-
-# Sources
+#      @(#)Makefile    4.5     (Berkeley)      10/7/87
 #
 #
+CFLAGS=        -O
+LIBC=  /lib/libc.a
 SRCS=  find.c bigram.c code.c
 SRCS=  find.c bigram.c code.c
+OBJS=  find.o bigram.o code.o
 
 
-all: ${PROG} ${LIBS}
+all: find bigram code
 
 
-find: find.c
-       cc ${CFLAGS} -o find find.c
+find: find.c ${LIBC}
+       ${CC} ${CFLAGS} -o $@ find.c
 
 bigram: bigram.c
 
 bigram: bigram.c
-       cc ${CFLAGS} -o bigram bigram.c
+       ${CC} ${CFLAGS} -o $@ bigram.c
 
 code: code.c
 
 code: code.c
-       cc ${CFLAGS} -o code code.c
-
-install: ${PROG} ${LIBS}
-       install -s ${PROG} ${DESTDIR}/usr/bin/${PROG}
-       -mkdir ${DESTDIR}/usr/lib/find
-       install -s bigram ${DESTDIR}/usr/lib/find/bigram
-       install -s code ${DESTDIR}/usr/lib/find/code
-       install -c -m 755 updatedb.csh ${DESTDIR}/usr/lib/find/updatedb
-
-clean:
-       rm -f a.out core ${LIBS} ${PROG}
-
-depend:
-       cat </dev/null >x.c
-       for i in ${SRCS}; do \
-               (echo `basename $$i .c`.o: $$i >>makedep; \
-               /bin/grep '^#[  ]*include' x.c $$i | sed \
-                       -e 's,<\(.*\)>,"/usr/include/\1",' \
-                       -e 's/:[^"]*"\([^"]*\)".*/: \1/' \
-                       -e 's/\.c/.o/' >>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
-
-# DO NOT DELETE THIS LINE -- make depend uses it
-
-find.o: find.c
-find.o: /usr/include/stdio.h
-find.o: /usr/include/sys/param.h
-find.o: /usr/include/sys/dir.h
-find.o: /usr/include/sys/stat.h
-find.o: /usr/include/signal.h
-bigram.o: bigram.c
-bigram.o: /usr/include/stdio.h
-code.o: code.c
-code.o: /usr/include/stdio.h
-# DEPENDENCIES MUST END AT END OF FILE
-# IF YOU PUT STUFF HERE IT WILL GO AWAY
-# see make depend above
+       ${CC} ${CFLAGS} -o $@ code.c
+
+clean: FRC
+       rm -f ${OBJS} core find bigram code
+
+depend: FRC
+       mkdep -p ${CFLAGS} ${SRCS}
+
+install: FRC
+       install -s -o bin -g bin -m 755 find ${DESTDIR}/usr/bin/find
+       -[ -d ${DESTDIR}/usr/lib/find ] || mkdir ${DESTDIR}/usr/lib/find
+       install -s -o bin -g bin -m 755 bigram ${DESTDIR}/usr/lib/find/bigram
+       install -s -o bin -g bin -m 755 code ${DESTDIR}/usr/lib/find/code
+       install -c -o bin -g bin -m 755 updatedb.csh ${DESTDIR}/usr/lib/find/updatedb
+
+lint: FRC
+       lint ${CFLAGS} find.c
+       lint ${CFLAGS} bigram.c
+       lint ${CFLAGS} code.c
+
+tags: FRC
+       ctags find.c
+       ctags -a bigram.c
+       ctags -a code.c
+       sort -o tags tags
+
+FRC:
+
+# DO NOT DELETE THIS LINE -- mkdep uses it.
+# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.
+
+find: find.c /usr/include/stdio.h /usr/include/sys/param.h
+find: /usr/include/sys/types.h /usr/include/signal.h
+find: /usr/include/machine/trap.h /usr/include/machine/machparam.h
+find: /usr/include/machine/endian.h /usr/include/sys/dir.h
+find: /usr/include/sys/stat.h /usr/include/pwd.h /usr/include/grp.h
+find: /usr/include/utmp.h
+bigram: bigram.c /usr/include/stdio.h
+code: code.c /usr/include/stdio.h
+
+# IF YOU PUT ANYTHING HERE IT WILL GO AWAY