From a4d6d71612f38c8e164449971855fdde7976b3be Mon Sep 17 00:00:00 2001 From: "Juan J. Martinez" Date: Sun, 31 Oct 2021 11:21:49 +0000 Subject: SDCC versions and support for current snapshots --- README.md | 11 ++++++++++- config.env | 3 +++ game/src/Makefile | 2 +- src/spman/Makefile | 4 +++- tests/Makefile | 1 + 5 files changed, 18 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 86d7152..903184b 100644 --- a/README.md +++ b/README.md @@ -16,10 +16,19 @@ deep knowledge of the system. ## Requirements - - SDCC (3.9.0 or later recommended) - GNU Make (others may work) - a POSIX compatible environment +The [SDCC](http://sdcc.sourceforge.net/) compiler is also needed. Check the +following table for some hints on compatibility. + +| Version | Compatible | Comments | +| --- | --- | --- | +| 3.9.0 | yes | - | +| 4.0.0 | yes | - | +| 4.1.0 | no | At least on Linux amd64 it generates broken Z80 code | +| sdcc-20211031-12748 | yes | Needs option in `config.env`, edit the file for details | + If you want to build the example you will also need: - python 3 diff --git a/config.env b/config.env index 21ce6c9..d9b3bbd 100644 --- a/config.env +++ b/config.env @@ -2,3 +2,6 @@ # Size of the resulting ROM ROM_MAX=0x8000 + +# uncomment for sdcc-20211031-12748 or later +#EXTRA_CFLAGS += --sdcccall 0 diff --git a/game/src/Makefile b/game/src/Makefile index e42313d..52f01ea 100644 --- a/game/src/Makefile +++ b/game/src/Makefile @@ -14,7 +14,7 @@ LIBS := -lubox -lspman -lmplayer -lap CC := sdcc AS := sdasz80 AR := sdcclib -CFLAGS := -mz80 --Werror -I../../include -I../generated --fsigned-char --std-sdcc99 --opt-code-speed +CFLAGS := -mz80 --Werror -I../../include -I../generated --fsigned-char --std-sdcc99 --opt-code-speed $(EXTRA_CFLAGS) LDFLAGS := -L../../lib -L. --no-std-crt0 --fomit-frame-pointer all: $(OUTPUT)/$(TARGET).rom diff --git a/src/spman/Makefile b/src/spman/Makefile index 49b7de9..690e72f 100644 --- a/src/spman/Makefile +++ b/src/spman/Makefile @@ -1,9 +1,11 @@ LIB := ../../lib/spman.lib all: $(LIB) +include ../../config.env + CC := sdcc AR := sdar -CFLAGS := -mz80 --Werror -I../../include --fsigned-char --std-sdcc99 --opt-code-speed +CFLAGS := -mz80 --Werror -I../../include --fsigned-char --std-sdcc99 --opt-code-speed $(EXTRA_CFLAGS) SOURCES := $(wildcard *.c) OBJS := $(patsubst %.c,%.rel,$(SOURCES)) diff --git a/tests/Makefile b/tests/Makefile index 32933e0..bc972c0 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -7,6 +7,7 @@ include ../config.env TESTS := $(wildcard test_*.py) test: + @sdcc --version python3 -m unittest $(TESTS) .PHONY: test default -- cgit v1.2.3