381f98629dbcc5a7ed9c4c9e135070bfdc029881
[fw/sdcc] / support / regression / ports / ds390 / spec.mk
1 # Port specification for the ds390 port running with uCsim
2
3 # path to uCsim
4 S51 = $(SDCC_DIR)/sim/ucsim/s51.src/s51
5
6 SDCCFLAGS +=-mds390 --lesspedantic -DREENTRANT=reentrant --stack-after-data
7
8 OBJEXT = .rel
9 EXEEXT = .ihx
10
11 EXTRAS = fwk/lib/testfwk$(OBJEXT) $(PORTS_DIR)/$(PORT)/support$(OBJEXT)
12
13 # Rule to link into .ihx
14 %$(EXEEXT): %$(OBJEXT) $(EXTRAS)
15         $(SDCC) $(SDCCFLAGS) $(EXTRAS) $<
16         mv fwk/lib/testfwk.ihx $@
17         mv fwk/lib/testfwk.map $(@:.ihx=.map)
18
19 %$(OBJEXT): %.c
20         $(SDCC) $(SDCCFLAGS) -c $<
21
22 # run simulator with 10 seconds timeout
23 %.out: %$(EXEEXT) fwk/lib/timeout
24         mkdir -p `dirname $@`
25         -fwk/lib/timeout 10 $(S51) -tds390f -S in=/dev/null,out=$@ $< < $(PORTS_DIR)/ds390/uCsim.cmd >/dev/null || \
26           echo -e --- FAIL: \"timeout, simulation killed\" in $(<:.ihx=.c)"\n"--- Summary: 1/1/1: timeout >> $@
27         -grep -n FAIL $@ /dev/null || true
28
29 fwk/lib/timeout: fwk/lib/timeout.c
30
31 _clean:
32         rm -f fwk/lib/timeout fwk/lib/timeout.exe $(PORTS_DIR)/$(PORT)/*.rel $(PORTS_DIR)/$(PORT)/*.rst \
33               $(PORTS_DIR)/$(PORT)/*.lst $(PORTS_DIR)/$(PORT)/*.sym $(PORTS_DIR)/$(PORT)/*.asm temp.lnk
34