1 # Port specification for the mcs51 port running with uCsim
6 S51A = $(SDCC_DIR)/sim/ucsim/s51.src/s51
7 S51B = $(SDCC_DIR)/bin/s51
9 S51 = $(shell if [ -f $(S51A) ]; then echo $(S51A); else echo $(S51B); fi)
11 SDCCFLAGS +=--lesspedantic -DREENTRANT=reentrant --stack-after-data
16 EXTRAS = fwk/lib/testfwk$(OBJEXT) $(PORTS_DIR)/$(PORT)/support$(OBJEXT)
18 # Rule to link into .ihx
19 %$(EXEEXT): %$(OBJEXT) $(EXTRAS)
20 $(SDCC) $(SDCCFLAGS) $(EXTRAS) $<
21 mv fwk/lib/testfwk.ihx $@
22 mv fwk/lib/testfwk.map $(@:.ihx=.map)
25 $(SDCC) $(SDCCFLAGS) -c $<
27 # run simulator with 10 seconds timeout
28 %.out: %$(EXEEXT) fwk/lib/timeout
30 -fwk/lib/timeout 10 $(S51) -t32 -S in=/dev/null,out=$@ $< < $(PORTS_DIR)/mcs51/uCsim.cmd >/dev/null \
31 || echo -e --- FAIL: \"timeout, simulation killed\" in $(<:.ihx=.c)"\n"--- Summary: 1/1/1: timeout >> $@
32 -grep -n FAIL $@ /dev/null || true
34 fwk/lib/timeout: fwk/lib/timeout.c
37 rm -f fwk/lib/timeout fwk/lib/timeout.exe $(PORTS_DIR)/$(PORT)/*.rel $(PORTS_DIR)/$(PORT)/*.rst \
38 $(PORTS_DIR)/$(PORT)/*.lst $(PORTS_DIR)/$(PORT)/*.sym $(PORTS_DIR)/$(PORT)/*.asm temp.lnk