| 1 | # Makefile 4.13 83/08/02 |
| 2 | # |
| 3 | DESTDIR= |
| 4 | CFLAGS= -O |
| 5 | |
| 6 | # The following sources are incomplete and cannot be compiled without |
| 7 | # some work |
| 8 | WORK= aard ddl mpu |
| 9 | |
| 10 | # Programs that live in subdirectories, and have makefiles of their own. |
| 11 | # |
| 12 | SUBDIR= adventure backgammon boggle compat cribbage doctor fortune \ |
| 13 | hangman mille monop quiz rogue sail snake trek zork |
| 14 | |
| 15 | # Shell scripts that need only be installed and are never removed. |
| 16 | # |
| 17 | #SCRIPT= |
| 18 | |
| 19 | # C programs that live in the current directory and do not need |
| 20 | # explicit make lines. |
| 21 | # |
| 22 | STD= arithmetic btlgammon banner bcd cfscores chess factor \ |
| 23 | fish number wump |
| 24 | |
| 25 | # C programs that live in the current directory and need explicit make lines. |
| 26 | # |
| 27 | NSTD= canfield primes rain worm worms |
| 28 | |
| 29 | all: ${SUBDIR} ${STD} ${NSTD} |
| 30 | |
| 31 | ${SUBDIR}: /tmp |
| 32 | cd $@; make ${MFLAGS} |
| 33 | |
| 34 | ${STD}: |
| 35 | cc ${CFLAGS} -o $@ $@.c |
| 36 | |
| 37 | install: |
| 38 | for i in ${SUBDIR}; do \ |
| 39 | (cd $$i; make ${MFLAGS} DESTDIR=${DESTDIR} install); done |
| 40 | # for i in ${SCRIPT}; do (install -c $$i ${DESTDIR}/usr/games/$$i); done |
| 41 | for i in ${STD} ${NSTD}; do \ |
| 42 | (install -s $$i ${DESTDIR}/usr/games/$$i); \ |
| 43 | done |
| 44 | install -c chess.bin ${DESTDIR}/usr/games/lib/chess |
| 45 | cat >${DESTDIR}/usr/games/lib/cfscores </dev/null |
| 46 | chmod 777 ${DESTDIR}/usr/games/lib/cfscores |
| 47 | |
| 48 | clean: |
| 49 | rm -f a.out core *.s *.o |
| 50 | for i in ${SUBDIR}; do (cd $$i; make ${MFLAGS} clean); done |
| 51 | rm -f ${STD} ${NSTD} |
| 52 | |
| 53 | depend: |
| 54 | cat </dev/null >x.c |
| 55 | for i in ${STD} ${NSTD}; do \ |
| 56 | (echo $$i: $$i.c >>makedep; \ |
| 57 | /bin/grep '^#[ ]*include' x.c $$i.c | sed \ |
| 58 | -e 's,<\(.*\)>,"/usr/include/\1",' \ |
| 59 | -e 's/:[^"]*"\([^"]*\)".*/: \1/' \ |
| 60 | -e 's/\.c//' >>makedep); done |
| 61 | echo '/^# DO NOT DELETE THIS LINE/+2,$$d' >eddep |
| 62 | echo '$$r makedep' >>eddep |
| 63 | echo 'w' >>eddep |
| 64 | cp Makefile Makefile.bak |
| 65 | ed - Makefile < eddep |
| 66 | rm eddep makedep x.c |
| 67 | echo '# DEPENDENCIES MUST END AT END OF FILE' >> Makefile |
| 68 | echo '# IF YOU PUT STUFF HERE IT WILL GO AWAY' >> Makefile |
| 69 | echo '# see make depend above' >> Makefile |
| 70 | |
| 71 | # Files listed in ${NSTD} have explicit make lines given below. |
| 72 | |
| 73 | canfield: |
| 74 | cc -o canfield ${CFLAGS} canfield.c -lcurses -ltermcap |
| 75 | |
| 76 | primes: |
| 77 | cc -o primes ${CFLAGS} primes.c -lm |
| 78 | |
| 79 | rain: |
| 80 | cc -o rain ${CFLAGS} rain.c -lcurses -ltermcap |
| 81 | |
| 82 | worm: |
| 83 | cc -o worm ${CFLAGS} worm.c -lcurses -ltermcap |
| 84 | |
| 85 | worms: |
| 86 | cc -o worms ${CFLAGS} worms.c -lcurses -ltermcap |
| 87 | |
| 88 | # DO NOT DELETE THIS LINE -- make depend uses it |
| 89 | |
| 90 | arithmetic: arithmetic.c |
| 91 | arithmetic: /usr/include/stdio.h |
| 92 | arithmetic: /usr/include/signal.h |
| 93 | btlgammon: btlgammon.c |
| 94 | btlgammon: /usr/include/stdio.h |
| 95 | banner: banner.c |
| 96 | banner: /usr/include/stdio.h |
| 97 | bcd: bcd.c |
| 98 | cfscores: cfscores.c |
| 99 | cfscores: /usr/include/pwd.h |
| 100 | chess: chess.c |
| 101 | chess: /usr/include/stdio.h |
| 102 | fish: fish.c |
| 103 | fish: /usr/include/stdio.h |
| 104 | number: number.c |
| 105 | wump: wump.c |
| 106 | wump: /usr/include/stdio.h |
| 107 | wump: /usr/include/sgtty.h |
| 108 | canfield: canfield.c |
| 109 | canfield: /usr/include/curses.h |
| 110 | canfield: /usr/include/ctype.h |
| 111 | canfield: /usr/include/signal.h |
| 112 | canfield: /usr/include/sys/types.h |
| 113 | rain: rain.c |
| 114 | rain: /usr/include/stdio.h |
| 115 | rain: /usr/include/sgtty.h |
| 116 | rain: /usr/include/signal.h |
| 117 | worm: worm.c |
| 118 | worm: /usr/include/ctype.h |
| 119 | worm: /usr/include/curses.h |
| 120 | worm: /usr/include/signal.h |
| 121 | worms: worms.c |
| 122 | worms: /usr/include/stdio.h |
| 123 | worms: /usr/include/sgtty.h |
| 124 | # DEPENDENCIES MUST END AT END OF FILE |
| 125 | # IF YOU PUT STUFF HERE IT WILL GO AWAY |
| 126 | # see make depend above |