* configure.in: added missing mcs51 in status output
[fw/sdcc] / support / regression / ports / pic16 / spec.mk
1 # Port specification for the pic16 port 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 SDCCFLAGS += -mpic16 -pp18f452 -I$(top_srcdir)/device/include/pic16 --nostdinc --less-pedantic -Wl,-q -DREENTRANT=reentrant -I$(top_srcdir)
11 LINKFLAGS = --nostdlib
12 LINKFLAGS += libsdcc.lib libc18f.lib libm18f.lib
13 LIBDIR = $(top_builddir)/device/lib/build/pic16
14
15 OBJEXT = .o
16 EXEEXT = .cod
17
18 EXTRAS = $(PORT_CASES_DIR)/testfwk$(OBJEXT) $(PORT_CASES_DIR)/support$(OBJEXT)
19
20 # Rule to link into .ihx
21 %$(EXEEXT): %$(OBJEXT) $(EXTRAS)
22         -$(SDCC) $(SDCCFLAGS) $(LINKFLAGS) -L $(LIBDIR) $(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 .PRECIOUS: gen/pic16/testfwk.o gen/pic16/support.o
31
32 $(PORT_CASES_DIR)/%$(OBJEXT): fwk/lib/%.c
33         $(SDCC) $(SDCCFLAGS) -c $< -o $@
34
35 # run simulator with 25 seconds timeout
36 %.out: %$(EXEEXT) $(CASES_DIR)/timeout
37         mkdir -p $(dir $@)
38         -$(CASES_DIR)/timeout 25 "$(GPSIM)" -i -s $< -c $(PORTS_DIR)/pic16/gpsim.cmd > $@ || \
39           echo -e --- FAIL: \"timeout, simulation killed\" in $(<:$(EXEEXT)=.c)"\n"--- Summary: 1/1/1: timeout >> $@
40         python $(srcdir)/get_ticks.py < $@ >> $@
41         -grep -n FAIL $@ /dev/null || true
42
43 $(CASES_DIR)/timeout: fwk/lib/timeout.c
44         $(CC) $< -o $@
45
46 _clean: