date and time created 88/06/01 18:39:39 by bostic
[unix-history] / usr / src / games / phantasia / Makefile
CommitLineData
efbedec6
KB
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.
7ce62984 39LIBS= -lm -lcurses -ltermlib
efbedec6
KB
40
41# DEST is where the program and its support files reside
42DEST = /usr/games/lib/phantasia
43DESTR = /usr/games
44
45# The following are program constants which are implementation dependent.
46#
47# DEST is passed on. Note that there is no closing quote here.
48# WIZARD is the login of the one who will clean up things.
49# UID is the uid of game wizard.
50# define OK_TO_PLAY to restrict playing access at certain times.
51# Also see function ok_to_play() in main.c, and tailor to your own needs.
52# define ENEMY to include code for checking of a 'hit list' of resricted
53# accounts. The list of logins goes in the file 'enemy'.
54# SHELL is the default shell for shell escapes. If SHELL is not defined,
55# shell escapes are not enabled.
56# define BSD41 for 4.1bsd
57# define BSD42 for 4.2bsd
58# define SYS3 for System III, or similar (like Version 7)
59# define SYS5 for System V
60# If you don't have 'strchr()', put '-Dstrchr=index' below.
61# May need '-I/usr/include/sys' for 4.2bsd.
62CFLAGS = -O \
63 -DDEST=\"${DEST} \
64 -DDESTR=\"${DESTR} \
65 -DWIZARD=\"games\" \
66 -DUID=57 \
67 -DENEMY \
68 -DSHELL=\"/bin/csh\" \
69 -DBSD42
70
7ce62984
KB
71SRCS= main.c fight.c io.c interplayer.c gamesupport.c misc.c phantglobs.c
72OBJS= main.o fight.o io.o interplayer.o gamesupport.o misc.o phantglobs.o
efbedec6 73HFILES = phantdefs.h phantstruct.h macros.h include.h
7ce62984 74LIBC= /lib/libc.a
efbedec6
KB
75
76all: phantasia setup phant.help
77
78# Make the game.
7ce62984
KB
79phantasia: ${OBJS} ${LIBC}
80 ${CC} ${OBJS} -o $@ ${LIBS}
efbedec6 81
7ce62984 82${OBJS}: ${HFILES}
efbedec6
KB
83
84# Make the initialization program.
7ce62984
KB
85setup: phantglobs.o setup.o monsters.asc ${LIBC}
86 ${CC} phantglobs.o setup.o -o $@ ${LIBS}
efbedec6 87
7ce62984 88setup.o: ${HFILES}
efbedec6
KB
89
90# Make documentation.
91# The flags below on tbl and nroff are to make a line printable version.
92phant.help: phant.nr
93 tbl -TX phant.nr | nroff -Ttn300 -man > phant.help
94
95# Install game and documentation. Initialize.
7ce62984 96install: FRC
8d7661b8 97 -[ -d ${DESTDIR}/usr/games/lib/phantasia ] || mkdir ${DESTDIR}/usr/games/lib/phantasia
7ce62984 98 chmod 700 /usr/games/lib/phantasia
8b51accb
KB
99 chown games.bin /usr/games/lib/phantasia
100 install -s -o games -g bin -m 4700 phantasia ${DESTDIR}/usr/games/hide
101 (cd ${DESTDIR}/usr/games; rm -f phantasia; ln -s dm phantasia; chown games.bin phantasia)
102 install -c -o games -g bin -m 400 phant.help ${DESTDIR}/usr/games/lib/phantasia/phant.help
7ce62984 103 ./setup
8b51accb 104 chown games.bin /usr/games/lib/phantasia/*
efbedec6
KB
105
106# Make Phantasia map.
107# Change the map commands reflect your installation.
108# Pre-System III installations may use 'plot' instead of 'tplot'.
109map: map.c
110 cc -O map.c -lplot -o map
111 map | tplot -t4014 ${PLOTDEVICE}
112
113# Convert old character file to new format.
114# 'convert' is meant to be run only once.
115# PLUS = PHANTPLUS for conversion from 3.3.1+.
116convert: convert.c oldplayer.h phantstruct.h
117 ${CC} ${CFLAGS} ${PLUS} convert.c ${LDFLAGS} -o convert
118 convert
119 @echo "New data is in newcharacs."
120
121# Clean up directory after installation.
122clean:
7ce62984
KB
123 ${RM} -f *.o core phantasia phant.help phant.pt?
124
125depend: FRC
126 mkdep ${CFLAGS} ${SRCS}
127
128lint: FRC
129 lint ${CFLAGS} ${SRCS}
130
131tags: FRC
132 ctags ${SRCS}
133
134FRC:
135
136# DO NOT DELETE THIS LINE -- mkdep uses it.
137# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.
138
139main.o: main.c include.h /usr/include/ctype.h /usr/include/curses.h
140main.o: /usr/include/stdio.h /usr/include/sgtty.h /usr/include/sys/ioctl.h
141main.o: /usr/include/sys/ttychars.h /usr/include/sys/ttydev.h
142main.o: /usr/include/math.h /usr/include/pwd.h /usr/include/setjmp.h
143main.o: /usr/include/signal.h /usr/include/time.h macros.h phantdefs.h
144main.o: phantstruct.h phantglobs.h
145fight.o: fight.c include.h /usr/include/ctype.h /usr/include/curses.h
146fight.o: /usr/include/stdio.h /usr/include/sgtty.h /usr/include/sys/ioctl.h
147fight.o: /usr/include/sys/ttychars.h /usr/include/sys/ttydev.h
148fight.o: /usr/include/math.h /usr/include/pwd.h /usr/include/setjmp.h
149fight.o: /usr/include/signal.h /usr/include/time.h macros.h phantdefs.h
150fight.o: phantstruct.h phantglobs.h
151io.o: io.c include.h /usr/include/ctype.h /usr/include/curses.h
152io.o: /usr/include/stdio.h /usr/include/sgtty.h /usr/include/sys/ioctl.h
153io.o: /usr/include/sys/ttychars.h /usr/include/sys/ttydev.h /usr/include/math.h
154io.o: /usr/include/pwd.h /usr/include/setjmp.h /usr/include/signal.h
155io.o: /usr/include/time.h macros.h phantdefs.h phantstruct.h phantglobs.h
156interplayer.o: interplayer.c include.h /usr/include/ctype.h
157interplayer.o: /usr/include/curses.h /usr/include/stdio.h /usr/include/sgtty.h
158interplayer.o: /usr/include/sys/ioctl.h /usr/include/sys/ttychars.h
159interplayer.o: /usr/include/sys/ttydev.h /usr/include/math.h /usr/include/pwd.h
160interplayer.o: /usr/include/setjmp.h /usr/include/signal.h /usr/include/time.h
161interplayer.o: macros.h phantdefs.h phantstruct.h phantglobs.h
162gamesupport.o: gamesupport.c include.h /usr/include/ctype.h
163gamesupport.o: /usr/include/curses.h /usr/include/stdio.h /usr/include/sgtty.h
164gamesupport.o: /usr/include/sys/ioctl.h /usr/include/sys/ttychars.h
165gamesupport.o: /usr/include/sys/ttydev.h /usr/include/math.h /usr/include/pwd.h
166gamesupport.o: /usr/include/setjmp.h /usr/include/signal.h /usr/include/time.h
167gamesupport.o: macros.h phantdefs.h phantstruct.h phantglobs.h
168misc.o: misc.c include.h /usr/include/ctype.h /usr/include/curses.h
169misc.o: /usr/include/stdio.h /usr/include/sgtty.h /usr/include/sys/ioctl.h
170misc.o: /usr/include/sys/ttychars.h /usr/include/sys/ttydev.h
171misc.o: /usr/include/math.h /usr/include/pwd.h /usr/include/setjmp.h
172misc.o: /usr/include/signal.h /usr/include/time.h macros.h phantdefs.h
173misc.o: phantstruct.h phantglobs.h
174phantglobs.o: phantglobs.c include.h /usr/include/ctype.h /usr/include/curses.h
175phantglobs.o: /usr/include/stdio.h /usr/include/sgtty.h
176phantglobs.o: /usr/include/sys/ioctl.h /usr/include/sys/ttychars.h
177phantglobs.o: /usr/include/sys/ttydev.h /usr/include/math.h /usr/include/pwd.h
178phantglobs.o: /usr/include/setjmp.h /usr/include/signal.h /usr/include/time.h
179phantglobs.o: macros.h phantdefs.h phantstruct.h phantglobs.h
180
181# IF YOU PUT ANYTHING HERE IT WILL GO AWAY