Commit | Line | Data |
---|---|---|
e804469b | 1 | # @(#)Makefile 4.6 (Berkeley) 2/8/83 |
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 \ | |
7424517d | 13 | mille monop quiz snake zork hangman |
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 | # | |
7a2e4160 | 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 | # | |
7a2e4160 | 26 | NSTD= canfield rain worm worms |
c2f9db1e KM |
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 | ||
7a2e4160 | 71 | |
c2f9db1e KM |
72 | rain: |
73 | cc -o rain rain.c -lcurses -ltermcap | |
74 | ||
75 | worm: | |
76 | cc -o worm worm.c -lcurses -ltermcap | |
77 | ||
78 | worms: | |
79 | cc -o worms worms.c -lcurses -ltermcap | |
80 | ||
81 | # DO NOT DELETE THIS LINE -- make depend uses it | |
82 | ||
7a2e4160 SL |
83 | arithmetic: arithmetic.c |
84 | arithmetic: /usr/include/stdio.h | |
85 | arithmetic: /usr/include/signal.h | |
86 | btlgammon: btlgammon.c | |
87 | btlgammon: /usr/include/stdio.h | |
88 | banner: banner.c | |
89 | banner: /usr/include/stdio.h | |
90 | bcd: bcd.c | |
91 | chess: chess.c | |
92 | chess: /usr/include/stdio.h | |
93 | fish: fish.c | |
c2f9db1e KM |
94 | arithmetic: arithmetic.c |
95 | arithmetic: /usr/include/stdio.h | |
96 | arithmetic: /usr/include/signal.h | |
97 | btlgammon: btlgammon.c | |
98 | btlgammon: /usr/include/stdio.h | |
99 | banner: banner.c | |
100 | banner: /usr/include/stdio.h | |
101 | bcd: bcd.c | |
102 | chess: chess.c | |
103 | chess: /usr/include/stdio.h | |
104 | fish: fish.c | |
105 | fish: /usr/include/stdio.h | |
106 | number: number.c | |
c2f9db1e KM |
107 | wump: wump.c |
108 | wump: /usr/include/stdio.h | |
109 | wump: /usr/include/sgtty.h | |
c2f9db1e KM |
110 | canfield: canfield.c |
111 | canfield: /usr/include/curses.h | |
112 | canfield: /usr/include/ctype.h | |
113 | canfield: /usr/include/signal.h | |
c2f9db1e KM |
114 | rain: rain.c |
115 | rain: /usr/include/stdio.h | |
116 | rain: /usr/include/sgtty.h | |
117 | rain: /usr/include/signal.h | |
118 | worm: worm.c | |
119 | worm: /usr/include/ctype.h | |
120 | worm: /usr/include/curses.h | |
121 | worm: /usr/include/signal.h | |
122 | worms: worms.c | |
123 | worms: /usr/include/stdio.h | |
124 | worms: /usr/include/sgtty.h | |
125 | # DEPENDENCIES MUST END AT END OF FILE | |
126 | # IF YOU PUT STUFF HERE IT WILL GO AWAY | |
127 | # see make depend above |