(no message)
[unix-history] / usr / src / games / Makefile
CommitLineData
a064b3d4 1# Makefile 4.11 83/07/03
c2f9db1e
KM
2#
3DESTDIR=
4CFLAGS= -O
5
6# The following sources are incomplete and cannot be compiled without
7# some work
8WORK= aard ddl mpu
9
10# Programs that live in subdirectories, and have makefiles of their own.
11#
12SUBDIR= 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
22STD= 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 27NSTD= canfield primes rain worm worms
c2f9db1e
KM
28
29all: ${SUBDIR} ${STD} ${NSTD}
30
31${SUBDIR}: /tmp
32 cd $@; make ${MFLAGS}
33
34${STD}:
35 cc ${CFLAGS} -o $@ $@.c
36
37install:
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
46clean:
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
51depend:
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
71canfield:
6c05e2fa 72 cc -o canfield ${CFLAGS} canfield.c -lcurses -ltermcap
c2f9db1e 73
6c05e2fa
SL
74primes:
75 cc -o primes ${CFLAGS} primes.c -lm
7a2e4160 76
c2f9db1e 77rain:
6c05e2fa 78 cc -o rain ${CFLAGS} rain.c -lcurses -ltermcap
c2f9db1e
KM
79
80worm:
6c05e2fa 81 cc -o worm ${CFLAGS} worm.c -lcurses -ltermcap
c2f9db1e
KM
82
83worms:
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
88arithmetic: arithmetic.c
89arithmetic: /usr/include/stdio.h
90arithmetic: /usr/include/signal.h
91btlgammon: btlgammon.c
92btlgammon: /usr/include/stdio.h
93banner: banner.c
94banner: /usr/include/stdio.h
95bcd: bcd.c
dc2141e4
KM
96cfscores: cfscores.c
97cfscores: /usr/include/pwd.h
c2f9db1e
KM
98chess: chess.c
99chess: /usr/include/stdio.h
100fish: fish.c
101fish: /usr/include/stdio.h
102number: number.c
c2f9db1e
KM
103wump: wump.c
104wump: /usr/include/stdio.h
105wump: /usr/include/sgtty.h
c2f9db1e
KM
106canfield: canfield.c
107canfield: /usr/include/curses.h
108canfield: /usr/include/ctype.h
109canfield: /usr/include/signal.h
dc2141e4 110canfield: /usr/include/sys/types.h
c2f9db1e
KM
111rain: rain.c
112rain: /usr/include/stdio.h
113rain: /usr/include/sgtty.h
114rain: /usr/include/signal.h
115worm: worm.c
116worm: /usr/include/ctype.h
117worm: /usr/include/curses.h
118worm: /usr/include/signal.h
119worms: worms.c
120worms: /usr/include/stdio.h
121worms: /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