X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=support%2Fregression%2Fports%2Fucz80%2Fspec.mk;h=2189e2f740997d326694aa732948d93e7c07f3c2;hb=af7c1699ad0b8c76cbad35b919125cf02df012eb;hp=3543fb1462066ee0cbeb6ef4f7c068dd49e89904;hpb=7acf410d97f954d4aa6f2a728e2faa39b555ba13;p=fw%2Fsdcc diff --git a/support/regression/ports/ucz80/spec.mk b/support/regression/ports/ucz80/spec.mk index 3543fb14..2189e2f7 100644 --- a/support/regression/ports/ucz80/spec.mk +++ b/support/regression/ports/ucz80/spec.mk @@ -1,40 +1,57 @@ -# Port specification for the xxxx port running with uCsim +# Regression test specification for the z80 target running with uCsim # # path to uCsim -UCZ80 = $(SDCC_DIR)/bin/sz80 -#UCZ80 = $(SDCC_DIR)/bin/s51 +ifdef SDCC_BIN_PATH + UCZ80 = $(SDCC_BIN_PATH)/sz80 -SDCCFLAGS +=-mz80 --lesspedantic --profile -DREENTRANT= -#SDCCFLAGS +=--lesspedantic -DREENTRANT=reentrant --stack-after-data + AS_Z80 = $(SDCC_BIN_PATH)/as-z80 +else + SZ80A = $(top_builddir)/sim/ucsim/z80.src/sz80 + SZ80B = $(top_builddir)/bin/sz80 + + UCZ80 = $(shell if [ -f $(SZ80A) ]; then echo $(SZ80A); else echo $(SZ80B); fi) + + AS_Z80 = $(top_builddir)/bin/as-z80 + + SDCCFLAGS += --nostdinc -I$(top_srcdir) + LINKFLAGS += --nostdlib -L$(top_builddir)/device/lib/build/z80 +endif + +SDCCFLAGS +=-mz80 --less-pedantic --profile -DREENTRANT= +#SDCCFLAGS +=--less-pedantic -DREENTRANT=reentrant +LINKFLAGS += z80.lib #OBJEXT = .o EXEEXT = .ihx -EXTRAS = fwk/lib/testfwk$(OBJEXT) $(PORTS_DIR)/$(PORT)/support$(OBJEXT) +EXTRAS = $(PORT_CASES_DIR)/testfwk$(OBJEXT) $(PORT_CASES_DIR)/support$(OBJEXT) # Rule to link into .ihx -#%$(EXEEXT): %$(OBJEXT) $(EXTRAS) - -%$(EXEEXT): %.c $(EXTRAS) - $(SDCC) $(SDCCFLAGS) $< $(EXTRAS) -o $@ +%.ihx: %.c $(EXTRAS) + $(SDCC) $(SDCCFLAGS) $(LINKFLAGS) $(EXTRAS) $< -o $@ -%$(OBJEXT): %.asm - $(SDCC_DIR)/bin/as-z80 -plosgff $@ $< +$(PORT_CASES_DIR)/%$(OBJEXT): $(PORTS_DIR)/$(PORT)/%.asm + $(AS_Z80) -plosgff $@ $< %$(OBJEXT): %.c $(SDCC) $(SDCCFLAGS) -c $< -o $@ +$(PORT_CASES_DIR)/%$(OBJEXT): $(PORTS_DIR)/$(PORT)/%.c + $(SDCC) $(SDCCFLAGS) -c $< -o $@ + +$(PORT_CASES_DIR)/%$(OBJEXT): fwk/lib/%.c + $(SDCC) $(SDCCFLAGS) -c $< -o $@ + # run simulator with 10 seconds timeout -%.out: %$(EXEEXT) fwk/lib/timeout - mkdir -p `dirname $@` - -fwk/lib/timeout 10 $(UCZ80) -t32 $< < $(PORTS_DIR)/$(PORT)/uCsim.cmd > $@ \ +%.out: %$(EXEEXT) $(CASES_DIR)/timeout + mkdir -p $(dir $@) + -$(CASES_DIR)/timeout 10 $(UCZ80) $< < $(PORTS_DIR)/$(PORT)/uCsim.cmd > $@ \ || echo -e --- FAIL: \"timeout, simulation killed\" in $(<:$(EXEEXT)=.c)"\n"--- Summary: 1/1/1: timeout >> $@ + python $(srcdir)/get_ticks.py < $@ >> $@ -grep -n FAIL $@ /dev/null || true -fwk/lib/timeout: fwk/lib/timeout.c +$(CASES_DIR)/timeout: fwk/lib/timeout.c + $(CC) $(CFLAGS) $< -o $@ _clean: - rm -f fwk/lib/timeout fwk/lib/timeout.exe $(PORTS_DIR)/$(PORT)/*.rel $(PORTS_DIR)/$(PORT)/*.rst \ - $(PORTS_DIR)/$(PORT)/*.lst $(PORTS_DIR)/$(PORT)/*.sym temp.lnk -