* Optimised many of the library functions
[fw/sdcc] / support / regression / ports / z80 / spec.mk
index 78e6f699e125a97018584b2b4ee6cbb2470e31f1..133394950bd57910eca111cb5f438b195bc96497 100644 (file)
@@ -1,19 +1,22 @@
-SDCCFLAGS += -I/home/michaelh/projects/gbdk-lib/include
+# Port specification for the z80 port running ontop of the Java based
+# 'ConsoleZ80' emulator.
+
+RRZ80 = $(SDCC_EXTRA_DIR)/emu/rrz80/rrz80
+
+SDCCFLAGS += --lesspedantic --profile
 
 EXEEXT = .bin
 
-EXTRAS = fwk/lib/testfwk$(OBJEXT) ports/$(PORT)/support$(OBJEXT) \
-       /home/michaelh/projects/gbdk-lib/libc/asm/z80/mul$(OBJEXT) \
-       /home/michaelh/projects/gbdk-lib/libc/asm/z80/div$(OBJEXT)
+# Needs parts of gbdk-lib, namely the internal mul/div/mod functions.
+EXTRAS = fwk/lib/testfwk$(OBJEXT) ports/$(PORT)/support$(OBJEXT)
 
+# Rule to generate a Emulator .bin file from the .ihx linker output.
 %$(EXEEXT): %.ihx
-       ../makebin/makebin -s 32768 < $< > $@
-
-%.ihx: %$(OBJEXT) $(EXTRAS)
-       ../../bin/link-z80 -n -- -b_CODE=0x200 -b_DATA=0x8000 -i $@ $< $(EXTRAS)
+       ../makebin/makebin -s 32768 < $< > $@  # Must be 32768 due to a bug in ConsoleZ80
 
-%$(OBJEXT): %.c fwk/include/*.h
-       $(SDCC) $(SDCCFLAGS) -c $<
+# Rule to link into .ihx
+%.ihx: %.c $(EXTRAS)
+       $(SDCC) $(SDCCFLAGS) $< $(EXTRAS)
 
 %$(OBJEXT): %.asm
        ../../bin/as-z80 -plosgff $@ $<
@@ -21,19 +24,9 @@ EXTRAS = fwk/lib/testfwk$(OBJEXT) ports/$(PORT)/support$(OBJEXT) \
 %$(OBJEXT): %.s
        ../../bin/as-z80 -plosgff $@ $<
 
-$(PORT_SUBRESULTS_DIR)/%.out: $(PORT_CASES_DIR)/%$(EXEEXT)
+# PENDING: Path to sdcc-extra
+%.out: %$(EXEEXT)
        mkdir -p `dirname $@`
-       java -cp /home/michaelh/projects/rose ConsoleZ80 $< > $@
-       if grep -q FAIL $@; then echo FAILURES in $@; fi
-
-#$(PORT_SUBRESULTS_DIR)/%.out: $(PORT_CASES_DIR)/%$(EXEEXT)
-#      mkdir -p `dirname $@`
-#      -$< > $@
-#      if grep -q FAIL $@; then echo FAILURES in $@; fi
-
-
-#%$(EXEEXT): %$(OBJEXT) fwk/lib/testfwk$(OBJEXT)
-#      $(SDCC) $(SDCCFLAGS) -o $@ $< fwk/lib/testfwk$(OBJEXT)
+       $(RRZ80) --maxruntime=3 --mapfile=$(<:.bin=.sym) $< > $@
+       -grep -n FAIL $@ /dev/null || true
 
-#%$(OBJEXT): %.c fwk/include/*.h
-#      $(SDCC) $(SDCCFLAGS) -c $< -o $@