Imported Upstream version 2.9.0
[debian/cc1111] / support / regression / ports / pic14 / spec.mk
1 # Regression test specification for the pic14 target running with gpsim
2
3 # path to gpsim
4 ifdef GPSIM_PATH
5   GPSIM := $(GPSIM_PATH)/gpsim
6 else
7   GPSIM := gpsim
8 endif
9
10 ifndef SDCC_BIN_PATH
11   SDCCFLAGS += --nostdinc -I$(top_srcdir)/device/include/pic -I$(top_srcdir)
12   LINKFLAGS += --nostdlib -L$(top_builddir)/device/lib/build/pic
13 endif
14
15 SDCCFLAGS += -mpic14 -pp16f877 --less-pedantic -Wl,-q -DREENTRANT=reentrant
16 LINKFLAGS += libsdcc.lib libm.lib
17
18 OBJEXT = .o
19 EXEEXT = .cod
20
21 EXTRAS = $(PORT_CASES_DIR)/testfwk$(OBJEXT) $(PORT_CASES_DIR)/support$(OBJEXT)
22
23 # Rule to link into .ihx
24 %$(EXEEXT): %$(OBJEXT) $(EXTRAS)
25         -$(SDCC) $(SDCCFLAGS) $(LINKFLAGS) $(EXTRAS) $< -o $@
26
27 %$(OBJEXT): %.c
28         -$(SDCC) $(SDCCFLAGS) -c $< -o $@
29
30 $(PORT_CASES_DIR)/%$(OBJEXT): $(PORTS_DIR)/$(PORT)/%.c
31         -$(SDCC) $(SDCCFLAGS) -c $< -o $@
32
33 .PRECIOUS: gen/pic14/testfwk.o gen/pic14/support.o
34
35 $(PORT_CASES_DIR)/%$(OBJEXT): fwk/lib/%.c
36         $(SDCC) $(SDCCFLAGS) -c $< -o $@
37
38 # run simulator with 25 seconds timeout
39 %.out: %$(EXEEXT) $(CASES_DIR)/timeout
40         mkdir -p $(dir $@)
41         -$(CASES_DIR)/timeout 25 "$(GPSIM)" -i -s $< -c $(PORTS_DIR)/pic14/gpsim.cmd > $@ || \
42           echo -e --- FAIL: \"timeout, simulation killed\" in $(<:$(EXEEXT)=.c)"\n"--- Summary: 1/1/1: timeout >> $@
43         python $(srcdir)/get_ticks.py < $@ >> $@
44         -grep -n FAIL $@ /dev/null || true
45
46 $(CASES_DIR)/timeout: fwk/lib/timeout.c
47         $(CC) $(CFLAGS) $< -o $@
48
49 _clean: