1 # Port specification for the ds390 port running with uCsim
8 S51A = $(top_builddir)/sim/ucsim/s51.src/s51
9 S51B = $(top_builddir)/bin/s51
11 S51 = $(shell if [ -f $(S51A) ]; then echo $(S51A); else echo $(S51B); fi)
13 SDCCFLAGS +=-mds390 --nostdinc --less-pedantic -DREENTRANT=reentrant -Wl-r -I$(top_srcdir)
14 LINKFLAGS = --nostdlib
15 LINKFLAGS += libds390.lib libsdcc.lib liblong.lib libint.lib libfloat.lib
16 LIBDIR = $(top_builddir)/device/lib/build/ds390
21 EXTRAS = $(PORT_CASES_DIR)/testfwk$(OBJEXT) $(PORT_CASES_DIR)/support$(OBJEXT)
23 # Rule to link into .ihx
24 %$(EXEEXT): %$(OBJEXT) $(EXTRAS)
25 $(SDCC) $(SDCCFLAGS) $(LINKFLAGS) -L $(LIBDIR) $(EXTRAS) $< -o $@
28 $(SDCC) $(SDCCFLAGS) -c $< -o $@
30 $(PORT_CASES_DIR)/%$(OBJEXT): $(PORTS_DIR)/$(PORT)/%.c
31 $(SDCC) $(SDCCFLAGS) -c $< -o $@
33 $(PORT_CASES_DIR)/%$(OBJEXT): fwk/lib/%.c
34 $(SDCC) $(SDCCFLAGS) -c $< -o $@
36 # run simulator with 25 seconds timeout
37 %.out: %$(EXEEXT) $(CASES_DIR)/timeout
39 -$(CASES_DIR)/timeout 25 $(S51) -tds390f -S in=$(DEV_NULL),out=$@ $< < $(PORTS_DIR)/ds390/uCsim.cmd > $(@:.out=.sim) || \
40 echo -e --- FAIL: \"timeout, simulation killed\" in $(<:$(EXEEXT)=.c)"\n"--- Summary: 1/1/1: timeout >> $@
41 python $(srcdir)/get_ticks.py < $(@:.out=.sim) >> $@
42 -grep -n FAIL $@ /dev/null || true
44 $(CASES_DIR)/timeout: fwk/lib/timeout.c