Commit | Line | Data |
---|---|---|
7097427e | 1 | # @(#)Makefile 4.4 (Berkeley) %G% |
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 \ | |
7097427e | 13 | mille monop quiz snake 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 | # | |
7097427e | 22 | STD= arithmetic btlgammon banner bcd chess fish number wump |
c2f9db1e KM |
23 | |
24 | # C programs that live in the current directory and need explicit make lines. | |
25 | # | |
26 | NSTD= canfield hangman rain worm worms | |
27 | ||
28 | all: ${SUBDIR} ${STD} ${NSTD} | |
29 | ||
30 | ${SUBDIR}: /tmp | |
31 | cd $@; make ${MFLAGS} | |
32 | ||
33 | ${STD}: | |
34 | cc ${CFLAGS} -o $@ $@.c | |
35 | ||
36 | install: | |
37 | for i in ${SUBDIR}; do \ | |
38 | (cd $$i; make ${MFLAGS} DESTDIR=${DESTDIR} install); done | |
af62d475 | 39 | # for i in ${SCRIPT}; do (install -c $$i ${DESTDIR}/usr/games/$$i); done |
c2f9db1e | 40 | for i in ${STD} ${NSTD}; do (install $$i ${DESTDIR}/usr/games/$$i); done |
af62d475 | 41 | install -c chess.bin ${DESTDIR}/usr/games/lib/chess |
c2f9db1e KM |
42 | |
43 | clean: | |
44 | rm -f a.out core *.s *.o | |
45 | for i in ${SUBDIR}; do (cd $$i; make ${MFLAGS} clean); done | |
46 | rm -f ${STD} ${NSTD} | |
47 | ||
48 | depend: | |
49 | cat </dev/null >x.c | |
50 | for i in ${STD} ${NSTD}; do \ | |
51 | (echo $$i: $$i.c >>makedep; \ | |
52 | /bin/grep '^#[ ]*include' x.c $$i.c | sed \ | |
53 | -e 's,<\(.*\)>,"/usr/include/\1",' \ | |
54 | -e 's/:[^"]*"\([^"]*\)".*/: \1/' \ | |
55 | -e 's/\.c//' >>makedep); done | |
56 | echo '/^# DO NOT DELETE THIS LINE/+2,$$d' >eddep | |
57 | echo '$$r makedep' >>eddep | |
58 | echo 'w' >>eddep | |
59 | cp Makefile Makefile.bak | |
60 | ed - Makefile < eddep | |
61 | rm eddep makedep x.c | |
62 | echo '# DEPENDENCIES MUST END AT END OF FILE' >> Makefile | |
63 | echo '# IF YOU PUT STUFF HERE IT WILL GO AWAY' >> Makefile | |
64 | echo '# see make depend above' >> Makefile | |
65 | ||
66 | # Files listed in ${NSTD} have explicit make lines given below. | |
67 | ||
68 | canfield: | |
69 | cc -o canfield canfield.c -lcurses -ltermcap | |
70 | ||
71 | hangman: | |
72 | cc -o hangman hangman.c -lcurses -ltermcap -lm | |
73 | ||
74 | rain: | |
75 | cc -o rain rain.c -lcurses -ltermcap | |
76 | ||
77 | worm: | |
78 | cc -o worm worm.c -lcurses -ltermcap | |
79 | ||
80 | worms: | |
81 | cc -o worms worms.c -lcurses -ltermcap | |
82 | ||
83 | # DO NOT DELETE THIS LINE -- make depend uses it | |
84 | ||
85 | arithmetic: arithmetic.c | |
86 | arithmetic: /usr/include/stdio.h | |
87 | arithmetic: /usr/include/signal.h | |
88 | btlgammon: btlgammon.c | |
89 | btlgammon: /usr/include/stdio.h | |
90 | banner: banner.c | |
91 | banner: /usr/include/stdio.h | |
92 | bcd: bcd.c | |
93 | chess: chess.c | |
94 | chess: /usr/include/stdio.h | |
95 | fish: fish.c | |
96 | fish: /usr/include/stdio.h | |
97 | number: number.c | |
c2f9db1e KM |
98 | wump: wump.c |
99 | wump: /usr/include/stdio.h | |
100 | wump: /usr/include/sgtty.h | |
c2f9db1e KM |
101 | canfield: canfield.c |
102 | canfield: /usr/include/curses.h | |
103 | canfield: /usr/include/ctype.h | |
104 | canfield: /usr/include/signal.h | |
105 | hangman: hangman.c | |
106 | hangman: /usr/include/stdio.h | |
107 | hangman: /usr/include/sys/types.h | |
108 | hangman: /usr/include/sys/stat.h | |
109 | rain: rain.c | |
110 | rain: /usr/include/stdio.h | |
111 | rain: /usr/include/sgtty.h | |
112 | rain: /usr/include/signal.h | |
113 | worm: worm.c | |
114 | worm: /usr/include/ctype.h | |
115 | worm: /usr/include/curses.h | |
116 | worm: /usr/include/signal.h | |
117 | worms: worms.c | |
118 | worms: /usr/include/stdio.h | |
119 | worms: /usr/include/sgtty.h | |
120 | # DEPENDENCIES MUST END AT END OF FILE | |
121 | # IF YOU PUT STUFF HERE IT WILL GO AWAY | |
122 | # see make depend above |