1 # Port specification for the pic16 port running with gpsim
5 GPSIM := $(GPSIM_PATH)/gpsim
10 SDCCFLAGS += -mpic16 -pp18f452 -I$(SDCC_DIR)/device/include/pic16 --nostdinc --less-pedantic -Wl,-t255 -Wl,-q -DREENTRANT=reentrant
11 LINKFLAGS = --nostdlib
12 LINKFLAGS += libsdcc.lib libc18f.lib libm18f.lib
13 LIBDIR = $(SDCC_DIR)/device/lib/build/pic16
18 EXTRAS = $(PORTS_DIR)/$(PORT)/testfwk$(OBJEXT) $(PORTS_DIR)/$(PORT)/support$(OBJEXT)
20 # Rule to link into .ihx
21 %$(EXEEXT): %$(OBJEXT) $(EXTRAS)
22 $(SDCC) $(SDCCFLAGS) $(LINKFLAGS) -L $(LIBDIR) $(EXTRAS) $< -o $@
25 $(SDCC) $(SDCCFLAGS) -c $< -o $@
27 $(PORTS_DIR)/$(PORT)/testfwk$(OBJEXT): fwk/lib/testfwk.c
28 $(SDCC) $(SDCCFLAGS) -c $< -o $@
30 # run simulator with 25 seconds timeout
31 %.out: %$(EXEEXT) fwk/lib/timeout
33 -fwk/lib/timeout 25 $(GPSIM) -i -s $< -c $(PORTS_DIR)/pic16/gpsim.cmd > $@ || \
34 echo -e --- FAIL: \"timeout, simulation killed\" in $(<:$(EXEEXT)=.c)"\n"--- Summary: 1/1/1: timeout >> $@
35 python get_ticks.py < $@ >> $@
36 -grep -n FAIL $@ /dev/null || true
38 fwk/lib/timeout: fwk/lib/timeout.c
41 rm -f fwk/lib/timeout fwk/lib/timeout.exe $(PORTS_DIR)/$(PORT)/*.rel $(PORTS_DIR)/$(PORT)/*.rst \
42 $(PORTS_DIR)/$(PORT)/*.lst $(PORTS_DIR)/$(PORT)/*.sym $(PORTS_DIR)/$(PORT)/*.asm \
43 $(PORTS_DIR)/$(PORT)/*.lnk $(PORTS_DIR)/$(PORT)/*.map $(PORTS_DIR)/$(PORT)/*.mem