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