BSD 4_3 release
[unix-history] / usr / src / games / Makefile
index ef04c95..dc590c1 100644 (file)
@@ -3,21 +3,16 @@
 # 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    4.17 (Berkeley) %G%
-#
-#      Makefile        4.15    84/12/03
+#      @(#)Makefile    5.4 (Berkeley) 2/1/86
 #
 DESTDIR=
 CFLAGS=        -O
 
 #
 DESTDIR=
 CFLAGS=        -O
 
-# The following sources are incomplete and cannot be compiled without
-# some work
-WORK=  aard ddl mpu
-
 # Programs that live in subdirectories, and have makefiles of their own.
 #
 # Programs that live in subdirectories, and have makefiles of their own.
 #
-SUBDIR=        adventure backgammon battlestar boggle ching compat cribbage doctor \
-       fortune hangman hunt mille monop quiz robots rogue sail snake trek zork
+SUBDIR=        aard adventure backgammon battlestar boggle ching compat \
+       cribbage ddl doctor fortune hangman hunt mille monop quiz \
+       robots rogue sail snake trek zork
 
 # Shell scripts that need only be installed and are never removed.
 #
 
 # Shell scripts that need only be installed and are never removed.
 #
@@ -35,9 +30,11 @@ NSTD=        canfield primes rain worm worms
 
 all:   ${SUBDIR} ${STD} ${NSTD}
 
 
 all:   ${SUBDIR} ${STD} ${NSTD}
 
-${SUBDIR}: /tmp
+${SUBDIR}: FRC
        cd $@; make ${MFLAGS}
 
        cd $@; make ${MFLAGS}
 
+FRC:
+
 ${STD}:
        cc ${CFLAGS} -o $@ $@.c
 
 ${STD}:
        cc ${CFLAGS} -o $@ $@.c
 
@@ -58,19 +55,19 @@ clean:
        rm -f ${STD} ${NSTD}
 
 depend:
        rm -f ${STD} ${NSTD}
 
 depend:
-       cat </dev/null >x.c
        for i in ${STD} ${NSTD}; do \
        for i in ${STD} ${NSTD}; do \
-               (echo $$i: $$i.c >>makedep; \
-               /bin/grep '^#[  ]*include' x.c $$i.c | sed \
-                       -e 's,<\(.*\)>,"/usr/include/\1",' \
-                       -e 's/:[^"]*"\([^"]*\)".*/: \1/' \
-                       -e 's/\.c//' >>makedep); done
+           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
        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
+       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
        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
@@ -94,40 +91,31 @@ worms:
 
 # DO NOT DELETE THIS LINE -- make depend uses it
 
 
 # DO NOT DELETE THIS LINE -- make depend uses it
 
-arithmetic: arithmetic.c
-arithmetic: /usr/include/stdio.h
-arithmetic: /usr/include/signal.h
-btlgammon: btlgammon.c
-btlgammon: /usr/include/stdio.h
-banner: banner.c
-banner: /usr/include/stdio.h
+arithmetic: arithmetic.c /usr/include/stdio.h /usr/include/signal.h
+btlgammon: btlgammon.c /usr/include/stdio.h
+banner: banner.c /usr/include/stdio.h
 bcd: bcd.c
 bcd: bcd.c
-cfscores: cfscores.c
-cfscores: /usr/include/pwd.h
-chess: chess.c
-chess: /usr/include/stdio.h
-fish: fish.c
-fish: /usr/include/stdio.h
+cfscores: cfscores.c /usr/include/pwd.h
+chess: chess.c /usr/include/stdio.h
+factor: factor.c
+fish: fish.c /usr/include/stdio.h
 number: number.c
 number: number.c
-wump: wump.c
-wump: /usr/include/stdio.h
-wump: /usr/include/sgtty.h
-canfield: canfield.c
-canfield: /usr/include/curses.h
-canfield: /usr/include/ctype.h
-canfield: /usr/include/signal.h
-canfield: /usr/include/sys/types.h
-rain: rain.c
-rain: /usr/include/stdio.h
-rain: /usr/include/sgtty.h
+wump: wump.c /usr/include/stdio.h /usr/include/sgtty.h /usr/include/sys/ioctl.h
+wump: /usr/include/sys/ttychars.h /usr/include/sys/ttydev.h
+canfield: canfield.c /usr/include/curses.h /usr/include/stdio.h
+canfield: /usr/include/sgtty.h /usr/include/sys/ioctl.h
+canfield: /usr/include/sys/ttychars.h /usr/include/sys/ttydev.h
+canfield: /usr/include/ctype.h /usr/include/signal.h /usr/include/sys/types.h
+primes: primes.c /usr/include/stdio.h /usr/include/math.h
+rain: rain.c /usr/include/stdio.h /usr/include/sgtty.h /usr/include/sys/ioctl.h
+rain: /usr/include/sys/ttychars.h /usr/include/sys/ttydev.h
 rain: /usr/include/signal.h
 rain: /usr/include/signal.h
-worm: worm.c
-worm: /usr/include/ctype.h
-worm: /usr/include/curses.h
-worm: /usr/include/signal.h
-worms: worms.c
-worms: /usr/include/stdio.h
-worms: /usr/include/sgtty.h
+worm: worm.c /usr/include/ctype.h /usr/include/curses.h /usr/include/stdio.h
+worm: /usr/include/sgtty.h /usr/include/sys/ioctl.h /usr/include/sys/ttychars.h
+worm: /usr/include/sys/ttydev.h /usr/include/signal.h
+worms: worms.c /usr/include/stdio.h /usr/include/sgtty.h
+worms: /usr/include/sys/ioctl.h /usr/include/sys/ttychars.h
+worms: /usr/include/sys/ttydev.h /usr/include/signal.h
 # DEPENDENCIES MUST END AT END OF FILE
 # IF YOU PUT STUFF HERE IT WILL GO AWAY
 # see make depend above
 # DEPENDENCIES MUST END AT END OF FILE
 # IF YOU PUT STUFF HERE IT WILL GO AWAY
 # see make depend above