Commit | Line | Data |
---|---|---|
37eb54a9 | 1 | # |
25702fae KB |
2 | # Copyright (c) 1980, 1987 Regents of the University of California. |
3 | # All rights reserved. | |
37eb54a9 | 4 | # |
25702fae | 5 | # Redistribution and use in source and binary forms are permitted |
57a981eb KB |
6 | # provided that the above copyright notice and this paragraph are |
7 | # duplicated in all such forms and that any documentation, | |
8 | # advertising materials, and other materials related to such | |
9 | # distribution and use acknowledge that the software was developed | |
10 | # by the University of California, Berkeley. The name of the | |
11 | # University may not be used to endorse or promote products derived | |
12 | # from this software without specific prior written permission. | |
13 | # THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR | |
14 | # IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED | |
15 | # WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. | |
25702fae | 16 | # |
9c080d22 | 17 | # @(#)Makefile 5.12 (Berkeley) %G% |
c2f9db1e KM |
18 | # |
19 | DESTDIR= | |
20 | CFLAGS= -O | |
25702fae | 21 | LIBC= /lib/libc.a |
c2f9db1e | 22 | |
c2f9db1e KM |
23 | # Programs that live in subdirectories, and have makefiles of their own. |
24 | # | |
25702fae KB |
25 | # doctor removed until lisp works |
26 | SUBDIR= adventure atc backgammon battlestar boggle btlgammon canfield \ | |
4769cfe7 | 27 | cribbage dm fortune hack hangman hunt mille monop \ |
25702fae KB |
28 | phantasia quiz robots rogue sail snake trek \ |
29 | games.${MACHINE} | |
c2f9db1e | 30 | |
583192f1 KM |
31 | # Shell scripts that need only be installed and are never removed. |
32 | # | |
5bad83a0 | 33 | SCRIPT= wargames |
583192f1 | 34 | |
25702fae KB |
35 | # C sources that live in the current directory |
36 | # | |
9c080d22 KB |
37 | SRCS= arithmetic.c banner.c bcd.c factor.c fish.c morse.c number.c ppt.c \ |
38 | primes.c rain.c worm.c worms.c wump.c | |
25702fae | 39 | |
c2f9db1e KM |
40 | # C programs that live in the current directory and do not need |
41 | # explicit make lines. | |
42 | # | |
9c080d22 | 43 | STD= arithmetic banner bcd factor fish morse number ppt wump |
c2f9db1e KM |
44 | |
45 | # C programs that live in the current directory and need explicit make lines. | |
46 | # | |
25702fae KB |
47 | NSTD= primes rain worm worms |
48 | ||
49 | # programs that get hidden | |
50 | HIDE= fish wump worm | |
51 | ||
52 | # programs that don't | |
9c080d22 | 53 | NOHIDE= arithmetic banner bcd factor morse number ppt primes rain worms |
c2f9db1e | 54 | |
23ba14cd KM |
55 | # Programs that require a lisp interpreter or compiler |
56 | LISP= doctor | |
57 | ||
c2f9db1e KM |
58 | all: ${SUBDIR} ${STD} ${NSTD} |
59 | ||
f0f83cf4 | 60 | ${SUBDIR}: FRC |
c2f9db1e KM |
61 | cd $@; make ${MFLAGS} |
62 | ||
25702fae KB |
63 | ${STD}: ${LIBC} |
64 | ${CC} ${CFLAGS} -o $@ $@.c | |
c2f9db1e | 65 | |
25702fae | 66 | install: FRC |
37eb54a9 | 67 | -for i in ${SUBDIR}; do \ |
c2f9db1e | 68 | (cd $$i; make ${MFLAGS} DESTDIR=${DESTDIR} install); done |
5bad83a0 | 69 | -for i in ${SCRIPT}; do \ |
25702fae KB |
70 | (install -c -o games -g bin -m 755 $$i.sh ${DESTDIR}/usr/games/$$i); done |
71 | install -s -o games -g bin -m 700 ${HIDE} ${DESTDIR}/usr/games/hide | |
72 | install -s -o games -g bin -m 755 ${NOHIDE} ${DESTDIR}/usr/games | |
73 | -for i in ${HIDE}; do \ | |
74 | (cd ${DESTDIR}/usr/games; rm -f $$i; ln -s dm $$i; chown games.bin $$i) \ | |
75 | done | |
76 | ||
77 | clean: FRC | |
78 | -for i in ${SUBDIR} games.vax games.tahoe; do \ | |
79 | (cd $$i; make ${MFLAGS} clean); \ | |
80 | done | |
81 | rm -f ${STD} ${NSTD} a.out core *.s *.o | |
82 | ||
83 | depend: ldepend | |
e1ce0f80 | 84 | for i in ${SUBDIR}; do (cd $$i; make ${MFLAGS} depend); done |
c2f9db1e | 85 | |
25702fae KB |
86 | ldepend: FRC |
87 | mkdep -p ${CFLAGS} ${SRCS} | |
c2f9db1e | 88 | |
25702fae KB |
89 | FRC: |
90 | ||
91 | # Files listed in ${NSTD} have explicit make lines given below. | |
c2f9db1e | 92 | |
6c05e2fa | 93 | primes: |
25702fae | 94 | ${CC} -o $@ ${CFLAGS} primes.c -lm |
7a2e4160 | 95 | |
c2f9db1e | 96 | rain: |
25702fae | 97 | ${CC} -o $@ ${CFLAGS} rain.c -lcurses -ltermcap |
c2f9db1e KM |
98 | |
99 | worm: | |
25702fae | 100 | ${CC} -o $@ ${CFLAGS} worm.c -lcurses -ltermcap |
c2f9db1e KM |
101 | |
102 | worms: | |
25702fae | 103 | ${CC} -o $@ ${CFLAGS} worms.c -lcurses -ltermcap |
c2f9db1e | 104 | |
25702fae KB |
105 | # DO NOT DELETE THIS LINE -- mkdep uses it. |
106 | # DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. | |
c2f9db1e | 107 | |
2154d805 | 108 | arithmetic: arithmetic.c /usr/include/stdio.h /usr/include/signal.h |
25702fae | 109 | arithmetic: /usr/include/machine/trap.h |
2154d805 | 110 | banner: banner.c /usr/include/stdio.h |
7a2e4160 | 111 | bcd: bcd.c |
2154d805 KM |
112 | factor: factor.c |
113 | fish: fish.c /usr/include/stdio.h | |
25702fae | 114 | number: number.c /usr/include/stdio.h /usr/include/ctype.h |
85e3e21d | 115 | ppt: ppt.c /usr/include/stdio.h |
2154d805 | 116 | primes: primes.c /usr/include/stdio.h /usr/include/math.h |
85e3e21d KB |
117 | rain: rain.c /usr/include/sys/types.h /usr/include/stdio.h /usr/include/sgtty.h |
118 | rain: /usr/include/sys/ioctl.h /usr/include/sys/ttychars.h | |
4769cfe7 KB |
119 | rain: /usr/include/sys/ttydefaults.h /usr/include/sys/ttydev.h |
120 | rain: /usr/include/signal.h /usr/include/machine/trap.h | |
2154d805 KM |
121 | worm: worm.c /usr/include/ctype.h /usr/include/curses.h /usr/include/stdio.h |
122 | worm: /usr/include/sgtty.h /usr/include/sys/ioctl.h /usr/include/sys/ttychars.h | |
4769cfe7 KB |
123 | worm: /usr/include/sys/ttydefaults.h /usr/include/sys/ttydev.h |
124 | worm: /usr/include/signal.h /usr/include/machine/trap.h | |
85e3e21d KB |
125 | worms: worms.c /usr/include/sys/types.h /usr/include/stdio.h |
126 | worms: /usr/include/sgtty.h /usr/include/sys/ioctl.h | |
4769cfe7 KB |
127 | worms: /usr/include/sys/ttychars.h /usr/include/sys/ttydefaults.h |
128 | worms: /usr/include/sys/ttydev.h /usr/include/signal.h | |
129 | worms: /usr/include/machine/trap.h | |
25702fae | 130 | wump: wump.c /usr/include/stdio.h /usr/include/sgtty.h /usr/include/sys/ioctl.h |
4769cfe7 KB |
131 | wump: /usr/include/sys/ttychars.h /usr/include/sys/ttydefaults.h |
132 | wump: /usr/include/sys/ttydev.h | |
25702fae KB |
133 | |
134 | # IF YOU PUT ANYTHING HERE IT WILL GO AWAY |