#
# This makefile was designed for use in the NSC GNX Language environment.
# It illustrates the requirements when compiling, assembling, linking the
# foreground monitor and demonstration program.  The NSC language tools
# will create COFF format files.  The NSC translation program, co2, will
# build HP format files from the COFF executable.
#

CC		= nmcc
DEBUGGER        =
CFLAGS          = $(DEBUGGER) -S -n -KC532 -KF381 -KB4
AS              = nasm
ASFLAGS         = -V -d2 -KC532 -KF381 -KM382
LD              = nmeld
LDFLAGS         = -V
HPOMF           = co2
HPOMFFLAGS      = -v -d'\demo\'   # Files intended for DOS directory \demo
 
all : demo532 fm64772

demo532 : demo532.o

fm64772 : fm64772.o

.s.o: 
	@echo
	@echo Making $* . . . 
	$(AS) $(ASFLAGS) $*.s -L > $*.lst
	$(LD) $(LDFLAGS) -d $*.ld $*.o -o $*.exe -m > $*.map
	$(HPOMF) $(HPOMFFLAGS) $*.exe

.c.o: 
	@echo
	@echo Making $* . . . 
	$(CC) $(CFLAGS) $*.c
	$(AS) $(ASFLAGS) $*.s -L > $*.lst
	$(LD) $(LDFLAGS) -d $*.ld $*.o -o $*.exe -m > $*.map
	$(HPOMF) $(HPOMFFLAGS) $*.exe
