Imported Upstream version 2.9.0
[debian/cc1111] / support / regression / ports / host / spec.mk
1 # Port specification for compiling on the host machines version of gcc
2 SDCC = $(shell ( sh -c "gcc --version" 2>&1 ) > /dev/null  && echo gcc || echo cc)
3 SDCCFLAGS = $(CPPFLAGS) -DPORT_HOST=1 -fsigned-char -fpack-struct -DREENTRANT= -I$(top_builddir) -I$(top_srcdir)
4 # disable all warnings:
5 SDCCFLAGS+= -w
6 # enable all warnings:
7 #SDCCFLAGS+= -Wall
8
9 EXEEXT = .bin
10 OBJEXT = .o
11 INC_DIR = .
12
13 # otherwise `make` deletes testfwk.o and `make -j` will fail
14 .PRECIOUS: $(PORT_CASES_DIR)/%$(OBJEXT)
15
16 # Required extras
17 EXTRAS = $(PORT_CASES_DIR)/testfwk$(OBJEXT) $(PORT_CASES_DIR)/support$(OBJEXT)
18
19 %.out: %$(EXEEXT)
20         mkdir -p $(dir $@)
21         -$< > $@
22         -grep -n FAIL $@ /dev/null || true
23
24 %$(EXEEXT): %$(OBJEXT) $(EXTRAS)
25         $(SDCC) $(SDCCFLAGS) -o $@ $< $(EXTRAS) -lm
26
27 %$(OBJEXT): %.c
28         $(SDCC) $(SDCCFLAGS) -c $< -o $@
29
30 $(PORT_CASES_DIR)/%$(OBJEXT): $(PORTS_DIR)/$(PORT)/%.c
31         $(SDCC) $(SDCCFLAGS) -c $< -o $@
32
33 $(PORT_CASES_DIR)/%$(OBJEXT): fwk/lib/%.c
34         $(SDCC) $(SDCCFLAGS) -c $< -o $@
35
36 _clean: