[net.sources] New Makefile for Phantasia

estes@tty3b.UUCP (09/06/84)

-------
In my ignorance, I forgot that perhaps not everyone would have 'xstr'
(or even know what it is).

The following is a new Makefile modified to run in the absence of 'xstr'.
The only penalty is a slightly bigger resultant program.

Sorry about that.

Edward (Ted) Estes
...!ihnp4!tty3b!estes

----------CUT------------CUT-----------CUT--------------CUT-------------
: This is a shar archieve.  Extract with sh, not csh.
: The rest of this file will extract:
: Makefile
echo extracting - Makefile
sed 's/^X//' > Makefile << '!EOR!'
X# Makefile for Phantasia 3.2
X#
X# MODIFIED TO COMPILE WITHOUT 'XSTR'.
X#
X# To create game:
X#
X# 1)  Set up a directory where the game and its support files will live.
X#        (It is suggested that the source be kept somewhere else.)
X# 2)  Set up the variables in Makefile to reflect your particular situation.
X# 3)  Check out ok_to_play() at the end of main.c if you want to include
X#        code to restrict access at certain times.
X# 4)  'make install' and watch it fly.
X
X#XSTR =		/t2/estes/bin/xstr
XRM =		-rm
X
X# Add '-ljobs' to LIBS if 4.1bsd
XLIBS =		-lm -lcurses -ltermlib
X# May need '-I/usr/include/sys' for 4.2bsd
XCFLAGS =	-O -I.
X
X# DEST is where the program and its support files reside
XDEST =		/t2/estes/phantsrc
X
X# The following are program constants which are implementation dependent.
X#
X# PATH is the same as $DEST.
X# WIZARD is the login of the one who will clean up things.
X# UID is the uid of game wizard.
X# RAND is one more than the largest number generated by rand().
X#	Possible values for this are:
X#		32768.0		(for 15 bit rand())
X#		65536.0		(for 16 bit rand())
X#		2147483648.0	(for 31 bit rand())
X# ACCESS is fopen() access to open a file for writing, but no
X#	clearing the file,  e.g. "a", or "r+".  (Use "r+" if you have it.)
X# define OK_TO_PLAY to restrict playing access.  Also see function ok_to_play()
X#	in main.c, and tailor to your own needs.
X# define ENEMY to include code for checking of a 'hit list' of resricted 
X#	accounts.  The list of logins goes in the file 'enemy'.
X# define BSD41 for 4.1bsd
X# define BSD42 for 4.2bsd
X# define USG3 for System III, or similar
X# define USG5 for System V
XFLAGS = 	-DPATH=\"${DEST} \
X		-DWIZARD=\"estes\" \
X		-DUID=419 \
X		-DRAND=32767.0 \
X		-DACCESS=\"r+\" \
X		-DOK_TO_PLAY \
X		-DENEMY \
X		-DUSG5
X
XOFILES =	main.o fight.o func0.o func1.o func2.o
X
Xall:		phantasia setfiles phant.help
X
X# need separate i/d space on small machines
X#phantasia:	${OFILES} strings.o
Xphantasia:	${OFILES}
X#		${CC} ${OFILES} strings.o ${LIBS} -o phantasia
X		${CC} ${OFILES} ${LIBS} -o phantasia
X
X${OFILES}:	phant.h
X#		${CC} -E ${CFLAGS} ${FLAGS} $*.c | ${XSTR} -c -
X		${CC} -c ${CFLAGS} ${FLAGS} $*.c
X#		${CC} -c ${CFLAGS} x.c
X#		mv x.o $*.o
X
X#strings.o:	${OFILES} strings
X#		${XSTR}
X#		${CC} -c xs.c
X#		mv xs.o strings.o
X
Xsetfiles:	phant.h setfiles.c
X		${CC} ${CFLAGS} ${FLAGS} setfiles.c -o setfiles -lm
X
X# the flags below on tbl and nroff are to make a line printable version
Xphant.help:	phant.nr
X		tbl -TX phant.nr | nroff -man -Ttn300 > phant.help
X
Xinstall:	all
X		cp phantasia monsters phant.help ${DEST}
X		chmod 755 ${DEST}
X		chmod 4711 ${DEST}/phantasia
X		chmod 644 ${DEST}/phant.help
X		setfiles
X
Xclean:
X#		${RM} -f *.o phantasia phant.help strings x.c xs.c
X		${RM} -f *.o phantasia phant.help
!EOR!