#  The system on which this program is developed is an A1000 with four
#  drives and one Meg fast memory.  There is a ramdisk of 506K with two
#  directories INCLUDE and OBJS.  INCLUDE is known as INCLUDE:  and OBJS
#  as VO:.  All sources are in the root of a disk known as TrackSalve:.
#  This disk has two directories LIB and OBJS.  LIB is known as LIB:
#  All includes (.i and .h mixed) and their directory structures are copied
#  to INCLUDE:.  No sources are in ram and objects are immediately after
#  compilation copied to disk.  The A1000 has no clock, and to maintain
#  some time integrity each time there is a successful link, Sys:  is
#  written to by Date to sys:tstamp. (Why does not work:  Date <tstamp?
#  Then I could keep Sys:  write protected)
#  The compiler is Lattice 504 and this makefile is made for Lmk.
#


#--     Objects

STARTOBJS=\
 VO:startup.o\
 VO:_main.o\

COBJS=\
 VO:explain.o\
 VO:version.o\
 VO:patch.o\
 VO:switch.o\
 VO:main.o\

SYSLIBS=\
 LIB:lc.lib\
 LIB:amiga.lib\


#--     Commands and switches

#CC=            Lc
CCFLAGS=        -v -b1 -d2 -cc  -qT: -iINCLUDE: -oVO:
CHIPCODE=       -ac
CHIPDATA=       -ad
CHIPBSS=        -ab

#ASSEMBLER=     Assem
#ASMFLAGS=      -c s -i INCLUDE: -o
ASSEMBLER=      Asm
ASMFLAGS=       -d -dLatticeAsm -iINCLUDE: -o

#--     Link

RD0:ts:         $(STARTOBJS) $(COBJS) $(SYSLIBS) makefile
                -rez >NIL: -r Lc $(ASSEMBLER)
                -cp TO RD0:ts.w FROM << (T:ts.w)
FROM
$(STARTOBJS)
$(COBJS)
LIB
$(SYSLIBS)
TO RD0:ts
SC
SD
;NODEBUG
ADDSYM
<
                -Blink   BATCH  WITH RD0:ts.w
                date to sys:tstamp


#--     Asm sources


VO:startup.o:   startup.a
                -rez >NIL: -r Lc -a $(ASSEMBLER)
                $(ASSEMBLER) -dRelative $(ASMFLAGS)$@ startup.a
                -cp $@ OBJS/

VO:_main.o:     _main.a
                -rez >NIL: -r Lc -a $(ASSEMBLER)
                $(ASSEMBLER) -dRelative $(ASMFLAGS)$@ _main.a
                -cp $@ OBJS/

VO:explain.o:   explain.a
                -rez >NIL: -r Lc -a $(ASSEMBLER)
                $(ASSEMBLER) -dRelative $(ASMFLAGS)$@ explain.a
                -cp $@ OBJS/

VO:version.o:   version.a
                -rez >NIL: -r Lc -a $(ASSEMBLER)
                $(ASSEMBLER) -dRelative $(ASMFLAGS)$@ version.a
                -cp $@ OBJS/

VO:patch.o:     patch.a
                -rez >NIL: -r Lc -a $(ASSEMBLER)
                $(ASSEMBLER) $(ASMFLAGS)$@ patch.a
                -cp $@ OBJS/

VO:switch.o:    switch.a
                -rez >NIL: -r Lc -a $(ASSEMBLER)
                $(ASSEMBLER) -dRelative $(ASMFLAGS)$@ switch.a
                -cp $@ OBJS/

#--     C sources


VO:main.o:      main.c
                -rez >NIL: -r $(ASSEMBLER) -a Lc
                Lc $(CCFLAGS) $>
                -cp $@ OBJS/

