X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=support%2Fregression%2Fports%2Fmcs51%2Fspec.mk;h=fd2a395665c869e0954aeb7361143bdce0943fdd;hb=c9b59d8ffd825b492613f8ef6198b4ea8b84b860;hp=071d08eeb27e930466eb304e50c31e0553351ff7;hpb=98db30348e2ea36fa873f7e501e119b2623c6124;p=fw%2Fsdcc diff --git a/support/regression/ports/mcs51/spec.mk b/support/regression/ports/mcs51/spec.mk index 071d08ee..fd2a3956 100644 --- a/support/regression/ports/mcs51/spec.mk +++ b/support/regression/ports/mcs51/spec.mk @@ -1,35 +1,54 @@ # Port specification for the mcs51 port running with uCsim +# +# model small + +ifndef DEV_NULL + DEV_NULL = /dev/null +endif # path to uCsim -S51 = ../../sim/ucsim/s51.src/s51 +S51A = $(top_builddir)sim/ucsim/s51.src/s51 +S51B = $(top_builddir)bin/s51 + +S51 = $(shell if [ -f $(S51A) ]; then echo $(S51A); else echo $(S51B); fi) -SDCCFLAGS += --lesspedantic -DREENTRANT=reentrant --stack-after-data +SDCCFLAGS +=--nostdinc --less-pedantic -DREENTRANT=reentrant -I$(INC_DIR)/mcs51 -I$(top_srcdir) +LINKFLAGS = --nostdlib +LINKFLAGS += mcs51.lib libsdcc.lib liblong.lib libint.lib libfloat.lib +LIBDIR = $(top_builddir)device/lib/build/small OBJEXT = .rel EXEEXT = .ihx -EXTRAS = fwk/lib/testfwk$(OBJEXT) ports/$(PORT)/support$(OBJEXT) +EXTRAS = $(PORT_CASES_DIR)/testfwk$(OBJEXT) $(PORT_CASES_DIR)/support$(OBJEXT) +FWKLIB = $(PORT_CASES_DIR)/T2_isr$(OBJEXT) # Rule to link into .ihx -%$(EXEEXT): %$(OBJEXT) $(EXTRAS) - $(SDCC) $(SDCCFLAGS) $(EXTRAS) $< - mv fwk/lib/testfwk.ihx $@ - mv fwk/lib/testfwk.map $(@:.ihx=.map) +%$(EXEEXT): %$(OBJEXT) $(EXTRAS) $(FWKLIB) $(PORT_CASES_DIR)/fwk.lib + $(SDCC) $(SDCCFLAGS) $(LINKFLAGS) -L $(LIBDIR) $(EXTRAS) $(PORT_CASES_DIR)/fwk.lib $< -o $@ %$(OBJEXT): %.c - $(SDCC) $(SDCCFLAGS) -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 5 seconds timeout -%.out: %$(EXEEXT) ports/$(PORT)/timeout - mkdir -p `dirname $@` - -ports/$(PORT)/timeout 5 $(S51) -t32 -S in=/dev/null,out=$@ $< < ports/mcs51/uCsim.cmd >/dev/null || \ - echo -e --- FAIL: \"timeout, simulation killed\" in $(<:.ihx=.c)"\n"--- Summary: 1/1/1: timeout >> $@ +$(PORT_CASES_DIR)/fwk.lib: + cp $(PORTS_DIR)/mcs51/fwk.lib $@ + +# run simulator with 30 seconds timeout +%.out: %$(EXEEXT) gen/timeout + mkdir -p $(dir $@) + -gen/timeout 30 "$(S51)" -t32 -S in=$(DEV_NULL),out=$@ $< < $(PORTS_DIR)/mcs51/uCsim.cmd > $(@:.out=.sim) \ + || echo -e --- FAIL: \"timeout, simulation killed\" in $(<:$(EXEEXT)=.c)"\n"--- Summary: 1/1/1: timeout >> $@ + python $(srcdir)/get_ticks.py < $(@:.out=.sim) >> $@ -grep -n FAIL $@ /dev/null || true -ports/$(PORT)/timeout: ports/$(PORT)/timeout.c - gcc -o $@ $< -_clean: - rm -f ports/$(PORT)/timeout ports/$(PORT)/*.rel ports/$(PORT)/*.rst ports/$(PORT)/*.lst \ - ports/$(PORT)/*.sym ports/$(PORT)/*.asm +gen/timeout: $(srcdir)/fwk/lib/timeout.c + $(CC) $< -o $@ +_clean: