summaryrefslogtreecommitdiff
path: root/support/regression/ports/ucz80-resiy/spec.mk
diff options
context:
space:
mode:
authorXavier ASUS <xavi92psx@gmail.com>2019-10-18 00:31:54 +0200
committerXavier ASUS <xavi92psx@gmail.com>2019-10-18 00:31:54 +0200
commit268a53de823a6750d6256ee1fb1e7707b4b45740 (patch)
tree42c1799a9a82b2f7d9790ee9fe181d72a7274751 /support/regression/ports/ucz80-resiy/spec.mk
downloadsdcc-gas-268a53de823a6750d6256ee1fb1e7707b4b45740.tar.gz
sdcc-3.9.0 fork implementing GNU assembler syntax
This fork aims to provide better support for stm8-binutils
Diffstat (limited to 'support/regression/ports/ucz80-resiy/spec.mk')
-rw-r--r--support/regression/ports/ucz80-resiy/spec.mk76
1 files changed, 76 insertions, 0 deletions
diff --git a/support/regression/ports/ucz80-resiy/spec.mk b/support/regression/ports/ucz80-resiy/spec.mk
new file mode 100644
index 0000000..2dff1c1
--- /dev/null
+++ b/support/regression/ports/ucz80-resiy/spec.mk
@@ -0,0 +1,76 @@
+# Regression test specification for the z80 target running with uCsim
+
+# simulation timeout in seconds
+SIM_TIMEOUT = 40
+
+# path to uCsim
+ifdef SDCC_BIN_PATH
+ UCZ80C = $(SDCC_BIN_PATH)/sz80$(EXEEXT)
+
+ AS_Z80C = $(SDCC_BIN_PATH)/sdasz80$(EXEEXT)
+else
+ ifdef UCSIM_DIR
+ SZ80A = $(UCSIM_DIR)/z80.src/sz80$(EXEEXT)
+ else
+ SZ80A = $(top_builddir)/sim/ucsim/z80.src/sz80$(EXEEXT)
+ SZ80B = $(top_builddir)/bin/sz80$(EXEEXT)
+ endif
+
+ EMU = $(WINE) $(shell if [ -f $(SZ80A) ]; then echo $(SZ80A); else echo $(SZ80B); fi)
+
+ AS = $(WINE) $(top_builddir)/bin/sdasz80$(EXEEXT)
+
+ifndef CROSSCOMPILING
+ SDCCFLAGS += --nostdinc -I$(top_srcdir)
+ LINKFLAGS += --nostdlib -L$(top_builddir)/device/lib/build/z80
+endif
+endif
+
+ifdef CROSSCOMPILING
+ SDCCFLAGS += -I$(top_srcdir)
+endif
+
+SDCCFLAGS += -mz80 --less-pedantic --profile --reserve-regs-iy
+LINKFLAGS += z80.lib
+
+OBJEXT = .rel
+BINEXT = .ihx
+
+# otherwise `make` deletes testfwk.rel and `make -j` will fail
+.PRECIOUS: $(PORT_CASES_DIR)/%$(OBJEXT)
+
+# Required extras
+EXTRAS = $(PORT_CASES_DIR)/testfwk$(OBJEXT) $(PORT_CASES_DIR)/support$(OBJEXT)
+include $(srcdir)/fwk/lib/spec.mk
+
+# Rule to link into .ihx
+%.ihx: %$(OBJEXT) $(EXTRAS) $(FWKLIB) $(PORT_CASES_DIR)/fwk.lib
+ $(SDCC) $(SDCCFLAGS) $(LINKFLAGS) $(EXTRAS) $(PORT_CASES_DIR)/fwk.lib $< -o $@
+
+$(PORT_CASES_DIR)/%$(OBJEXT): $(PORTS_DIR)/$(PORT)/%.asm
+ @# TODO: sdas should place it\'s output in the current dir
+ cp $< $(PORT_CASES_DIR)
+ $(AS) -plosgff $(PORT_CASES_DIR)/$(notdir $<)
+ rm $(PORT_CASES_DIR)/$(notdir $<)
+
+%$(OBJEXT): %.c
+ $(SDCC) $(SDCCFLAGS) -c $< -o $@
+
+$(PORT_CASES_DIR)/%$(OBJEXT): $(PORTS_DIR)/$(PORT)/%.c
+ $(SDCC) $(SDCCFLAGS) -c $< -o $@
+
+$(PORT_CASES_DIR)/%$(OBJEXT): $(srcdir)/fwk/lib/%.c
+ $(SDCC) $(SDCCFLAGS) -c $< -o $@
+
+$(PORT_CASES_DIR)/fwk.lib: $(srcdir)/fwk/lib/fwk.lib
+ cat < $(srcdir)/fwk/lib/fwk.lib > $@
+
+# run simulator with SIM_TIMEOUT seconds timeout
+%.out: %$(BINEXT) $(CASES_DIR)/timeout
+ mkdir -p $(dir $@)
+ -$(CASES_DIR)/timeout $(SIM_TIMEOUT) $(EMU) $< < $(PORTS_DIR)/$(PORT)/uCsim.cmd > $@ \
+ || echo -e --- FAIL: \"timeout, simulation killed\" in $(<:$(BINEXT)=.c)"\n"--- Summary: 1/1/1: timeout >> $@
+ $(PYTHON) $(srcdir)/get_ticks.py < $@ >> $@
+ -grep -n FAIL $@ /dev/null || true
+
+_clean: