xref: /original-bsd/games/phantasia/Makefile (revision f25de740)
1# Makefile for Phantasia 3.3.2
2#
3# To create game:
4#
5# 1)  Set up a directory where the game and its support files will live.
6#        (It is suggested that the source be kept somewhere else.)
7#
8# 2)  Set up the variables in Makefile CAREFULLY to reflect your
9#        particular situation.
10#
11# 3)  Check out ok_to_play() at the end of main.c if you want to include
12#        code to restrict access at certain times.
13#
14# 4)  'make install' and sit back and watch.
15#
16# NOTE:  'setup' MUST be executed before trying to run 'phantasia'.
17#	 The install procedure does this for you.
18#
19#
20# To convert from 3.3.1 or 3.3.1+ to 3.3.2:
21#
22# 1)	'make convert'  (3.3.1+: 'make PLUS=-DPHANTPLUS convert')
23#
24# 2)	Move 'newcharacs' to 'characs'.
25#
26
27RM =		-rm
28SHAR =		/d2/estes/bin/shar
29# Tell 'make' to use /bin/sh for all commands.
30SHELL =		/bin/sh
31
32# PLOTDEVICE is used for plotting the map.
33# Change as appropriate.
34PLOTDEVICE =	> /dev/tty
35
36# Add '-ljobs' to LDFLAGS if 4.1bsd; add -ltermlib if not SVR2.
37# Need separate i/d space on small machines.
38# May need '-f' on machines without floating point hardware.
39LIBS= -lm -lcurses -ltermlib
40
41# DEST is where the program and its support files reside
42DEST =		/usr/games/lib/phantasia
43DESTR =		/usr/games
44
45MDIR=	/usr/man/cat6
46
47.SUFFIXES: .6 .0
48
49
50# The following are program constants which are implementation dependent.
51#
52# DEST is passed on.  Note that there is no closing quote here.
53# WIZARD is the login of the one who will clean up things.
54# UID is the uid of game wizard.
55# define OK_TO_PLAY to restrict playing access at certain times.
56#	Also see function ok_to_play() in main.c, and tailor to your own needs.
57# define ENEMY to include code for checking of a 'hit list' of resricted
58#	accounts.  The list of logins goes in the file 'enemy'.
59# SHELL is the default shell for shell escapes.  If SHELL is not defined,
60#	shell escapes are not enabled.
61# define BSD41 for 4.1bsd
62# define BSD42 for 4.2bsd
63# define SYS3 for System III, or similar (like Version 7)
64# define SYS5 for System V
65# If you don't have 'strchr()', put '-Dstrchr=index' below.
66# May need '-I/usr/include/sys' for 4.2bsd.
67CFLAGS = 	-O \
68		-DDEST=\"${DEST} \
69		-DDESTR=\"${DESTR} \
70		-DWIZARD=\"root\" \
71		-DUID=0 \
72		-DENEMY \
73		-DBSD42
74
75SRCS=	main.c fight.c io.c interplayer.c gamesupport.c misc.c phantglobs.c
76OBJS=	main.o fight.o io.o interplayer.o gamesupport.o misc.o phantglobs.o
77HFILES =	phantdefs.h phantstruct.h macros.h include.h
78LIBC=	/lib/libc.a
79
80all:		phantasia setup phantasia.0
81
82# Make the game.
83phantasia:	${OBJS} ${LIBC}
84		${CC} ${OBJS} -o $@ ${LIBS}
85
86${OBJS}:	${HFILES}
87
88# Make the initialization program.
89setup:		phantglobs.o setup.o monsters.asc ${LIBC}
90		${CC} phantglobs.o setup.o -o $@ ${LIBS}
91
92setup.o: ${HFILES}
93
94# Make documentation.
95# The flags below on tbl and nroff are to make a line printable version.
96.6.0:
97	tbl -TX phantasia.6 | /usr/man/manroff > phantasia.0
98
99# Install game and documentation.  Initialize.
100install: FRC
101	-[ -d ${DESTDIR}/usr/games/lib/phantasia ] || mkdir ${DESTDIR}/usr/games/lib/phantasia
102	chmod 700 /usr/games/lib/phantasia
103	chown games.bin /usr/games/lib/phantasia
104	install -s -o games -g bin -m 4700 phantasia ${DESTDIR}/usr/games/hide
105	(cd ${DESTDIR}/usr/games; rm -f phantasia; ln -s dm phantasia; chown games.bin phantasia)
106	install -c -o games -g bin -m 400 phantasia.0 ${DESTDIR}/usr/games/lib/phantasia/phant.help
107	install -c -o bin -g bin -m 444 phantasia.0 ${DESTDIR}${MDIR}
108	./setup
109	chown games.bin /usr/games/lib/phantasia/*
110
111# Make Phantasia map.
112# Change the map commands reflect your installation.
113# Pre-System III installations may use 'plot' instead of 'tplot'.
114map:		map.c
115		cc -O map.c -lplot -o map
116		map | tplot -t4014 ${PLOTDEVICE}
117
118# Convert old character file to new format.
119# 'convert' is meant to be run only once.
120# PLUS = PHANTPLUS for conversion from 3.3.1+.
121convert:	convert.c oldplayer.h phantstruct.h
122		${CC} ${CFLAGS} ${PLUS} convert.c ${LDFLAGS} -o convert
123		convert
124		@echo "New data is in newcharacs."
125
126# Clean up directory after installation.
127clean:
128		${RM} -f *.o core phantasia phant.help phantasia.0 setup
129
130depend: FRC
131	mkdep ${CFLAGS} ${SRCS}
132
133lint: FRC
134	lint ${CFLAGS} ${SRCS}
135
136tags: FRC
137	ctags ${SRCS}
138
139FRC:
140
141# DO NOT DELETE THIS LINE -- mkdep uses it.
142# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.
143
144main.o: main.c include.h /usr/include/ctype.h /usr/include/curses.h
145main.o: /usr/include/stdio.h /usr/include/sgtty.h /usr/include/sys/ioctl.h
146main.o: /usr/include/sys/ttychars.h /usr/include/sys/ttydefaults.h
147main.o: /usr/include/sys/ttydev.h /usr/include/math.h /usr/include/pwd.h
148main.o: /usr/include/setjmp.h /usr/include/signal.h /usr/include/machine/trap.h
149main.o: /usr/include/time.h macros.h phantdefs.h phantstruct.h phantglobs.h
150fight.o: fight.c include.h /usr/include/ctype.h /usr/include/curses.h
151fight.o: /usr/include/stdio.h /usr/include/sgtty.h /usr/include/sys/ioctl.h
152fight.o: /usr/include/sys/ttychars.h /usr/include/sys/ttydefaults.h
153fight.o: /usr/include/sys/ttydev.h /usr/include/math.h /usr/include/pwd.h
154fight.o: /usr/include/setjmp.h /usr/include/signal.h
155fight.o: /usr/include/machine/trap.h /usr/include/time.h macros.h phantdefs.h
156fight.o: phantstruct.h phantglobs.h
157io.o: io.c include.h /usr/include/ctype.h /usr/include/curses.h
158io.o: /usr/include/stdio.h /usr/include/sgtty.h /usr/include/sys/ioctl.h
159io.o: /usr/include/sys/ttychars.h /usr/include/sys/ttydefaults.h
160io.o: /usr/include/sys/ttydev.h /usr/include/math.h /usr/include/pwd.h
161io.o: /usr/include/setjmp.h /usr/include/signal.h /usr/include/machine/trap.h
162io.o: /usr/include/time.h macros.h phantdefs.h phantstruct.h phantglobs.h
163interplayer.o: interplayer.c include.h /usr/include/ctype.h
164interplayer.o: /usr/include/curses.h /usr/include/stdio.h /usr/include/sgtty.h
165interplayer.o: /usr/include/sys/ioctl.h /usr/include/sys/ttychars.h
166interplayer.o: /usr/include/sys/ttydefaults.h /usr/include/sys/ttydev.h
167interplayer.o: /usr/include/math.h /usr/include/pwd.h /usr/include/setjmp.h
168interplayer.o: /usr/include/signal.h /usr/include/machine/trap.h
169interplayer.o: /usr/include/time.h macros.h phantdefs.h phantstruct.h
170interplayer.o: phantglobs.h
171gamesupport.o: gamesupport.c include.h /usr/include/ctype.h
172gamesupport.o: /usr/include/curses.h /usr/include/stdio.h /usr/include/sgtty.h
173gamesupport.o: /usr/include/sys/ioctl.h /usr/include/sys/ttychars.h
174gamesupport.o: /usr/include/sys/ttydefaults.h /usr/include/sys/ttydev.h
175gamesupport.o: /usr/include/math.h /usr/include/pwd.h /usr/include/setjmp.h
176gamesupport.o: /usr/include/signal.h /usr/include/machine/trap.h
177gamesupport.o: /usr/include/time.h macros.h phantdefs.h phantstruct.h
178gamesupport.o: phantglobs.h
179misc.o: misc.c include.h /usr/include/ctype.h /usr/include/curses.h
180misc.o: /usr/include/stdio.h /usr/include/sgtty.h /usr/include/sys/ioctl.h
181misc.o: /usr/include/sys/ttychars.h /usr/include/sys/ttydefaults.h
182misc.o: /usr/include/sys/ttydev.h /usr/include/math.h /usr/include/pwd.h
183misc.o: /usr/include/setjmp.h /usr/include/signal.h /usr/include/machine/trap.h
184misc.o: /usr/include/time.h macros.h phantdefs.h phantstruct.h phantglobs.h
185phantglobs.o: phantglobs.c include.h /usr/include/ctype.h /usr/include/curses.h
186phantglobs.o: /usr/include/stdio.h /usr/include/sgtty.h
187phantglobs.o: /usr/include/sys/ioctl.h /usr/include/sys/ttychars.h
188phantglobs.o: /usr/include/sys/ttydefaults.h /usr/include/sys/ttydev.h
189phantglobs.o: /usr/include/math.h /usr/include/pwd.h /usr/include/setjmp.h
190phantglobs.o: /usr/include/signal.h /usr/include/machine/trap.h
191phantglobs.o: /usr/include/time.h macros.h phantdefs.h phantstruct.h
192phantglobs.o: phantglobs.h
193
194# IF YOU PUT ANYTHING HERE IT WILL GO AWAY
195