1 # Port specification for the xxxx port running with uCsim
6 SZ80A = $(top_builddir)/sim/ucsim/z80.src/sz80
7 SZ80B = $(top_builddir)/bin/sz80
9 UCZ80 = $(shell if [ -f $(SZ80A) ]; then echo $(SZ80A); else echo $(SZ80B); fi)
11 SDCCFLAGS +=-mz80 --less-pedantic --profile -DREENTRANT= -I$(top_srcdir)
12 #SDCCFLAGS +=--less-pedantic -DREENTRANT=reentrant
13 LINKFLAGS = --nostdlib
15 LIBDIR = $(top_builddir)/device/lib/build/z80
20 EXTRAS = $(PORT_CASES_DIR)/testfwk$(OBJEXT) $(PORT_CASES_DIR)/support$(OBJEXT)
22 # Rule to link into .ihx
24 $(SDCC) $(SDCCFLAGS) $(LINKFLAGS) -L $(LIBDIR) $(EXTRAS) $< -o $@
26 $(PORT_CASES_DIR)/%$(OBJEXT): $(PORTS_DIR)/$(PORT)/%.asm
27 $(top_builddir)/bin/as-z80 -plosgff $@ $<
30 $(SDCC) $(SDCCFLAGS) -c $< -o $@
32 $(PORT_CASES_DIR)/%$(OBJEXT): $(PORTS_DIR)/$(PORT)/%.c
33 $(SDCC) $(SDCCFLAGS) -c $< -o $@
35 $(PORT_CASES_DIR)/%$(OBJEXT): fwk/lib/%.c
36 $(SDCC) $(SDCCFLAGS) -c $< -o $@
38 # run simulator with 10 seconds timeout
39 %.out: %$(EXEEXT) $(CASES_DIR)/timeout
41 -$(CASES_DIR)/timeout 10 $(UCZ80) $< < $(PORTS_DIR)/$(PORT)/uCsim.cmd > $@ \
42 || echo -e --- FAIL: \"timeout, simulation killed\" in $(<:$(EXEEXT)=.c)"\n"--- Summary: 1/1/1: timeout >> $@
43 python $(srcdir)/get_ticks.py < $@ >> $@
44 -grep -n FAIL $@ /dev/null || true
46 $(CASES_DIR)/timeout: fwk/lib/timeout.c