Tidied up the build, install, and regression tests.
[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 # path to uCsim
6 SZ80A = $(SDCC_DIR)/sim/ucsim/sz80.src/sz80
7 SZ80B = $(SDCC_DIR)/bin/sz80
8
9 UCZ80 = $(shell if [ -f $(SZ80A) ]; then echo $(SZ80A); else echo $(SZ80B); fi)
10
11 SDCCFLAGS +=-mz80 --less-pedantic --profile -DREENTRANT=
12 #SDCCFLAGS +=--less-pedantic -DREENTRANT=reentrant
13
14 #OBJEXT = .o
15 EXEEXT = .ihx
16
17 EXTRAS = $(PORTS_DIR)/$(PORT)/testfwk$(OBJEXT) $(PORTS_DIR)/$(PORT)/support$(OBJEXT)
18
19 # Rule to link into .ihx
20 #%$(EXEEXT): %$(OBJEXT) $(EXTRAS)
21
22 %$(EXEEXT): %.c $(EXTRAS)
23         $(SDCC) $(SDCCFLAGS) $< $(EXTRAS) -o $@
24
25 %$(OBJEXT): %.asm
26         $(SDCC_DIR)/bin/as-z80 -plosgff $@ $<
27
28 %$(OBJEXT): %.c
29         $(SDCC) $(SDCCFLAGS) -c $< -o $@
30
31 $(PORTS_DIR)/$(PORT)/%$(OBJEXT): fwk/lib/%.c
32         $(SDCC) $(SDCCFLAGS) -c $< -o $@
33
34 # run simulator with 10 seconds timeout
35 %.out: %$(EXEEXT) fwk/lib/timeout
36         mkdir -p `dirname $@`
37         -fwk/lib/timeout 10 $(UCZ80) -t32 $< < $(PORTS_DIR)/$(PORT)/uCsim.cmd > $@ \
38           || echo -e --- FAIL: \"timeout, simulation killed\" in $(<:$(EXEEXT)=.c)"\n"--- Summary: 1/1/1: timeout >> $@
39         -grep -n FAIL $@ /dev/null || true
40
41 fwk/lib/timeout: fwk/lib/timeout.c
42
43 _clean:
44         rm -f ports/$(PORT)/testfwk.asm ports/$(PORT)/*.lst ports/$(PORT)/*.o ports/$(PORT)/*.sym
45