Commit | Line | Data |
---|---|---|
a064b3d4 | 1 | # Makefile 4.11 83/07/03 |
c2f9db1e KM |
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 \ | |
a064b3d4 | 13 | hangman mille monop quiz sail snake trek zork |
c2f9db1e | 14 | |
583192f1 KM |
15 | # Shell scripts that need only be installed and are never removed. |
16 | # | |
af62d475 | 17 | #SCRIPT= |
583192f1 | 18 | |
c2f9db1e KM |
19 | # C programs that live in the current directory and do not need |
20 | # explicit make lines. | |
21 | # | |
6c05e2fa SL |
22 | STD= arithmetic btlgammon banner bcd cfscores chess factor \ |
23 | fish number wump | |
c2f9db1e KM |
24 | |
25 | # C programs that live in the current directory and need explicit make lines. | |
26 | # | |
6c05e2fa | 27 | NSTD= canfield primes rain worm worms |
c2f9db1e KM |
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 | |
af62d475 | 40 | # for i in ${SCRIPT}; do (install -c $$i ${DESTDIR}/usr/games/$$i); done |
c2f9db1e | 41 | for i in ${STD} ${NSTD}; do (install $$i ${DESTDIR}/usr/games/$$i); done |
af62d475 | 42 | install -c chess.bin ${DESTDIR}/usr/games/lib/chess |
233e9bc2 KM |
43 | cat >${DESTDIR}/usr/games/lib/cfscores </dev/null |
44 | chmod 777 ${DESTDIR}/usr/games/lib/cfscores | |
c2f9db1e KM |
45 | |
46 | clean: | |
47 | rm -f a.out core *.s *.o | |
48 | for i in ${SUBDIR}; do (cd $$i; make ${MFLAGS} clean); done | |
49 | rm -f ${STD} ${NSTD} | |
50 | ||
51 | depend: | |
52 | cat </dev/null >x.c | |
53 | for i in ${STD} ${NSTD}; do \ | |
54 | (echo $$i: $$i.c >>makedep; \ | |
55 | /bin/grep '^#[ ]*include' x.c $$i.c | sed \ | |
56 | -e 's,<\(.*\)>,"/usr/include/\1",' \ | |
57 | -e 's/:[^"]*"\([^"]*\)".*/: \1/' \ | |
58 | -e 's/\.c//' >>makedep); done | |
59 | echo '/^# DO NOT DELETE THIS LINE/+2,$$d' >eddep | |
60 | echo '$$r makedep' >>eddep | |
61 | echo 'w' >>eddep | |
62 | cp Makefile Makefile.bak | |
63 | ed - Makefile < eddep | |
64 | rm eddep makedep x.c | |
65 | echo '# DEPENDENCIES MUST END AT END OF FILE' >> Makefile | |
66 | echo '# IF YOU PUT STUFF HERE IT WILL GO AWAY' >> Makefile | |
67 | echo '# see make depend above' >> Makefile | |
68 | ||
69 | # Files listed in ${NSTD} have explicit make lines given below. | |
70 | ||
71 | canfield: | |
6c05e2fa | 72 | cc -o canfield ${CFLAGS} canfield.c -lcurses -ltermcap |
c2f9db1e | 73 | |
6c05e2fa SL |
74 | primes: |
75 | cc -o primes ${CFLAGS} primes.c -lm | |
7a2e4160 | 76 | |
c2f9db1e | 77 | rain: |
6c05e2fa | 78 | cc -o rain ${CFLAGS} rain.c -lcurses -ltermcap |
c2f9db1e KM |
79 | |
80 | worm: | |
6c05e2fa | 81 | cc -o worm ${CFLAGS} worm.c -lcurses -ltermcap |
c2f9db1e KM |
82 | |
83 | worms: | |
6c05e2fa | 84 | cc -o worms ${CFLAGS} worms.c -lcurses -ltermcap |
c2f9db1e KM |
85 | |
86 | # DO NOT DELETE THIS LINE -- make depend uses it | |
87 | ||
7a2e4160 SL |
88 | arithmetic: arithmetic.c |
89 | arithmetic: /usr/include/stdio.h | |
90 | arithmetic: /usr/include/signal.h | |
91 | btlgammon: btlgammon.c | |
92 | btlgammon: /usr/include/stdio.h | |
93 | banner: banner.c | |
94 | banner: /usr/include/stdio.h | |
95 | bcd: bcd.c | |
dc2141e4 KM |
96 | cfscores: cfscores.c |
97 | cfscores: /usr/include/pwd.h | |
c2f9db1e KM |
98 | chess: chess.c |
99 | chess: /usr/include/stdio.h | |
100 | fish: fish.c | |
101 | fish: /usr/include/stdio.h | |
102 | number: number.c | |
c2f9db1e KM |
103 | wump: wump.c |
104 | wump: /usr/include/stdio.h | |
105 | wump: /usr/include/sgtty.h | |
c2f9db1e KM |
106 | canfield: canfield.c |
107 | canfield: /usr/include/curses.h | |
108 | canfield: /usr/include/ctype.h | |
109 | canfield: /usr/include/signal.h | |
dc2141e4 | 110 | canfield: /usr/include/sys/types.h |
c2f9db1e KM |
111 | rain: rain.c |
112 | rain: /usr/include/stdio.h | |
113 | rain: /usr/include/sgtty.h | |
114 | rain: /usr/include/signal.h | |
115 | worm: worm.c | |
116 | worm: /usr/include/ctype.h | |
117 | worm: /usr/include/curses.h | |
118 | worm: /usr/include/signal.h | |
119 | worms: worms.c | |
120 | worms: /usr/include/stdio.h | |
121 | worms: /usr/include/sgtty.h | |
122 | # DEPENDENCIES MUST END AT END OF FILE | |
123 | # IF YOU PUT STUFF HERE IT WILL GO AWAY | |
124 | # see make depend above |