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