X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=support%2Fregression%2Fports%2Fhc08%2Fspec.mk;h=0db5e33089728b4abaded6bd768f62706c154339;hb=68cf035ac940c45599b4c0e3b72856e1d14447d4;hp=27d1b698e12455a6017978f98b74a1d24ae2d39e;hpb=13bce9be22334b2b96daea87f24d4cf65803e2d6;p=fw%2Fsdcc diff --git a/support/regression/ports/hc08/spec.mk b/support/regression/ports/hc08/spec.mk index 27d1b698..0db5e330 100644 --- a/support/regression/ports/hc08/spec.mk +++ b/support/regression/ports/hc08/spec.mk @@ -1,44 +1,58 @@ +# Regression test specification for the hc08 target running with uCsim +# + # path to uCsim -UCHC08A = $(SDCC_DIR)/sim/ucsim/hc08.src/shc08 -UCHC08B = $(SDCC_DIR)/bin/shc08 +ifdef SDCC_BIN_PATH + UCHC08 = $(SDCC_BIN_PATH)/shc08 + + AS_HC08 = $(SDCC_BIN_PATH)/as-hc08 +else + UCHC08A = $(top_builddir)/sim/ucsim/hc08.src/shc08 + UCHC08B = $(top_builddir)/bin/shc08 + + UCHC08 = $(shell if [ -f $(UCHC08A) ]; then echo $(UCHC08A); else echo $(UCHC08B); fi) + + AS_HC08 = $(top_builddir)/bin/as-hc08 -UCHC08 = $(shell if [ -f $(UCHC08A) ]; then echo $(UCHC08A); else echo $(UCHC08B); fi) + SDCCFLAGS += --nostdinc + LINKFLAGS += --nostdlib -L $(top_builddir)/device/lib/build/hc08 +endif -SDCCFLAGS +=-mhc08 --nostdinc --less-pedantic --out-fmt-ihx -DREENTRANT=reentrant -LINKFLAGS = --nostdlib +SDCCFLAGS +=-mhc08 --less-pedantic --out-fmt-ihx -DREENTRANT=reentrant -I$(top_srcdir) LINKFLAGS += hc08.lib -LIBDIR = $(SDCC_DIR)/device/lib/build/hc08 OBJEXT = .rel EXEEXT = .ihx -EXTRAS = $(PORTS_DIR)/$(PORT)/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) $(LINKFLAGS) -L $(LIBDIR) $(EXTRAS) $< -o $@ +%$(EXEEXT): %$(OBJEXT) $(EXTRAS) + $(SDCC) $(SDCCFLAGS) $(LINKFLAGS) $(EXTRAS) $< -o $@ %$(OBJEXT): %.asm - $(SDCC_DIR)/bin/as-hc08 -plosgff $< + $(AS_HC08) -plosgff $< %$(OBJEXT): %.c $(SDCC) $(SDCCFLAGS) -c $< -o $@ -$(PORTS_DIR)/$(PORT)/%$(OBJEXT): fwk/lib/%.c +$(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 $(UCHC08) $< < $(PORTS_DIR)/$(PORT)/uCsim.cmd > $@ \ +%.out: %$(EXEEXT) $(CASES_DIR)/timeout + mkdir -p $(dir $@) + -$(CASES_DIR)/timeout 10 $(UCHC08) $< < $(PORTS_DIR)/$(PORT)/uCsim.cmd > $@ \ || echo -e --- FAIL: \"timeout, simulation killed\" in $(<:$(EXEEXT)=.c)"\n"--- Summary: 1/1/1: timeout >> $@ - python get_ticks.py < $@ >> $@ + 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 ports/$(PORT)/testfwk.asm ports/$(PORT)/*.lst ports/$(PORT)/*.rel ports/$(PORT)/*.sym -