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