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