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