Berkeley header; fix file name print; evaluation order was undefined
[unix-history] / usr / src / games / Makefile
... / ...
CommitLineData
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 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%
13#
14DESTDIR=
15CFLAGS= -O
16LIBC= /lib/libc.a
17
18# Programs that live in subdirectories, and have makefiles of their own.
19#
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}
25
26# Shell scripts that need only be installed and are never removed.
27#
28SCRIPT= wargames
29
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
35# C programs that live in the current directory and do not need
36# explicit make lines.
37#
38STD= arithmetic banner bcd factor fish number wump
39
40# C programs that live in the current directory and need explicit make lines.
41#
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
49
50# Programs that require a lisp interpreter or compiler
51LISP= doctor
52
53all: ${SUBDIR} ${STD} ${NSTD}
54
55${SUBDIR}: FRC
56 cd $@; make ${MFLAGS}
57
58${STD}: ${LIBC}
59 ${CC} ${CFLAGS} -o $@ $@.c
60
61install: FRC
62 -for i in ${SUBDIR}; do \
63 (cd $$i; make ${MFLAGS} DESTDIR=${DESTDIR} install); done
64 -for i in ${SCRIPT}; do \
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
79 for i in ${SUBDIR}; do (cd $$i; make ${MFLAGS} depend); done
80
81ldepend: FRC
82 mkdep -p ${CFLAGS} ${SRCS}
83
84FRC:
85
86# Files listed in ${NSTD} have explicit make lines given below.
87
88primes:
89 ${CC} -o $@ ${CFLAGS} primes.c -lm
90
91rain:
92 ${CC} -o $@ ${CFLAGS} rain.c -lcurses -ltermcap
93
94worm:
95 ${CC} -o $@ ${CFLAGS} worm.c -lcurses -ltermcap
96
97worms:
98 ${CC} -o $@ ${CFLAGS} worms.c -lcurses -ltermcap
99
100# DO NOT DELETE THIS LINE -- mkdep uses it.
101# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.
102
103arithmetic: arithmetic.c /usr/include/stdio.h /usr/include/signal.h
104arithmetic: /usr/include/machine/trap.h
105banner: banner.c /usr/include/stdio.h
106bcd: bcd.c
107factor: factor.c
108fish: fish.c /usr/include/stdio.h
109number: number.c /usr/include/stdio.h /usr/include/ctype.h
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
113rain: /usr/include/signal.h /usr/include/machine/trap.h
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
117worm: /usr/include/machine/trap.h
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
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