Makefile revision 1.1.1.1 1 1.1.1.1 wiz #
2 1.1.1.1 wiz # Hunt
3 1.1.1.1 wiz #
4 1.1.1.1 wiz # Copyright (c) 1983-2003, Regents of the University of California.
5 1.1.1.1 wiz # All rights reserved.
6 1.1.1.1 wiz #
7 1.1.1.1 wiz # Redistribution and use in source and binary forms, with or without
8 1.1.1.1 wiz # modification, are permitted provided that the following conditions are
9 1.1.1.1 wiz # met:
10 1.1.1.1 wiz #
11 1.1.1.1 wiz # + Redistributions of source code must retain the above copyright
12 1.1.1.1 wiz # notice, this list of conditions and the following disclaimer.
13 1.1.1.1 wiz # + Redistributions in binary form must reproduce the above copyright
14 1.1.1.1 wiz # notice, this list of conditions and the following disclaimer in the
15 1.1.1.1 wiz # documentation and/or other materials provided with the distribution.
16 1.1.1.1 wiz # + Neither the name of the University of California, San Francisco nor
17 1.1.1.1 wiz # the names of its contributors may be used to endorse or promote
18 1.1.1.1 wiz # products derived from this software without specific prior written
19 1.1.1.1 wiz # permission.
20 1.1.1.1 wiz #
21 1.1.1.1 wiz # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
22 1.1.1.1 wiz # IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
23 1.1.1.1 wiz # TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
24 1.1.1.1 wiz # PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25 1.1.1.1 wiz # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26 1.1.1.1 wiz # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 1.1.1.1 wiz # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28 1.1.1.1 wiz # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29 1.1.1.1 wiz # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 1.1.1.1 wiz # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31 1.1.1.1 wiz # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 1.1.1.1 wiz #
33 1.1.1.1 wiz SHELL= /bin/sh
34 1.1.1.1 wiz HDR= hunt.h bsd.h talk_ctl.h
35 1.1.1.1 wiz DSRC1= answer.c driver.c draw.c execute.c expl.c makemaze.c
36 1.1.1.1 wiz DSRC2= shots.c terminal.c extern.c \
37 1.1.1.1 wiz faketalk.c ctl.c ctl_transact.c get_names.c
38 1.1.1.1 wiz DSRC= ${DSRC1} ${DSRC2}
39 1.1.1.1 wiz DOBJ= answer.o driver.o draw.o execute.o expl.o makemaze.o \
40 1.1.1.1 wiz shots.o terminal.o extern.o \
41 1.1.1.1 wiz faketalk.o ctl.o ctl_transact.o get_names.o
42 1.1.1.1 wiz PSRC= hunt.c connect.c playit.c pathname.c otto.c
43 1.1.1.1 wiz POBJ= hunt.o connect.o playit.o otto.o
44 1.1 mrg
45 1.1.1.1 wiz #
46 1.1.1.1 wiz # Installation destinations
47 1.1.1.1 wiz BINDIR= /usr/games
48 1.1.1.1 wiz LIBDIR= /usr/games/lib
49 1.1.1.1 wiz MANDIR= /usr/man/man6
50 1.1 mrg
51 1.1.1.1 wiz #
52 1.1.1.1 wiz # Game parameter flags are:
53 1.1.1.1 wiz # RANDOM Include doors which disperse shots randomly
54 1.1.1.1 wiz # REFLECT Include diagonal walls that reflect shots
55 1.1.1.1 wiz # MONITOR Include code for watching the game from the sidelines
56 1.1.1.1 wiz # OOZE Include slime shots
57 1.1.1.1 wiz # FLY Make people fly when walls regenerate under them
58 1.1.1.1 wiz # VOLCANO Include occasional large slime explosions
59 1.1.1.1 wiz # DRONE Include occasional drone shots
60 1.1.1.1 wiz # BOOTS Include boots (which makes you immune to slime)
61 1.1.1.1 wiz # OTTO Reserved for CGL automatic player
62 1.1.1.1 wiz #
63 1.1.1.1 wiz GAME_PARAM= -DRANDOM -DREFLECT -DMONITOR -DOOZE -DFLY -DVOLCANO -DBOOTS \
64 1.1.1.1 wiz -DOTTO
65 1.1.1.1 wiz
66 1.1.1.1 wiz #
67 1.1.1.1 wiz # System parameter flags are:
68 1.1.1.1 wiz # DEBUG Don't trust everything in the code
69 1.1.1.1 wiz # INTERNET Use the Internet domain IPC instead of UNIX domain
70 1.1.1.1 wiz # LOG Use syslog error-logging in driver (needs SYSLOG_42 or
71 1.1.1.1 wiz # or SYSLOG_43)
72 1.1.1.1 wiz # OLDIPC Use 4.1a internet system calls (must also define
73 1.1.1.1 wiz # INTERNET)
74 1.1.1.1 wiz # TERMINFO Use terminfo instead of termcap
75 1.1.1.1 wiz # SYSLOG_42 Use 4.2 BSD syslog(3)
76 1.1.1.1 wiz # SYSLOG_43 Use 4.2 BSD syslog(3)
77 1.1.1.1 wiz # LOG Use syslog(3) for logging errors
78 1.1.1.1 wiz # BSD_RELEASE Which version of BSD distribution
79 1.1.1.1 wiz # 42 is 4.2BSD (implies SYSLOG_42)
80 1.1.1.1 wiz # 43 is 4.3BSD (implies BROADCAST, SYSLOG_43)
81 1.1.1.1 wiz # USE_CURSES Use curses for everything (automatic w/TERMINFO)
82 1.1.1.1 wiz # SIGNAL_TYPE void or int
83 1.1.1.1 wiz # HPUX do special HPUX only hacks
84 1.1.1.1 wiz #
85 1.1.1.1 wiz # NOTE: if you change the domain (INTERNET vs UNIX) then "make newdomain"
86 1.1.1.1 wiz #
87 1.1.1.1 wiz DEFS_BSD43= -DINTERNET -DLOG -DBSD_RELEASE=43 -DSIGNAL_TYPE=int
88 1.1.1.1 wiz DEFS_BSD44= -DINTERNET -DLOG -DBSD_RELEASE=44 -DSIGNAL_TYPE=void
89 1.1.1.1 wiz DEFS_SUN= -DINTERNET -DLOG -DBSD_RELEASE=42 -DBROADCAST -DSIGNAL_TYPE=int
90 1.1.1.1 wiz DEFS_SUN4_0= -DINTERNET -DLOG -DSYSLOG_43 -DBROADCAST -DSIGNAL_TYPE=void
91 1.1.1.1 wiz DEFS_ULTRIX= -DINTERNET -DLOG -DBSD_RELEASE=42 -DSIGNAL_TYPE=void
92 1.1.1.1 wiz DEFS_HPUX= -DHPUX -DINTERNET -DLOG -DSYSLOG_43 -DBROADCAST -DTERMINFO -DSIGNAL_TYPE=void
93 1.1.1.1 wiz DEFS_SGI= -DINTERNET -DLOG -DBSD_RELEASE=43 -DTERMINFO -DSIGNAL_TYPE=void
94 1.1.1.1 wiz DEFS_NEXT= $(DEFS_BSD43) -bsd -Dconst= -DSIGNAL_TYPE=int
95 1.1.1.1 wiz DEFS_OSF1= -DINTERNET -DLOG -DBSD_RELEASE=43 -DSIGNAL_TYPE=void -D_BSD
96 1.1.1.1 wiz
97 1.1.1.1 wiz #
98 1.1.1.1 wiz # The following flags are used for system specific compilation arguments.
99 1.1.1.1 wiz # Change them to include the appropriate arguments. For example, on SGI
100 1.1.1.1 wiz # machines, they should look like
101 1.1.1.1 wiz # SYSCFLAGS= -I/usr/include/bsd
102 1.1.1.1 wiz # SYSLIBS= -lbsd
103 1.1.1.1 wiz #
104 1.1.1.1 wiz SYSCFLAGS=
105 1.1.1.1 wiz SYSLIBS=
106 1.1.1.1 wiz
107 1.1.1.1 wiz #
108 1.1.1.1 wiz # Generic definitions
109 1.1.1.1 wiz #
110 1.1.1.1 wiz DEFS= $(GAME_PARAM) $(DEFS_BSD44)
111 1.1.1.1 wiz CFLAGS= -O2 $(SYSCFLAGS) $(DEFS)
112 1.1.1.1 wiz
113 1.1.1.1 wiz #
114 1.1.1.1 wiz # Normal targets
115 1.1.1.1 wiz #
116 1.1.1.1 wiz all: hunt huntd
117 1.1.1.1 wiz
118 1.1.1.1 wiz hunt: $(POBJ) pathname.o
119 1.1.1.1 wiz $(CC) -o hunt $(POBJ) pathname.o -lcurses -ltermcap $(SYSLIBS)
120 1.1.1.1 wiz
121 1.1.1.1 wiz huntd: $(DOBJ) pathname.o
122 1.1.1.1 wiz $(CC) -o huntd $(DOBJ) pathname.o $(SYSLIBS)
123 1.1.1.1 wiz
124 1.1.1.1 wiz debug: hunt.dbg huntd.dbg
125 1.1.1.1 wiz
126 1.1.1.1 wiz hunt.dbg: $(POBJ) pathname.dbg.o
127 1.1.1.1 wiz $(CC) -o hunt.dbg $(POBJ) pathname.dbg.o -lcurses -ltermcap $(SYSLIBS)
128 1.1.1.1 wiz
129 1.1.1.1 wiz huntd.dbg: $(DOBJ) pathname.dbg.o
130 1.1.1.1 wiz $(CC) -o huntd.dbg $(DOBJ) pathname.dbg.o $(SYSLIBS)
131 1.1.1.1 wiz
132 1.1.1.1 wiz #
133 1.1.1.1 wiz # Source distribution in three files to a particular person
134 1.1.1.1 wiz #
135 1.1.1.1 wiz mail.msg:
136 1.1.1.1 wiz -@if test x${MAIL} = x ; then\
137 1.1.1.1 wiz /bin/echo MAIL not set ;\
138 1.1.1.1 wiz fi
139 1.1.1.1 wiz mail.quit:
140 1.1.1.1 wiz @test x$mail != x
141 1.1.1.1 wiz mail: mail.msg mail.quit
142 1.1.1.1 wiz shar -a README hunt.6 huntd.6 Makefile ${HDR} ${PSRC} |\
143 1.1.1.1 wiz Mail -s "Hunt (part 1 of 3)" ${MAIL}
144 1.1.1.1 wiz shar -a ${DSRC1} | Mail -s "Hunt (part 2 of 3)" ${MAIL}
145 1.1.1.1 wiz shar -a ${DSRC2} | Mail -s "Hunt (part 3 of 3)" ${MAIL}
146 1.1.1.1 wiz
147 1.1.1.1 wiz mail.part2: mail.msg mail.quit
148 1.1.1.1 wiz shar -a ${DSRC1} | Mail -s "Hunt (part 2 of 3)" ${MAIL}
149 1.1.1.1 wiz
150 1.1.1.1 wiz #
151 1.1.1.1 wiz # Single file source distribution
152 1.1.1.1 wiz #
153 1.1.1.1 wiz shar:
154 1.1.1.1 wiz shar README hunt.6 huntd.6 Makefile ${HDR} ${PSRC} ${DSRC1} \
155 1.1.1.1 wiz ${DSRC2} | compress -c > hunt.shar.Z
156 1.1.1.1 wiz
157 1.1.1.1 wiz #
158 1.1.1.1 wiz # System installation
159 1.1.1.1 wiz #
160 1.1.1.1 wiz install: all
161 1.1.1.1 wiz -cmp -s huntd ${LIBDIR}/huntd || install -c huntd ${LIBDIR}/huntd
162 1.1.1.1 wiz -cmp -s hunt ${BINDIR}/hunt || install -c hunt ${BINDIR}/hunt
163 1.1.1.1 wiz -cmp -s hunt.6 ${MANDIR}/hunt.6 \
164 1.1.1.1 wiz || install -m 444 -c hunt.6 ${MANDIR}/hunt.6
165 1.1.1.1 wiz -cmp -s huntd.6 ${MANDIR}/huntd.6 \
166 1.1.1.1 wiz || install -m 444 -c huntd.6 ${MANDIR}/huntd.6
167 1.1.1.1 wiz
168 1.1.1.1 wiz #
169 1.1.1.1 wiz # Object file dependencies
170 1.1.1.1 wiz #
171 1.1.1.1 wiz $(POBJ): $(HDR)
172 1.1.1.1 wiz
173 1.1.1.1 wiz $(DOBJ): $(HDR)
174 1.1.1.1 wiz $(CC) $(CFLAGS) -c $*.c
175 1.1.1.1 wiz
176 1.1.1.1 wiz pathname.o: pathname.c Makefile
177 1.1.1.1 wiz $(CC) $(CFLAGS) -DHUNTD=\"${LIBDIR}/huntd\" -c pathname.c
178 1.1.1.1 wiz
179 1.1.1.1 wiz pathname.dbg.o: pathname.c
180 1.1.1.1 wiz @echo $(CC) $(CFLAGS) -DDEBUG -c pathname.c -o pathname.dbg.o
181 1.1.1.1 wiz @rm -f x.c
182 1.1.1.1 wiz @ln pathname.c x.c
183 1.1.1.1 wiz @$(CC) $(CFLAGS) -DDEBUG -c x.c
184 1.1.1.1 wiz @mv x.o pathname.dbg.o
185 1.1.1.1 wiz @rm -f x.c
186 1.1.1.1 wiz
187 1.1.1.1 wiz #
188 1.1.1.1 wiz # Miscellaneous functions
189 1.1.1.1 wiz #
190 1.1.1.1 wiz lint: driver.lint hunt.lint
191 1.1.1.1 wiz
192 1.1.1.1 wiz driver.lint: $(DSRC)
193 1.1.1.1 wiz lint $(DEFS) $(DSRC) 2>&1 > driver.lint
194 1.1.1.1 wiz
195 1.1.1.1 wiz hunt.lint: $(PSRC)
196 1.1.1.1 wiz lint $(DEFS) $(PSRC) -lcurses 2>&1 > hunt.lint
197 1.1.1.1 wiz
198 1.1.1.1 wiz tags: $(DSRC) $(PSRC)
199 1.1.1.1 wiz ctags $(DSRC) $(PSRC)
200 1.1.1.1 wiz
201 1.1.1.1 wiz clean:
202 1.1.1.1 wiz rm -f $(POBJ) $(DOBJ) pathname.o pathname.dbg.o errs hunt.dbg \
203 1.1.1.1 wiz huntd.dbg hunt huntd hunt.lint driver.lint hunt.shar.Z
204 1.1.1.1 wiz
205 1.1.1.1 wiz newdomain:
206 1.1.1.1 wiz rm hunt.o extern.o driver.o
207