1 # Port specification for the xxxx port running with uCsim
6 SZ80A = $(SDCC_DIR)/sim/ucsim/z80.src/sz80
7 SZ80B = $(SDCC_DIR)/bin/sz80
9 UCZ80 = $(shell if [ -f $(SZ80A) ]; then echo $(SZ80A); else echo $(SZ80B); fi)
11 SDCCFLAGS +=-mz80 --less-pedantic --profile -DREENTRANT=
12 #SDCCFLAGS +=--less-pedantic -DREENTRANT=reentrant
17 EXTRAS = $(PORTS_DIR)/$(PORT)/testfwk$(OBJEXT) $(PORTS_DIR)/$(PORT)/support$(OBJEXT)
19 # Rule to link into .ihx
20 #%$(EXEEXT): %$(OBJEXT) $(EXTRAS)
22 %$(EXEEXT): %.c $(EXTRAS)
23 $(SDCC) $(SDCCFLAGS) $< $(EXTRAS) -o $@
26 $(SDCC_DIR)/bin/as-z80 -plosgff $@ $<
29 $(SDCC) $(SDCCFLAGS) -c $< -o $@
31 $(PORTS_DIR)/$(PORT)/%$(OBJEXT): fwk/lib/%.c
32 $(SDCC) $(SDCCFLAGS) -c $< -o $@
34 # run simulator with 10 seconds timeout
35 %.out: %$(EXEEXT) fwk/lib/timeout
37 -fwk/lib/timeout 10 $(UCZ80) -t32 $< < $(PORTS_DIR)/$(PORT)/uCsim.cmd > $@ \
38 || echo -e --- FAIL: \"timeout, simulation killed\" in $(<:$(EXEEXT)=.c)"\n"--- Summary: 1/1/1: timeout >> $@
39 -grep -n FAIL $@ /dev/null || true
41 fwk/lib/timeout: fwk/lib/timeout.c
44 rm -f ports/$(PORT)/testfwk.asm ports/$(PORT)/*.lst ports/$(PORT)/*.o ports/$(PORT)/*.sym