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