struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / ports / ucz80-undoc / spec.mk
blobf95964de29d25fcec0020dda456a02df37eceaa2
1 # Regression test specification for the z80 target running with uCsim
3 # path to uCsim
4 ifdef SDCC_BIN_PATH
5 UCZ80C = $(SDCC_BIN_PATH)/ucsim_z80$(EXEEXT)
7 AS_Z80C = $(SDCC_BIN_PATH)/sdasz80$(EXEEXT)
8 else
9 ifdef UCSIM_DIR
10 SZ80A = $(UCSIM_DIR)/z80.src/ucsim_z80$(EXEEXT)
11 else
12 SZ80A = $(top_builddir)/sim/ucsim/src/sims/z80.src/ucsim_z80$(EXEEXT)
13 SZ80B = $(top_builddir)/bin/ucsim_z80$(EXEEXT)
14 endif
16 EMU = $(WINE) $(shell if [ -f $(SZ80A) ]; then echo $(SZ80A); else echo $(SZ80B); fi)
18 AS = $(WINE) $(top_builddir)/bin/sdasz80$(EXEEXT)
20 ifndef CROSSCOMPILING
21 SDCCFLAGS += --nostdinc -I$(top_srcdir)
22 LINKFLAGS += --nostdlib -L$(top_builddir)/device/lib/build/z80
23 endif
24 endif
26 ifdef CROSSCOMPILING
27 SDCCFLAGS += -I$(top_srcdir)
28 endif
30 SDCCFLAGS += -mz80 --allow-undocumented-instructions --less-pedantic
31 LINKFLAGS += z80.lib
33 OBJEXT = .rel
34 BINEXT = .ihx
36 # otherwise `make` deletes testfwk.rel and `make -j` will fail
37 .PRECIOUS: $(PORT_CASES_DIR)/%$(OBJEXT)
39 # Required extras
40 EXTRAS = $(PORT_CASES_DIR)/testfwk$(OBJEXT) $(PORT_CASES_DIR)/support$(OBJEXT)
41 include $(srcdir)/fwk/lib/spec.mk
43 $(PORT_CASES_DIR)/%$(OBJEXT): $(PORTS_DIR)/$(PORT)/%.asm
44 @# TODO: sdas should place it\'s output in the current dir
45 cp $< $(PORT_CASES_DIR)
46 $(AS) -plosgff $(PORT_CASES_DIR)/$(notdir $<)
47 rm $(PORT_CASES_DIR)/$(notdir $<)
49 # run simulator with SIM_TIMEOUT seconds timeout
50 %.out: %$(BINEXT) $(CASES_DIR)/timeout
51 mkdir -p $(dir $@)
52 -$(CASES_DIR)/timeout $(SIM_TIMEOUT) $(EMU) -C $(PORTS_DIR)/$(PORT)/conf.cmd $< < $(PORTS_DIR)/$(PORT)/uCsim.cmd > $@ \
53 || echo -e --- FAIL: \"timeout, simulation killed\" in $(<:$(BINEXT)=.c)"\n"--- Summary: 1/1/1: timeout >> $@
54 $(PYTHON) $(srcdir)/get_ticks.py < $@ >> $@
55 -grep -n FAIL $@ /dev/null || true
57 _clean: