BSD 4_1c_2 release
[unix-history] / usr / src / games / Makefile
CommitLineData
e804469b 1# @(#)Makefile 4.6 (Berkeley) 2/8/83
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 \
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 22STD= 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 26NSTD= canfield rain worm worms
c2f9db1e
KM
27
28all: ${SUBDIR} ${STD} ${NSTD}
29
30${SUBDIR}: /tmp
31 cd $@; make ${MFLAGS}
32
33${STD}:
34 cc ${CFLAGS} -o $@ $@.c
35
36install:
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
43clean:
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
48depend:
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
68canfield:
69 cc -o canfield canfield.c -lcurses -ltermcap
70
7a2e4160 71
c2f9db1e
KM
72rain:
73 cc -o rain rain.c -lcurses -ltermcap
74
75worm:
76 cc -o worm worm.c -lcurses -ltermcap
77
78worms:
79 cc -o worms worms.c -lcurses -ltermcap
80
81# DO NOT DELETE THIS LINE -- make depend uses it
82
7a2e4160
SL
83arithmetic: arithmetic.c
84arithmetic: /usr/include/stdio.h
85arithmetic: /usr/include/signal.h
86btlgammon: btlgammon.c
87btlgammon: /usr/include/stdio.h
88banner: banner.c
89banner: /usr/include/stdio.h
90bcd: bcd.c
91chess: chess.c
92chess: /usr/include/stdio.h
93fish: fish.c
c2f9db1e
KM
94arithmetic: arithmetic.c
95arithmetic: /usr/include/stdio.h
96arithmetic: /usr/include/signal.h
97btlgammon: btlgammon.c
98btlgammon: /usr/include/stdio.h
99banner: banner.c
100banner: /usr/include/stdio.h
101bcd: bcd.c
102chess: chess.c
103chess: /usr/include/stdio.h
104fish: fish.c
105fish: /usr/include/stdio.h
106number: number.c
c2f9db1e
KM
107wump: wump.c
108wump: /usr/include/stdio.h
109wump: /usr/include/sgtty.h
c2f9db1e
KM
110canfield: canfield.c
111canfield: /usr/include/curses.h
112canfield: /usr/include/ctype.h
113canfield: /usr/include/signal.h
c2f9db1e
KM
114rain: rain.c
115rain: /usr/include/stdio.h
116rain: /usr/include/sgtty.h
117rain: /usr/include/signal.h
118worm: worm.c
119worm: /usr/include/ctype.h
120worm: /usr/include/curses.h
121worm: /usr/include/signal.h
122worms: worms.c
123worms: /usr/include/stdio.h
124worms: /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