CC = nmcc 
AS = nasm 
NBURN = nburn
LD = nmeld


CFLAGS = -J1 -c -R -O  -DBOARD=CG16 -KCCG16 -KF381
ASFLAGS = -c  -DBOARD=CG16  -KCCG16 -KF381 

APRG= helper.o monio.o
CPRG= eload.o ether.o  extra.o udp.o eserv.o  date.o
HEADERS = packet.h header.h
RAM= -DRAM


.s.o :
	$(AS) $(ASFLAGS) $*.s

.c.o :
	$(CC) $(CFLAGS) $*.c

all : moncg16.hx0 moncg16.hx1

moncg16.hx0  : moncg
	$(NBURN) -i -w2 -b0 -l32 -n -x0x800000 moncg -o moncg16.hx0

moncg16.hx1 : moncg
	$(NBURN) -i -w2 -b1 -l32 -n -x0x800000 moncg -o moncg16.hx1

moncg.ram : moncg.s $(APRG) $(CPRG)
	$(AS) $(ASFLAGS) $(RAM) -o moncg.o moncg.s
	$(LD) -o moncg.ram -e reset -m moncg.o eload.o -d linkfile.ram -lc > load_mon.map

moncg : moncg.s $(APRG) $(CPRG)
	$(AS) $(ASFLAGS) -o moncg.o moncg.s
	$(LD) -o moncg -e reset -m moncg.o eload.o -d linkfile.rom -lc > moncg.map

date.o: date.c
	$(CC) -g -c -Wa,-r -KCCG16 -KF381  date.c  

.SCCS_GET:
