###############################################################################
#
# lmkfile for MPEG autoconfig initialization ROM
#
###############################################################################

#
# Server directory for the data...
#
VERSION= 40
REMOTE = CDGS:src/mpegroms

#
# Name of the module
#
MODNAME	= mpegrom

#
# The ".LD" file we want to produce.
#
LD_FILE	= $(MODNAME).ld
LD_STRIP= $(MODNAME).ld.strip

#
# Compiler, assembler, and linker
#
AS = hx68 -a
LN = blink

#
# Assembler flags...  NOTE how they are used below...
#
AFLAGS	= -cqsy -i V$(VERSION):include -o

#
# Default rules...
#
.asm.o:
	@Echo "$*.asm: " NOLINE
	$(AS) $*.asm $(AFLAGS) $*.o

#
# Linker flags
#
LFLAGS		= SMALLCODE SMALLDATA
LFLAGS_STRIP	= ND

#
# System libraries
#
LIBS= V$(VERSION):lib/amiga.lib

#
# My headers...
#
MY_HDR	=	autoconfig.i


#
# My Assebly source...
#
MY_A	=	autoconfig.asm


#
# My object files...
#
MY_OBJS	=	autoconfig.o


#
# My library objects...
#
MY_LIB_OBJS =

#
# My library files...
#
MY_LIBS	=


ALL:	$(LD_STRIP)

#
# Build the stripped LD file...
#
$(LD_STRIP):	$(LD_FILE)
	$(LN) FROM $(LD_FILE) TO $(LD_STRIP) $(LFLAGS_STRIP)

#
# Build the various versions
#
$(LD_FILE):	$(MY_OBJS)
	$(LN) <with <
FROM $(MY_OBJS)
TO $(LD_FILE)
LIB $(MY_LIBS) $(LIBS)
MAP $(MODNAME).map HLSXF PLAIN SWIDTH 16
$(LFLAGS)
<

#
# Depend...
#
residenttag.o: residenttag.asm $(MY_HDR) $(MODNAME)_rev.i
autoconfig.o:	autoconfig.asm		$(MY_HDR)

#
# Bump the version...
#
version:
	@bumprev $(VERSION) $(MODNAME)_rev

$(MODNAME)_rev.i:
	@bumprev $(VERSION) $(MODNAME)_rev

$(MODNAME)_rev.h:
	@bumprev $(VERSION) $(MODNAME)_rev

#
# Release just the headers
#
headers:	$(PUBLIC_HDR)
	copy $(PUBLIC_HDR) V$(VERSION):include/devices NOPRO

#
# Release the current build to the server
#
internal:
	@delete $(REMOTE)/((\#?.(c|h|asm|i|rev|doc|sfd|ld|ld.\#?))|makefile|lmkfile)
	@protect ((\#?.(c|h|asm|i|ld|rev|doc|sfd))|makefile|lmkfile) +r quiet
	@copy ((\#?.(c|h|asm|i|rev|doc|sfd|ld|ld.\#?))|makefile|lmkfile) $(REMOTE)
	@copy ROM README $(REMOTE)

#
# Blow away all files that would need to be rebuilt
#
clean:
	@delete (\#?.o|\#?.o.\#?|$(MODNAME).doc|$(MODNAME).ld\#?)

#
# Make a complete new release
#
release:
	lmk clean
	lmk version
	lmk $(LD_FILE)
	lmk $(LD_STRIP)
	lmk buildrom

#
# 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)/\#? ""
	@protect \#? +r QUIET
	@protect \#?_rev\#? rwd QUIET
	@Echo "Local is updated..."

#
# The following rule builds the MPEG ROM in T:
#
buildrom:
	assign HERE: ""
	DoBuild BUILDLIST ROM VERSION 40 REVISION 1 DIR "" AUTOREV mpegrom_rev.rev TO T:MPEG RELOC 00200000 NOCHECKSUM

#
# The following rule builds the MPEG ROM in T:
#
buildtest:
	assign HERE: ""
	DoBuild BUILDLIST ROM_test VERSION 40 REVISION 1 DIR "" AUTOREV mpegrom_rev.rev TO T:MPEG RELOC 00200000 NOCHECKSUM
