#
# Makefile for use with Lattice C
#
CC = sc
STARTUP=LIB:c.o
# Optimization on a standard Amiga
#DEBUG = OPTIMIZE
# Optimization on a an amiga witha 68040 or 68882
DEBUG = OPTIMIZE OPTSCHED
LINKDBG = ND
#
# Use these settings on a standard Amiga.
#
# CFLAGS = CPU=ANY NOSTKCHK MATH=IEEE DATA=AUTO STRMERGE IGNORE=100 $(DEBUG)
# MATHLIB = LIB:scmieee.lib
#
# use these settings on an Amiga with a 68040
#
CFLAGS = CPU=68040 NOSTKCHK MATH=68882 DATA=AUTO STRMERGE IGNORE=100 $(DEBUG)
MATHLIB = LIB:scm881.lib
#
# if you have getopt and qsort in a library, declare it in SUPLIB
#
SUPLIB = LIB:unix.lib
# SAS/C added a mktemp() routine in version 6.50. If you are using an older
# version, add mktemp.o here
# SUPPORT = mktemp.o
SUPPORT =
#
# else declare SUPLIB as empty, and add the appropriate .o files in SUPPORT
# (alloca.o is only needed if you use the GNU getopt)
#
# SUPLIB =
# SUPPORT = mktemp.o qsort.o getopt.o alloca.o
#
# Override certain library functions with home-made, smaller ones. Their only
# purpose is to make executables smaller, so you don't really need them. If you
# have something equivalent, declare it here. GDEF is for getami, and SDEF is
# for show3.
#
#GDEF = DEFINE ___main=___nowbmain
#SDEF = DEFINE ___main=___nowbmain
GDEF =
SDEF =
#
# ".o" files and libraries required to build getami
#
GOBJ = getami.o IsPAL.o plot.o $(SUPPORT)
GLIBS = LIB:rle.lib $(MATHLIB) $(SUPLIB) LIB:sc.lib
#
# ".o" files and libraries required to build show3.
#
SOBJ = show3.o IsPAL.o
SLIBS = $(SUPLIB) LIB:sc.lib

all: getami show3

getami: $(GOBJ)
	slink FROM $(STARTUP) $(GOBJ) TO getami SC SD NOICONS $(LINKDBG)\
	$(GDEF) LIB $(GLIBS)

show3: $(SOBJ)
	slink FROM $(STARTUP) $(SOBJ) TO show3 SC SD NOICONS $(LINKDBG)\
	$(SDEF) LIB $(SLIBS)

# A68k produces more compact code. If you want to use asm, uncomment the
# csect directive in plot.asm
plot.o: plot.asm
	asm -iinclude: -oplot.o plot.asm

clean:
	delete \#?.o getami show3 QUIET
