# works with make/pdmake from Fred Fish's disk #2
# I use the Lattice C 3.03 from a disk called "CC" and the assembler from a
# disk called "ASM". After you have modified the 3 macros at the beginning
# of the makefile you should copy the makefile to RAM: and then cd to RAM:
# This way I have the minimum disk changes with just one drive.
# It compiles and links both the Okidata ML92 printer driver and the Dump
# Workbench routines.

SOURCE	= C-work:printer	# redefine with the destination of your 
				# source directory
CCDISK	= cc:			# redefine with name of your cc disk
ASMDISK	= ASM:			# redefine with name of your asm disk

CFLAGS1	= -iRAM: -i$(CCDISK)include/ -i$(CCDISK)include/lattice/
ASMOPT	= -i RAM:+$(ASMDISK)include

CC1	= $(CCDISK)c/lc1 $(CFLAGS1) RAM:
CC2	= $(CCDISK)c/lc2 RAM:
ASM	= $(ASMDISK)c/Assem RAM:

OBJS1	= $(SOURCE)/data.o	$(SOURCE)/dospecial.o	$(SOURCE)/init.o
OBJS2	= $(SOURCE)/tag.o	$(SOURCE)/render.o
OBJS	= $(OBJS1) $(OBJS2) $(OBJS3) $(OBJS4) $(OBJS5)

doit :	clear $(SOURCE)/Okidata_ML92 $(SOURCE)/DumpWB init

init :
	assign CWD: $(SOURCE)
	assign cclib: $(CCDISK)lib
	assign ASMlib: $(ASMDISK)lib
	copy CWD:macros.i RAM:
	copy CWD:Dump.h RAM:

clear :
	assign ASMlib:
	assign cclib:
	assign CWD:

$(SOURCE)/Okidata_ML92 : $(OBJS) $(SOURCE)/printer.link
	delete RAM:macros.i
	copy $(SOURCE)/printer.link to RAM:
	$(CCDISK)c/alink WITH RAM:printer.link
	copy RAM:Okidata_ML92 DEVS:printers
	copy RAM:Okidata_ML92 CWD:
	delete RAM:Okidata_ML92 RAM:printer.link

$(SOURCE)/data.o :	$(SOURCE)/data.c
	copy $(SOURCE)/data.c RAM:
	$(CC1)data
	$(CC2)data
	copy RAM:data.o CWD:
	delete RAM:data.?

$(SOURCE)/dospecial.o :	$(SOURCE)/dospecial.c
	copy $(SOURCE)/dospecial.c RAM:
	$(CC1)dospecial
	$(CC2)dospecial
	copy RAM:dospecial.o CWD:
	delete RAM:dospecial.?

$(SOURCE)/render.o :	$(SOURCE)/render.c
	copy $(SOURCE)/render.c RAM:
	$(CC1)render
	$(CC2)render
	copy RAM:render.o CWD:
	delete RAM:render.?

$(SOURCE)/init.o : $(SOURCE)/init.asm $(SOURCE)/macros.i
	copy $(SOURCE)/init.asm RAM:
	$(ASM)init.asm -o init.o $(ASMOPT)
	copy RAM:init.o CWD:
	delete RAM:init.\#?

$(SOURCE)/tag.o : $(SOURCE)/tag.asm
	copy $(SOURCE)/tag.asm RAM:
	$(ASM)tag.asm -o tag.o $(ASMOPT)
	copy RAM:tag.o CWD:
	delete RAM:tag.\#?

$(SOURCE)/DumpWB : $(SOURCE)/DumpWB.o $(SOURCE)/DumpRPort.o
	$(CCDISK)c/alink cclib:Lstartup.obj+cwd:DumpWB.o+cwd:DumpRPort.o TO RAM:DumpWB LIBRARY cclib:lc.lib,cclib:amiga.lib
	copy RAM:DumpWB CWD:
	delete RAM:DumpWB

$(SOURCE)/DumpWB.o : $(SOURCE)/DumpWB.c Dump.h
	copy $(SOURCE)/DumpWB.c RAM:
	$(CC1)DumpWB
	$(CC2)DumpWB
	copy RAM:DumpWB.o CWD:
	delete RAM:DumpWB.?

$(SOURCE)/DumpRPort.o : $(SOURCE)/DumpRPort.c Dump.h
	copy $(SOURCE)/DumpRPort.c RAM:
	$(CC1)DumpRPort
	$(CC2)DumpRPort
	copy RAM:DumpRPort.o CWD:
	delete RAM:DumpRPort.?

