rearranged player and screen stuff
[unix-history] / usr / src / games / Makefile
CommitLineData
bb767718 1# Makefile 4.13 83/08/02
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 \
bb767718 13 hangman mille monop quiz rogue 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
c941b20a
SL
41 for i in ${STD} ${NSTD}; do \
42 (install -s $$i ${DESTDIR}/usr/games/$$i); \
43 done
af62d475 44 install -c chess.bin ${DESTDIR}/usr/games/lib/chess
233e9bc2
KM
45 cat >${DESTDIR}/usr/games/lib/cfscores </dev/null
46 chmod 777 ${DESTDIR}/usr/games/lib/cfscores
c2f9db1e
KM
47
48clean:
49 rm -f a.out core *.s *.o
50 for i in ${SUBDIR}; do (cd $$i; make ${MFLAGS} clean); done
51 rm -f ${STD} ${NSTD}
52
53depend:
54 cat </dev/null >x.c
55 for i in ${STD} ${NSTD}; do \
56 (echo $$i: $$i.c >>makedep; \
57 /bin/grep '^#[ ]*include' x.c $$i.c | sed \
58 -e 's,<\(.*\)>,"/usr/include/\1",' \
59 -e 's/:[^"]*"\([^"]*\)".*/: \1/' \
60 -e 's/\.c//' >>makedep); done
61 echo '/^# DO NOT DELETE THIS LINE/+2,$$d' >eddep
62 echo '$$r makedep' >>eddep
63 echo 'w' >>eddep
64 cp Makefile Makefile.bak
65 ed - Makefile < eddep
66 rm eddep makedep x.c
67 echo '# DEPENDENCIES MUST END AT END OF FILE' >> Makefile
68 echo '# IF YOU PUT STUFF HERE IT WILL GO AWAY' >> Makefile
69 echo '# see make depend above' >> Makefile
70
71# Files listed in ${NSTD} have explicit make lines given below.
72
73canfield:
6c05e2fa 74 cc -o canfield ${CFLAGS} canfield.c -lcurses -ltermcap
c2f9db1e 75
6c05e2fa
SL
76primes:
77 cc -o primes ${CFLAGS} primes.c -lm
7a2e4160 78
c2f9db1e 79rain:
6c05e2fa 80 cc -o rain ${CFLAGS} rain.c -lcurses -ltermcap
c2f9db1e
KM
81
82worm:
6c05e2fa 83 cc -o worm ${CFLAGS} worm.c -lcurses -ltermcap
c2f9db1e
KM
84
85worms:
6c05e2fa 86 cc -o worms ${CFLAGS} worms.c -lcurses -ltermcap
c2f9db1e
KM
87
88# DO NOT DELETE THIS LINE -- make depend uses it
89
7a2e4160
SL
90arithmetic: arithmetic.c
91arithmetic: /usr/include/stdio.h
92arithmetic: /usr/include/signal.h
93btlgammon: btlgammon.c
94btlgammon: /usr/include/stdio.h
95banner: banner.c
96banner: /usr/include/stdio.h
97bcd: bcd.c
dc2141e4
KM
98cfscores: cfscores.c
99cfscores: /usr/include/pwd.h
c2f9db1e
KM
100chess: chess.c
101chess: /usr/include/stdio.h
102fish: fish.c
103fish: /usr/include/stdio.h
104number: number.c
c2f9db1e
KM
105wump: wump.c
106wump: /usr/include/stdio.h
107wump: /usr/include/sgtty.h
c2f9db1e
KM
108canfield: canfield.c
109canfield: /usr/include/curses.h
110canfield: /usr/include/ctype.h
111canfield: /usr/include/signal.h
dc2141e4 112canfield: /usr/include/sys/types.h
c2f9db1e
KM
113rain: rain.c
114rain: /usr/include/stdio.h
115rain: /usr/include/sgtty.h
116rain: /usr/include/signal.h
117worm: worm.c
118worm: /usr/include/ctype.h
119worm: /usr/include/curses.h
120worm: /usr/include/signal.h
121worms: worms.c
122worms: /usr/include/stdio.h
123worms: /usr/include/sgtty.h
124# DEPENDENCIES MUST END AT END OF FILE
125# IF YOU PUT STUFF HERE IT WILL GO AWAY
126# see make depend above