#
AS  =	nasm
LD  =	nmeld
CC  =	nmcc
BURN = nburn


DEMO =

APRG= helper.o monio.o
CPRG= eload.o ether.o extra.o udp.o eserv.o date.o
HEADERS = packet.h header.h
    
#CFLAGS = -J1 -c -R -O -KCGX32 -KF381 -Dmonlx32
#ASFLAGS = -c -KCGX32 -KF381 -DBURN $(DEMO) -Dmonlx32

CFLAGS = -J1 -c -R -O -Dmonlx32 -DETHER -KCGX32 -KF381
ASFLAGS = -c -KCGX32 -KF381 -DBURN $(DEMO) -Dmonlx32 -DETHER

mongx32e.hex: mongx32e
	$(BURN) -w1 -b0 -x0x10000000 -l64 -i -n -o mongx32e.hex mongx32e

mongx32e: mongx32e.o pwron.o burst.o $(APRG) $(CPRG)
	$(LD) -o mongx32e -m mongx32e.o pwron.o burst.o eload.o -d linkfile.rom -lc > mongx32e.map

mongx32e.ram :mongxcor.s def.s $(APRG) $(CPRG)
	$(AS) $(ASFLAGS) -DRAM mongxcor.s -o mongx32e.o
	$(LD) -o mongx32e.ram -m mongx32e.o eload.o -d linkfile.ram -lc > mongx32e.map
	rm -f mongx32e.o

mongx32e.o: mongxcor.s def.s
	$(AS) $(ASFLAGS) mongxcor.s -o mongx32e.o

pwron.o: pwron.s def.s
	$(AS) $(ASFLAGS) pwron.s

burst.o: burst.c 
	$(CC) -J1 -c -R -Of -Dmonlx32 -DETHER -KCGX32 -KF381 -Wa,-r -Wa,-n burst.c

date.o: date.c
	$(CC) $(CFLAGS) -Wa,-r -Wa,-n date.c

burn :
	$(BURN) -w1 -b0 -x0x10000000 -l64 mongx32e

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

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

.SCCS_GET:
