# this here is the makefile for CLImax using Aztec C and Aztec assembler.
# also for FixCLI, simple and fancy versions.  I use the PD Make on fish 69.

PRECOMP = -hi w:II
IPRECOMP = -hi w:INTU

# that's the aztec 5.0 version.  for 3.6 replace "-hi " with "+i".  If you
# don't want to make precompiled header files just use "PRECOMP =" and
# likewise for IPRECOMP.  II can be precompiled from libraries/dosextens.h
# and Paul.h, and INTU is the contents of II plus intuition/intuitionbase.h,
# and clib/intuition_protos.h and the intuition pragmas, if you have them.
# With 3.6 INTU could contain ONLY intuition and then you could set IPRECOMP
# to be +iII +iINTU, but 5.0 refuses to accept more than one -hi option!

SDBCMD = -BS -s0f0n
# for aztec 3.6 use SDBCMD = -N

d : ram:Bugax

c : ram:CLImax


# Here's the one for debugging with SDB or DB:

ram\:Bugax : bugax.o bud.o purify.o
	ln -G -W +q -m +a -o ram:Bugax bugax.o bud.o purify.o -lc
	@protect ram:bugax +p
	@execute replesident ram:Bugax
	-@dr ram:bugax

# and here's the finished version:

ram\:CLImax : climax.o bud.o purify.o
	ln +q -m +a -o ram:CLImax climax.o bud.o purify.o -lc
	@protect ram:climax +p
	@execute replesident ram:CLImax
	-@dr ram:climax

# the +a option for ln is NECESSARY.
# Those without the Dr command can use List or just erase those lines.

purify.o : purify.a
	as purify.a

# Purify.a is based on resident.asm written by Olaf Bartel, available on Fish
# disk 396.  His version doesn't work.  Mine does.

climax.o : climax.c
	cc $(IPRECOMP) climax

bugax.o : climax.c
	cc $(SDBCMD) $(IPRECOMP) -d DEBUG -o bugax.o climax

bud.o : bud.a
	as -n bud.a


# this is a different hack that happened to be in the same directory for
# historical reasons:

f : ram:FixCLI
fw : ram:FixCLI-W

ram\:FixCLI : t:fixcli.o
	ln +q -m -o ram:FixCLI t:fixcli.o -lc
	@protect ram:fixcli +p
	-@dr -l ram:fixcli

ram\:FixCLI-W : t:fixcli-w.o
	ln +q -m -o ram:FixCLI-W t:fixcli-w.o -lc
	@protect ram:fixcli-w +p
	-@dr -l ram:fixcli-w

t\:fixcli.o : fixcli.c
	cc $(PRECOMP) -o t:fixcli.o fixcli.c

t\:fixcli-w.o : fixcli.c
	cc $(IPRECOMP) -dWINDOWPTR -o t:fixcli-w.o fixcli.c

