###############################################################################
#
# lmkfile for wb2cli
#
###############################################################################

#
# Server directory for the data...
#
REMOTE = V:lib/wb2cli
MODNAME= wb2cli

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

#
# Compiler flags...
#
CFLAGS	= -b0 -v -ms -cfistqm -d0 -O

#
# Assembler flags...  NOTE how they are used below...
#
AFLAGS	= -cqsy -i include: -o

#
# Default rules...
#
.c.o:
	$(CC) $(CFLAGS) $*.c

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

#
# My headers...
#
PUBLIC_HDR =	wb2cli.h

MY_HDR	=	$(PUBLIC_HDR)

#
# My C source...
#
MY_C	=	wb2cli.c

#
# My Assebly source...
#
MY_A	=

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

#
# My library objects...
#
MY_LIB_OBJS =

#
# My library files...
#
MY_LIBS	=


ALL:	$(MY_OBJS)

#
# Depend...
#
wb2cli.o: wb2cli.c $(MY_HDR)

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

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

#
# Make the AutoDocs
#
doc:	$(MODNAME).doc

$(MODNAME).doc:	$(MY_C) $(MY_A) $(MY_HDR)
	@Echo "Making $(MODNAME).doc"
	@Join $(MY_C) $(MY_A) $(MY_HDR) as RAM:$(MODNAME).tmp.doc
	@AutoDoc >$(MODNAME).doc RAM:$(MODNAME).tmp.doc
	@Delete RAM:$(MODNAME).tmp.doc QUIET
	@Protect $(MODNAME).doc rwd

#
# Make a complete new release (This still is in testing...)
#
release:
	lmk clean
	lmk version
	lmk doc
	lmk $(LD_FILE)
	lmk $(LD_STRIP)
	lmk headers
	lmk internal

#
# 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..."
