1 # Port specification for the xa51 port running with uCsim
4 SXA_A = $(SDCC_DIR)/sim/ucsim/xa.src/sxa
5 SXA_B = $(SDCC_DIR)/bin/sxa
7 SXA = $(shell if [ -f $(SXA_A) ]; then echo $(SXA_A); else echo $(SXA_B); fi)
9 SDCCFLAGS +=-mxa51 --less-pedantic -DREENTRANT=
14 EXTRAS = $(PORTS_DIR)/$(PORT)/testfwk$(OBJEXT) $(PORTS_DIR)/$(PORT)/support$(OBJEXT)
16 # Rule to link into .hex
17 %$(EXEEXT): %$(OBJEXT) $(EXTRAS)
18 $(SDCC) $(SDCCFLAGS) $(EXTRAS) $< -o $@
19 mv fwk/lib/testfwk.hex $@
20 mv fwk/lib/testfwk.map $(@:.hex=.map)
23 $(SDCC) $(SDCCFLAGS) -c $< -o $@
25 $(PORTS_DIR)/$(PORT)/%$(OBJEXT): fwk/lib/%.c
26 $(SDCC) $(SDCCFLAGS) -c $< -o $@
28 # run simulator with 1 second timeout
29 %.out: %$(EXEEXT) fwk/lib/timeout
31 -fwk/lib/timeout 1 $(SXA) -S in=/dev/null,out=$@ $< < $(PORTS_DIR)/xa51/uCsim.cmd >/dev/null || \
32 echo -e --- FAIL: \"timeout, simulation killed\" in $(<:.ihx=.c)"\n"--- Summary: 1/1/1: timeout >> $@
33 -grep -n FAIL $@ /dev/null || true
35 fwk/lib/timeout: fwk/lib/timeout.c
38 rm -f fwk/lib/timeout fwk/lib/timeout.exe $(PORTS_DIR)/$(PORT)/*.rel $(PORTS_DIR)/$(PORT)/*.rst \
39 $(PORTS_DIR)/$(PORT)/*.lst $(PORTS_DIR)/$(PORT)/*.sym $(PORTS_DIR)/$(PORT)/*.xa $(PORTS_DIR)/$(PORT)/*.lnk