2 UCHC08A = $(SDCC_DIR)/sim/ucsim/hc08.src/shc08
3 UCHC08B = $(SDCC_DIR)/bin/shc08
5 UCHC08 = $(shell if [ -f $(UCHC08A) ]; then echo $(UCHC08A); else echo $(UCHC08B); fi)
7 SDCCFLAGS +=-mhc08 --nostdinc --less-pedantic --out-fmt-ihx -DREENTRANT=reentrant
10 LIBDIR = $(SDCC_DIR)/device/lib/build/hc08
15 EXTRAS = $(PORTS_DIR)/$(PORT)/testfwk$(OBJEXT) $(PORTS_DIR)/$(PORT)/support$(OBJEXT)
17 # Rule to link into .ihx
18 #%$(EXEEXT): %$(OBJEXT) $(EXTRAS)
20 %$(EXEEXT): %.c $(EXTRAS)
21 $(SDCC) $(SDCCFLAGS) $(LINKFLAGS) -L $(LIBDIR) $(EXTRAS) $< -o $@
24 $(SDCC_DIR)/bin/as-hc08 -plosgff $<
27 $(SDCC) $(SDCCFLAGS) -c $< -o $@
29 $(PORTS_DIR)/$(PORT)/%$(OBJEXT): fwk/lib/%.c
30 $(SDCC) $(SDCCFLAGS) -c $< -o $@
32 # run simulator with 10 seconds timeout
33 %.out: %$(EXEEXT) fwk/lib/timeout
35 -fwk/lib/timeout 10 $(UCHC08) $< < $(PORTS_DIR)/$(PORT)/uCsim.cmd > $@ \
36 || echo -e --- FAIL: \"timeout, simulation killed\" in $(<:$(EXEEXT)=.c)"\n"--- Summary: 1/1/1: timeout >> $@
37 python get_ticks.py < $@ >> $@
38 -grep -n FAIL $@ /dev/null || true
40 fwk/lib/timeout: fwk/lib/timeout.c
43 rm -f ports/$(PORT)/*.asm ports/$(PORT)/*.lst ports/$(PORT)/*.rel ports/$(PORT)/*.sym