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
13 LINKFLAGS = --nostdlib
15 LIBDIR = $(SDCC_DIR)/device/lib/build/z80
20 EXTRAS = $(PORTS_DIR)/$(PORT)/testfwk$(OBJEXT) $(PORTS_DIR)/$(PORT)/support$(OBJEXT)
22 # Rule to link into .ihx
24 $(SDCC) $(SDCCFLAGS) $(LINKFLAGS) -L $(LIBDIR) $(EXTRAS) $< -o $@
27 $(SDCC_DIR)/bin/as-z80 -plosgff $@ $<
30 $(SDCC) $(SDCCFLAGS) -c $< -o $@
32 $(PORTS_DIR)/$(PORT)/%$(OBJEXT): fwk/lib/%.c
33 $(SDCC) $(SDCCFLAGS) -c $< -o $@
35 # run simulator with 10 seconds timeout
36 %.out: %$(EXEEXT) fwk/lib/timeout
38 -fwk/lib/timeout 10 $(UCZ80) $< < $(PORTS_DIR)/$(PORT)/uCsim.cmd > $@ \
39 || echo -e --- FAIL: \"timeout, simulation killed\" in $(<:$(EXEEXT)=.c)"\n"--- Summary: 1/1/1: timeout >> $@
40 python get_ticks.py < $@ >> $@
41 -grep -n FAIL $@ /dev/null || true
43 fwk/lib/timeout: fwk/lib/timeout.c
46 rm -f ports/$(PORT)/testfwk.asm ports/$(PORT)/*.lst ports/$(PORT)/*.o ports/$(PORT)/*.sym