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