new option -o
[fw/sdcc] / support / regression / ports / ucz80 / spec.mk
1 # Port specification for the xxxx port running with uCsim
2 #
3
4 # path to uCsim
5 UCZ80 = $(SDCC_DIR)/bin/sz80
6 #UCZ80 = $(SDCC_DIR)/bin/s51
7
8 SDCCFLAGS +=-mz80 --lesspedantic --profile -DREENTRANT=
9 #SDCCFLAGS +=--lesspedantic -DREENTRANT=reentrant --stack-after-data
10
11 #OBJEXT = .o
12 EXEEXT = .ihx
13
14 EXTRAS = fwk/lib/testfwk$(OBJEXT) $(PORTS_DIR)/$(PORT)/support$(OBJEXT)
15
16 # Rule to link into .ihx
17 #%$(EXEEXT): %$(OBJEXT) $(EXTRAS)
18
19 %$(EXEEXT): %.c $(EXTRAS)
20         $(SDCC) $(SDCCFLAGS) $< $(EXTRAS) -o $@
21
22 %$(OBJEXT): %.asm
23         $(SDCC_DIR)/bin/as-z80 -plosgff $@ $<
24
25 %$(OBJEXT): %.c
26         $(SDCC) $(SDCCFLAGS) -c $< -o $@
27
28 # run simulator with 10 seconds timeout
29 %.out: %$(EXEEXT) fwk/lib/timeout
30         mkdir -p `dirname $@`
31         -fwk/lib/timeout 10 $(UCZ80) -t32 $< < $(PORTS_DIR)/$(PORT)/uCsim.cmd > $@ \
32           || echo -e --- FAIL: \"timeout, simulation killed\" in $(<:$(EXEEXT)=.c)"\n"--- Summary: 1/1/1: timeout >> $@
33         -grep -n FAIL $@ /dev/null || true
34
35 fwk/lib/timeout: fwk/lib/timeout.c
36
37 _clean:
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 temp.lnk
40