1 # Common regression test specification for the mcs51 targets running with uCsim
9 S51 = $(SDCC_BIN_PATH)/s51
11 S51A = $(top_builddir)/sim/ucsim/s51.src/s51
12 S51B = $(top_builddir)/bin/s51
14 S51 = $(shell if [ -f $(S51A) ]; then echo $(S51A); else echo $(S51B); fi)
16 SDCCFLAGS += --nostdinc
17 LINKFLAGS += --nostdlib
20 SDCCFLAGS += --less-pedantic -DREENTRANT=reentrant -I$(INC_DIR)/mcs51 -I$(top_srcdir)
21 LINKFLAGS += mcs51.lib libsdcc.lib liblong.lib libint.lib libfloat.lib
26 EXTRAS = $(PORT_CASES_DIR)/testfwk$(OBJEXT) $(PORT_CASES_DIR)/support$(OBJEXT)
27 FWKLIB = $(PORT_CASES_DIR)/T2_isr$(OBJEXT)
29 # Rule to link into .ihx
30 %$(EXEEXT): %$(OBJEXT) $(EXTRAS) $(FWKLIB) $(PORT_CASES_DIR)/fwk.lib
31 $(SDCC) $(SDCCFLAGS) $(LINKFLAGS) $(EXTRAS) $(PORT_CASES_DIR)/fwk.lib $< -o $@
34 $(SDCC) $(SDCCFLAGS) -c $< -o $@
36 $(PORT_CASES_DIR)/%$(OBJEXT): $(PORTS_DIR)/mcs51-common/%.c
37 $(SDCC) $(SDCCFLAGS) -c $< -o $@
39 $(PORT_CASES_DIR)/%$(OBJEXT): fwk/lib/%.c
40 $(SDCC) $(SDCCFLAGS) -c $< -o $@
42 $(PORT_CASES_DIR)/fwk.lib:
43 cp $(PORTS_DIR)/mcs51-common/fwk.lib $@
45 # run simulator with 30 seconds timeout
46 %.out: %$(EXEEXT) gen/timeout
48 -gen/timeout 30 "$(S51)" -t32 -S in=$(DEV_NULL),out=$@ $< < $(PORTS_DIR)/mcs51-common/uCsim.cmd > $(@:.out=.sim) \
49 || echo -e --- FAIL: \"timeout, simulation killed\" in $(<:$(EXEEXT)=.c)"\n"--- Summary: 1/1/1: timeout >> $@
50 python $(srcdir)/get_ticks.py < $(@:.out=.sim) >> $@
51 -grep -n FAIL $@ /dev/null || true
54 gen/timeout: $(srcdir)/fwk/lib/timeout.c
55 $(CC) $(CFLAGS) $< -o $@