eb50f0195cc1c00a3224624f5c7de83ef74be317
[fw/sdcc] / support / regression / ports / xa51 / spec.mk
1 # Port specification for the xa51 port running with uCsim
2
3 # path to uCsim
4 SXA_A = $(top_builddir)sim/ucsim/xa.src/sxa
5 SXA_B = $(top_builddir)bin/sxa
6
7 SXA = $(shell if [ -f $(SXA_A) ]; then echo $(SXA_A); else echo $(SXA_B); fi)
8
9 SDCCFLAGS +=-mxa51 --less-pedantic -DREENTRANT= -I$(top_srcdir)
10
11 OBJEXT = .rel
12 EXEEXT = .hex
13
14 EXTRAS = $(PORT_CASES_DIR)/testfwk$(OBJEXT) $(PORT_CASES_DIR)/support$(OBJEXT)
15
16 # Rule to link into .hex
17 %$(EXEEXT): %$(OBJEXT) $(EXTRAS)
18         $(SDCC) $(SDCCFLAGS) $(EXTRAS) $< -o $@
19
20 %$(OBJEXT): %.c
21         $(SDCC) $(SDCCFLAGS) -c $< -o $@
22
23 $(PORT_CASES_DIR)/%$(OBJEXT): $(PORTS_DIR)/$(PORT)/%.c
24         $(SDCC) $(SDCCFLAGS) -c $< -o $@
25
26 $(PORT_CASES_DIR)/%$(OBJEXT): fwk/lib/%.c
27         $(SDCC) $(SDCCFLAGS) -c $< -o $@
28
29 # run simulator with 1 second timeout
30 %.out: %$(EXEEXT) $(CASES_DIR)/timeout
31         mkdir -p $(dir $@)
32         -$(CASES_DIR)/timeout 1 $(SXA) -S in=/dev/null,out=$@ $< < $(PORTS_DIR)/xa51/uCsim.cmd >/dev/null || \
33           echo -e --- FAIL: \"timeout, simulation killed\" in $(<:.ihx=.c)"\n"--- Summary: 1/1/1: timeout >> $@
34         -grep -n FAIL $@ /dev/null || true
35
36 $(CASES_DIR)/timeout: fwk/lib/timeout.c
37         $(CC) $< -o $@
38
39 _clean: