1 # Regression test specification for the z80 target running on top of the Java based
2 # 'ConsoleZ80' emulator.
4 EMU
= $(SDCC_EXTRA_DIR
)/emu
/rrz80
/rrz80
$(EXEEXT
)
5 MAKEBIN
= $(top_builddir
)/bin
/makebin
$(EXEEXT
)
7 SDCCFLAGS
+= --nostdinc
-I
$(top_srcdir
)
8 LINKFLAGS
+= --nostdlib
-L
$(top_builddir
)/device
/lib
/build
/z80
10 SDCCFLAGS
+= -mz80
--less-pedantic
11 LINKFLAGS
+= --out-fmt-ihx z80.lib
16 # otherwise `make` deletes testfwk.rel and `make -j` will fail
17 .PRECIOUS
: $(PORT_CASES_DIR
)/%$(OBJEXT
)
19 # Needs parts of gbdk-lib, namely the internal mul/div/mod functions.
20 EXTRAS
= $(PORT_CASES_DIR
)/testfwk
$(OBJEXT
) $(PORT_CASES_DIR
)/support
$(OBJEXT
)
21 include $(srcdir)/fwk
/lib
/spec.mk
23 # Rule to generate a Emulator .bin file from the .ihx linker output.
25 $(MAKEBIN
) -s
32768 < $< > $@
27 # Rule to link into .ihx
28 %.ihx
: %$(OBJEXT
) $(EXTRAS
) $(FWKLIB
) $(PORT_CASES_DIR
)/fwk.lib
29 $(SDCC
) $(SDCCFLAGS
) $(LINKFLAGS
) $(EXTRAS
) $(PORT_CASES_DIR
)/fwk.lib
$< -o
$@
31 $(PORT_CASES_DIR
)/%$(OBJEXT
): $(PORTS_DIR
)/$(PORT
)/%.asm
32 @
# TODO: sdas should place it\'s output in the current dir
33 cp
$< $(PORT_CASES_DIR
)
34 $(top_builddir
)/bin
/sdasz80
-plosgff
$(PORT_CASES_DIR
)/$(notdir $<)
35 rm $(PORT_CASES_DIR
)/$(notdir $<)
38 $(top_builddir
)/bin
/sdasz80
-plosgff
$<
41 $(SDCC
) $(SDCCFLAGS
) -c
$< -o
$@
43 $(PORT_CASES_DIR
)/%$(OBJEXT
): $(srcdir)/fwk
/lib
/%.c
44 $(SDCC
) $(SDCCFLAGS
) -c
$< -o
$@
46 $(PORT_CASES_DIR
)/fwk.lib
: $(srcdir)/fwk
/lib
/fwk.lib
47 cat
< $(srcdir)/fwk
/lib
/fwk.lib
> $@
49 # PENDING: Path to sdcc-extra
52 $(EMU
) --maxruntime
=3 --mapfile
=$(<:.bin
=.sym
) $< > $@
53 -grep
-n FAIL
$@
/dev
/null || true