1 # Port specification for the z80 port running ontop of the Java based
2 # 'ConsoleZ80' emulator.
4 # PENDING: Path to gbdk-lib for stdarg
5 GBDK_LIB = ../../../gbdk-lib
6 SDCCFLAGS += -I$(GBDK_LIB)/include
10 # Needs parts of gbdk-lib, namely the internal mul/div/mod functions.
11 EXTRAS = fwk/lib/testfwk$(OBJEXT) ports/$(PORT)/support$(OBJEXT) \
12 $(GBDK_LIB)/libc/asm/z80/mul$(OBJEXT) \
13 $(GBDK_LIB)/libc/asm/z80/div$(OBJEXT)
15 # Rule to generate a Emulator .bin file from the .ihx linker output.
17 ../makebin/makebin -s 32768 < $< > $@ # Must be 32768 due to a bug in ConsoleZ80
19 # Rule to link into .ihx
20 %.ihx: %$(OBJEXT) $(EXTRAS)
21 ../../bin/link-z80 -n -- -b_CODE=0x200 -b_DATA=0x8000 -i $@ $< $(EXTRAS)
23 %$(OBJEXT): %.c fwk/include/*.h
24 $(SDCC) $(SDCCFLAGS) -c $<
27 ../../bin/as-z80 -plosgff $@ $<
30 ../../bin/as-z80 -plosgff $@ $<
32 # PENDING: Path to sdcc-extra
35 java -cp ../../../sdcc-extra/emu/rose ConsoleZ80 $< > $@
36 if grep -q FAIL $@; then echo FAILURES in $@; fi