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