Changed to rst based system calls
[fw/sdcc] / support / regression / ports / z80 / spec.mk
1 # Port specification for the z80 port running ontop of the Java based
2 # 'ConsoleZ80' emulator.
3
4 # PENDING: Path to gbdk-lib for stdarg
5 GBDK_LIB = ../../../gbdk-lib
6 SDCCFLAGS += -I$(GBDK_LIB)/include
7
8 EXEEXT = .bin
9
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)
14
15 # Rule to generate a Emulator .bin file from the .ihx linker output.
16 %$(EXEEXT): %.ihx
17         ../makebin/makebin -s 32768 < $< > $@  # Must be 32768 due to a bug in ConsoleZ80
18
19 # Rule to link into .ihx
20 %.ihx: %$(OBJEXT) $(EXTRAS)
21         ../../bin/link-z80 -n -- -b_CODE=0x200 -b_DATA=0x8000 -i $@ $< $(EXTRAS)
22
23 %$(OBJEXT): %.c fwk/include/*.h
24         $(SDCC) $(SDCCFLAGS) -c $<
25
26 %$(OBJEXT): %.asm
27         ../../bin/as-z80 -plosgff $@ $<
28
29 %$(OBJEXT): %.s
30         ../../bin/as-z80 -plosgff $@ $<
31
32 # PENDING: Path to sdcc-extra
33 %.out: %$(EXEEXT)
34         mkdir -p `dirname $@`
35         java -cp ../../../sdcc-extra/emu/rose ConsoleZ80 $< > $@
36         if grep -q FAIL $@; then echo FAILURES in $@; fi