link together .so'ed man pages in case man src is not present (from ks@purdue)
[unix-history] / usr / src / games / Makefile
CommitLineData
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#
8DESTDIR=
9CFLAGS= -O
10
11# The following sources are incomplete and cannot be compiled without
12# some work
13WORK= aard ddl mpu
14
15# Programs that live in subdirectories, and have makefiles of their own.
16#
5bad83a0
KM
17SUBDIR= 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 22SCRIPT= 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
27STD= 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 32NSTD= canfield primes rain worm worms
c2f9db1e
KM
33
34all: ${SUBDIR} ${STD} ${NSTD}
35
36${SUBDIR}: /tmp
37 cd $@; make ${MFLAGS}
38
39${STD}:
40 cc ${CFLAGS} -o $@ $@.c
41
42install:
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
53clean:
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
58depend:
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
78canfield:
6c05e2fa 79 cc -o canfield ${CFLAGS} canfield.c -lcurses -ltermcap
c2f9db1e 80
6c05e2fa
SL
81primes:
82 cc -o primes ${CFLAGS} primes.c -lm
7a2e4160 83
c2f9db1e 84rain:
6c05e2fa 85 cc -o rain ${CFLAGS} rain.c -lcurses -ltermcap
c2f9db1e
KM
86
87worm:
6c05e2fa 88 cc -o worm ${CFLAGS} worm.c -lcurses -ltermcap
c2f9db1e
KM
89
90worms:
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
95arithmetic: arithmetic.c
96arithmetic: /usr/include/stdio.h
97arithmetic: /usr/include/signal.h
98btlgammon: btlgammon.c
99btlgammon: /usr/include/stdio.h
100banner: banner.c
101banner: /usr/include/stdio.h
102bcd: bcd.c
dc2141e4
KM
103cfscores: cfscores.c
104cfscores: /usr/include/pwd.h
c2f9db1e
KM
105chess: chess.c
106chess: /usr/include/stdio.h
107fish: fish.c
108fish: /usr/include/stdio.h
109number: number.c
c2f9db1e
KM
110wump: wump.c
111wump: /usr/include/stdio.h
112wump: /usr/include/sgtty.h
c2f9db1e
KM
113canfield: canfield.c
114canfield: /usr/include/curses.h
115canfield: /usr/include/ctype.h
116canfield: /usr/include/signal.h
dc2141e4 117canfield: /usr/include/sys/types.h
c2f9db1e
KM
118rain: rain.c
119rain: /usr/include/stdio.h
120rain: /usr/include/sgtty.h
121rain: /usr/include/signal.h
122worm: worm.c
123worm: /usr/include/ctype.h
124worm: /usr/include/curses.h
125worm: /usr/include/signal.h
126worms: worms.c
127worms: /usr/include/stdio.h
128worms: /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