#
#	Makefile for the SAS/C v6.2 `C' compiler
#

#	To set the default number of context lines to something other than 2,
#	change the value of this line.

CONTEXT		= 2

#	To set the default right margin to something other than 0, change
#	the value of this line.

RMARGIN		= 0

#	To set the default left margin to something other than 0, change
#	the value of this line (note that game prompts are not indented, only
#	game output text).

LMARGIN		= 0

#	To set the default number of input lines to be stored in the history
#	buffer to something other than 20, change the value of this line.

HISTORY_LINES	= 20

#	There should be no need to change the following line.

DEFINES		= DEFINE=CONTEXT=$(CONTEXT) DEFINE=LMARGIN=$(LMARGIN) DEFINE=RMARGIN=$(RMARGIN) \
		  DEFINE=HISTORY_LINES=$(HISTORY_LINES) \
		  DEFINE=FNAME_LST="Story" DEFINE=FEXT_LST=".Dat",".Data" \
		  DEFINE=SAVE_EXT=".Save" DEFINE=SCRIPT_FILE="PRT:" \
		  DEFINE=NOSIGNALS DEFINE=ESC_CHAR="@"

#	Comment this line if you do not want the compiler to run the
#	optimizer phase.

#OPTIMIZE	= OPTIMIZE OPTINLOCAL OPTTIME

#	Compiler and linker flags, there should be no need to change these lines.

#CFLAGS		= STREQ STRMERGE NOSTKCHK NMINC $(OPTIMIZE) $(DEFINES) $(GST) IGNORE=161 DEBUG=LINE
CFLAGS		= STREQ STRMERGE NMINC $(OPTIMIZE) $(DEFINES) $(GST) IGNORE=161 DEBUG=LINE
LFLAGS		= SMALLCODE SMALLDATA NODEBUG

#	Global symbol table

GST		= GST=pinfo.gst GSTIMM

#	Terminal interface modules.

TERM		= amiga.o amiga_clip.o amiga_console.o amiga_data.o amiga_game.o \
		  amiga_script.o amiga_sound.o

#	Interpreter and terminal interface modules.

OBJS		= file.o funcs.o infocom.o init.o input.o interp.o jump.o \
		  object.o options.o page.o print.o property.o support.o \
		  variable.o getopt.o $(TERM)

#	The runtime libraries to link with, there should be no need to change this line.

LIBS		= LIB:sc.lib LIB:amiga.lib

#	What we are going to build.

all:		pinfo.gst pinfo

#	This is where the interpreter is built.

pinfo:		$(OBJS)
		SLINK FROM LIB:c.o $(OBJS) TO $@ LIBRARY $(LIBS) $(LFLAGS) MAP $@.map,h

#	This is where the global symbol table is built.

pinfo.gst:	amiga_precomp.c amiga_global.h patchlevel.h infocom.h amiga_data.h \
		amiga_protos.h
		SC NOOBJNAME MAKEGST=$@ amiga_precomp.c

#	File dependencies.

file.o:		file.c pinfo.gst
funcs.o:	funcs.c pinfo.gst
infocom.o:	infocom.c pinfo.gst
init.o:		init.c pinfo.gst
input.o:	input.c pinfo.gst
interp.o:	interp.c pinfo.gst
jump.o:		jump.c pinfo.gst
object.o:	object.c pinfo.gst
options.o:	options.c pinfo.gst
page.o:		page.c pinfo.gst
print.o:	print.c pinfo.gst
property.o:	property.c pinfo.gst
support.o:	support.c pinfo.gst
variable.o:	variable.c pinfo.gst

amiga.o:	amiga.c pinfo.gst
amiga_data.o:	amiga_data.c pinfo.gst
amiga_sound.o:	amiga_sound.c pinfo.gst
amiga_console.o:	amiga_console.c pinfo.gst
amiga_clip.o:	amiga_clip.c pinfo.gst
amiga_script.o:	amiga_script.c pinfo.gst
amiga_game.o:	amiga_game.c pinfo.gst
