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