add mcs51-port
[fw/sdcc] / support / regression / ports / mcs51 / spec.mk
1 # Port specification for the mcs51 port running with uCsim
2
3 S51 = ../../sim/ucsim/s51.src/s51
4
5 SDCCFLAGS += --lesspedantic -DREENTRANT=reentrant -DGENERIC=_generic
6
7 OBJEXT = .rel
8 EXEEXT = .ihx
9
10 # Needs parts of gbdk-lib, namely the internal mul/div/mod functions.
11 EXTRAS = fwk/lib/testfwk$(OBJEXT) ports/$(PORT)/support$(OBJEXT)
12
13 # Rule to link into .ihx
14 %.ihx: %$(OBJEXT) $(EXTRAS)
15         $(SDCC) $(SDCCFLAGS) $(EXTRAS) $<
16         mv fwk/lib/testfwk.ihx $@
17         mv fwk/lib/testfwk.map $(@:.ihx=.map)
18
19 # %$(OBJEXT): %.asm
20 #       ../../bin/as-z80 -plosgff $@ $<
21
22 # %$(OBJEXT): %.s
23 #       ../../bin/as-z80 -plosgff $@ $<
24
25 %$(OBJEXT): %.c
26         $(SDCC) $(SDCCFLAGS) -c $<
27
28 # PENDING: Path to sdcc-extra
29 %.out: %$(EXEEXT)
30         mkdir -p `dirname $@`
31         $(S51) -t32 -S in=$(shell tty),out=$@ $< < ports/mcs51/uCsim.cmd >/dev/null 2>&1
32         -grep -n FAIL $@ /dev/null || true