#
# lmkfile for CDTV kludges
#

VERSION= 40
HDRS= kludges_rev.i debug.i
MYLIBS= LIB:amiga.lib LIB:debug.lib

OBJ = obj/
REMOTE = CDGS:src/kludges
MODULE = kludges
CFILES  =
AFILES  =       kludges.asm debug.asm

LC  = lc
ASM = hx68

LFLAGS= BATCH SMALLCODE SMALLDATA

AFLAGS = -csy -i cdgs:include+include:

LCFLAGS = -cimsf -d -O -rr -v -j73 -b0

all:    kludges.ld

kludges.ld:     $(OBJ)kludges.o
        blink <with <
FROM $(OBJ)kludges.o $(OBJ)debug.o
TO kludges.ld
LIB $(MYLIBS)
$(LFLAGS)
<

.c.o:
        $(LC) $(LCFLAGS) $*.c

.asm.o:
        $(ASM) -a $*.asm $(AFLAGS) -o $(OBJ)$*.o


kludges.ld: $(OBJ)kludges.o $(OBJ)debug.o

version:
        @copy $(REMOTE)/$(MODULE)_rev.rev ""
        @bumprev $(VERSION) $(MODULE)_rev
        @copy $(MODULE)_rev.\#? $(REMOTE)

release:
        @lmk version
        @lmk
        @copy $(MODULE).ld\#? $(REMOTE)
        @execute < < 
        failat 21 ;
        cd $(REMOTE) ;
        co $(CFILES) $(AFILES);
        co $(HDRS) lmkfile ;
        <

clean:
                delete (\#?.o|\#?.pre|\#?.tmp|\#?.ld\#?)

internal:
        @delete $(REMOTE)/(\#?.c|\#?.asm|\#?.h|\#?.i|makefile|lmkfile|\#?.ld|\#?.rev) rwed
        @protect (\#?.c|\#?.asm|\#?.h|\#?.i|makefile|lmkfile|\#?.ld|\#?.rev) +r quiet
        @copy (\#?.c|\#?.asm|\#?.h|\#?.i|makefile|lmkfile|\#?.ld|\#?.rev) $(REMOTE)

#
# The following rule is to bring the source down to the local directory
# To do the following you should copy this LMKfile to the local directory
# and make sure it is readable.  Then type MAKE ToLocal to have the
# code copied down...
#
tolocal:
        @protect \#? rwed QUIET
        @copy $(REMOTE)/\#? ""
        @Echo "Local is updated..."

$(OBJ)kludges.o:        kludges.asm $(HDRS)

$(OBJ)debug.o:          debug.asm $(HDRS)


