xref: /original-bsd/games/Makefile (revision 279692fa)
1#
2# Copyright (c) 1980, 1987 Regents of the University of California.
3# All rights reserved.
4#
5# Redistribution and use in source and binary forms are permitted
6# provided that the above copyright notice and this paragraph are
7# duplicated in all such forms and that any documentation,
8# advertising materials, and other materials related to such
9# distribution and use acknowledge that the software was developed
10# by the University of California, Berkeley.  The name of the
11# University may not be used to endorse or promote products derived
12# from this software without specific prior written permission.
13# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
14# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
15# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
16#
17#	@(#)Makefile	5.12 (Berkeley) 08/12/88
18#
19DESTDIR=
20CFLAGS=	-O
21LIBC=	/lib/libc.a
22
23# Programs that live in subdirectories, and have makefiles of their own.
24#
25# doctor removed until lisp works
26SUBDIR=	adventure atc backgammon battlestar boggle btlgammon canfield \
27	cribbage dm fortune gnuchess hack hangman hunt larn mille monop \
28	phantasia quiz robots rogue sail snake trek \
29	games.${MACHINE}
30
31# Shell scripts that need only be installed and are never removed.
32#
33SCRIPT=	wargames
34
35# C sources that live in the current directory
36#
37SRCS=	arithmetic.c banner.c bcd.c factor.c fish.c morse.c number.c ppt.c \
38	primes.c rain.c worm.c worms.c wump.c
39
40# C programs that live in the current directory and do not need
41# explicit make lines.
42#
43STD=	arithmetic banner bcd factor fish morse number ppt wump
44
45# C programs that live in the current directory and need explicit make lines.
46#
47NSTD=	primes rain worm worms
48
49# programs that get hidden
50HIDE=	fish wump worm
51
52# programs that don't
53NOHIDE=	arithmetic banner bcd factor morse number ppt primes rain worms
54
55# Programs that require a lisp interpreter or compiler
56LISP=	doctor
57
58all:	${SUBDIR} ${STD} ${NSTD}
59
60${SUBDIR}: FRC
61	cd $@; make ${MFLAGS}
62
63${STD}: ${LIBC}
64	${CC} ${CFLAGS} -o $@ $@.c
65
66install: FRC
67	-for i in ${SUBDIR}; do \
68		(cd $$i; make ${MFLAGS} DESTDIR=${DESTDIR} install); done
69	-for i in ${SCRIPT}; do \
70		(install -c -o games -g bin -m 755 $$i.sh ${DESTDIR}/usr/games/$$i); done
71	install -s -o games -g bin -m 700 ${HIDE} ${DESTDIR}/usr/games/hide
72	install -s -o games -g bin -m 755 ${NOHIDE} ${DESTDIR}/usr/games
73	-for i in ${HIDE}; do \
74		(cd ${DESTDIR}/usr/games; rm -f $$i; ln -s dm $$i; chown games.bin $$i) \
75	done
76
77clean: FRC
78	-for i in ${SUBDIR} games.vax games.tahoe; do \
79		(cd $$i; make ${MFLAGS} clean); \
80	done
81	rm -f ${STD} ${NSTD} a.out core *.s *.o
82
83depend: ldepend
84	for i in ${SUBDIR}; do (cd $$i; make ${MFLAGS} depend); done
85
86ldepend: FRC
87	mkdep -p ${CFLAGS} ${SRCS}
88
89FRC:
90
91# Files listed in ${NSTD} have explicit make lines given below.
92
93primes:
94	${CC} -o $@ ${CFLAGS} primes.c -lm
95
96rain:
97	${CC} -o $@ ${CFLAGS} rain.c -lcurses -ltermcap
98
99worm:
100	${CC} -o $@ ${CFLAGS} worm.c -lcurses -ltermcap
101
102worms:
103	${CC} -o $@ ${CFLAGS} worms.c -lcurses -ltermcap
104
105# DO NOT DELETE THIS LINE -- mkdep uses it.
106# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.
107
108arithmetic: arithmetic.c /usr/include/stdio.h /usr/include/signal.h
109arithmetic: /usr/include/machine/trap.h
110banner: banner.c /usr/include/stdio.h
111bcd: bcd.c
112factor: factor.c
113fish: fish.c /usr/include/stdio.h
114number: number.c /usr/include/stdio.h /usr/include/ctype.h
115ppt: ppt.c /usr/include/stdio.h
116primes: primes.c /usr/include/stdio.h /usr/include/math.h
117rain: rain.c /usr/include/sys/types.h /usr/include/stdio.h /usr/include/sgtty.h
118rain: /usr/include/sys/ioctl.h /usr/include/sys/ttychars.h
119rain: /usr/include/sys/ttydev.h /usr/include/signal.h
120rain: /usr/include/machine/trap.h
121worm: worm.c /usr/include/ctype.h /usr/include/curses.h /usr/include/stdio.h
122worm: /usr/include/sgtty.h /usr/include/sys/ioctl.h /usr/include/sys/ttychars.h
123worm: /usr/include/sys/ttydev.h /usr/include/signal.h
124worm: /usr/include/machine/trap.h
125worms: worms.c /usr/include/sys/types.h /usr/include/stdio.h
126worms: /usr/include/sgtty.h /usr/include/sys/ioctl.h
127worms: /usr/include/sys/ttychars.h /usr/include/sys/ttydev.h
128worms: /usr/include/signal.h /usr/include/machine/trap.h
129wump: wump.c /usr/include/stdio.h /usr/include/sgtty.h /usr/include/sys/ioctl.h
130wump: /usr/include/sys/ttychars.h /usr/include/sys/ttydev.h
131
132# IF YOU PUT ANYTHING HERE IT WILL GO AWAY
133