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