Imported Upstream version 2.9.0
[debian/cc1111] / support / regression / ports / z80 / spec.mk
1 # Port specification for the z80 port running ontop of the Java based
2 # 'ConsoleZ80' emulator.
3
4 RRZ80 = $(SDCC_EXTRA_DIR)/emu/rrz80/rrz80
5
6 SDCCFLAGS +=-mz80 --nostdinc --less-pedantic --profile -DREENTRANT= -I$(top_srcdir)
7 LINKFLAGS = --nostdlib
8 LINKFLAGS += z80.lib
9 LIBDIR = $(top_builddir)/device/lib/build/z80
10
11 EXEEXT = .bin
12
13 # Needs parts of gbdk-lib, namely the internal mul/div/mod functions.
14 EXTRAS = $(PORT_CASES_DIR)/testfwk$(OBJEXT) $(PORT_CASES_DIR)/support$(OBJEXT)
15
16 # Rule to generate a Emulator .bin file from the .ihx linker output.
17 %$(EXEEXT): %.ihx
18         $(top_builddir)/bin/makebin -s 32768 < $< > $@
19
20 # Rule to link into .ihx
21 %.ihx: %.c $(EXTRAS)
22         $(SDCC) $(SDCCFLAGS) $(LINKFLAGS) -L$(LIBDIR) $(EXTRAS) $< -o $@
23
24 $(PORT_CASES_DIR)/%$(OBJEXT): $(PORTS_DIR)/$(PORT)/%.asm
25         $(top_builddir)/bin/as-z80 -plosgff $@ $<
26
27 %$(OBJEXT): %.s
28         $(top_builddir)/bin/as-z80 -plosgff $@ $<
29
30 %$(OBJEXT): %.c
31         $(SDCC) $(SDCCFLAGS) -c $< -o $@
32
33 $(PORT_CASES_DIR)/%$(OBJEXT): fwk/lib/%.c
34         $(SDCC) $(SDCCFLAGS) -c $< -o $@
35
36 # PENDING: Path to sdcc-extra
37 %.out: %$(EXEEXT)
38         mkdir -p $(dir $@)
39         $(RRZ80) --maxruntime=3 --mapfile=$(<:.bin=.sym) $< > $@
40         -grep -n FAIL $@ /dev/null || true
41
42 _clean: