Imported Upstream version 2.9.0
[debian/cc1111] / support / regression / ports / ds390 / spec.mk
1 # Regression test specification for the ds390 target running with uCsim
2
3 ifndef DEV_NULL
4   DEV_NULL = /dev/null
5 endif
6
7 # path to uCsim
8 ifdef SDCC_BIN_PATH
9   S51 = $(SDCC_BIN_PATH)/s51
10 else
11   S51A = $(top_builddir)/sim/ucsim/s51.src/s51
12   S51B = $(top_builddir)/bin/s51
13
14   S51 = $(shell if [ -f $(S51A) ]; then echo $(S51A); else echo $(S51B); fi)
15
16   SDCCFLAGS += --nostdinc -I$(top_srcdir)
17   LINKFLAGS += --nostdlib -L$(top_builddir)/device/lib/build/ds390 
18 endif
19
20 SDCCFLAGS +=-mds390 --less-pedantic -DREENTRANT=reentrant -Wl-r
21 LINKFLAGS += libds390.lib libsdcc.lib liblong.lib libint.lib libfloat.lib
22
23 OBJEXT = .rel
24 EXEEXT = .ihx
25
26 EXTRAS = $(PORT_CASES_DIR)/testfwk$(OBJEXT) $(PORT_CASES_DIR)/support$(OBJEXT)
27
28 # Rule to link into .ihx
29 %$(EXEEXT): %$(OBJEXT) $(EXTRAS)
30         $(SDCC) $(SDCCFLAGS) $(LINKFLAGS) $(EXTRAS) $< -o $@
31
32 %$(OBJEXT): %.c
33         $(SDCC) $(SDCCFLAGS) -c $< -o $@
34
35 $(PORT_CASES_DIR)/%$(OBJEXT): $(PORTS_DIR)/$(PORT)/%.c
36         $(SDCC) $(SDCCFLAGS) -c $< -o $@
37
38 $(PORT_CASES_DIR)/%$(OBJEXT): fwk/lib/%.c
39         $(SDCC) $(SDCCFLAGS) -c $< -o $@
40
41 # run simulator with 25 seconds timeout
42 %.out: %$(EXEEXT) $(CASES_DIR)/timeout
43         mkdir -p $(dir $@)
44         -$(CASES_DIR)/timeout 25 $(S51) -tds390f -S in=$(DEV_NULL),out=$@ $< < $(PORTS_DIR)/ds390/uCsim.cmd > $(@:.out=.sim) || \
45           echo -e --- FAIL: \"timeout, simulation killed\" in $(<:$(EXEEXT)=.c)"\n"--- Summary: 1/1/1: timeout >> $@
46         python $(srcdir)/get_ticks.py < $(@:.out=.sim) >> $@
47         -grep -n FAIL $@ /dev/null || true
48
49 $(CASES_DIR)/timeout: fwk/lib/timeout.c
50         $(CC) $(CFLAGS) $< -o $@
51
52 _clean: