aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuan J. Martínez <jjm@usebox.net>2021-10-31 11:29:21 +0000
committerJuan J. Martínez <jjm@usebox.net>2021-10-31 11:29:21 +0000
commit7f2b1401be7f60e3e6ed3064bafd2a7859af9e0d (patch)
treedc6ac238776915844c70de4400472e079fadf771
parent61e8f78ee6b2c9495ff9b20c57c44ed5e4b5f891 (diff)
parenta4d6d71612f38c8e164449971855fdde7976b3be (diff)
downloadubox-msx-lib-7f2b1401be7f60e3e6ed3064bafd2a7859af9e0d.tar.gz
ubox-msx-lib-7f2b1401be7f60e3e6ed3064bafd2a7859af9e0d.zip
Merge branch 'sdcc-versions' into 'master'
SDCC versions and support for current snapshots See merge request reidrac/ubox-msx-lib!17
-rw-r--r--README.md11
-rw-r--r--config.env3
-rw-r--r--game/src/Makefile2
-rw-r--r--src/spman/Makefile4
-rw-r--r--tests/Makefile1
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