diff --git a/.gitignore b/.gitignore index cd56a54..eb3b4ec 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ *.o *.prg *.bin +bin diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..3ffd1fd --- /dev/null +++ b/.gitmodules @@ -0,0 +1,6 @@ +[submodule "cc65"] + path = cc65 + url = https://github.com/cc65/cc65 +[submodule "exomizer"] + path = exomizer + url = https://github.com/bitshifters/exomizer diff --git a/Makefile b/Makefile index 740dc2e..8aa79a4 100755 --- a/Makefile +++ b/Makefile @@ -1,3 +1,5 @@ +export PATH:= $(abspath bin):$(PATH) + .PHONY: all all: 80columns-compressed.prg 80c2-compressed.prg 80c3-compressed.prg 80c4-compressed.prg all: charset.prg charset2.prg charset3.prg charset4.prg @@ -58,3 +60,30 @@ update-font-images: charset.bin charset2.bin charset3.bin charset4.bin mkfontimg .PHONY: clean clean: rm -f *.prg *.bin *.o 80columns.d64 + +.PHONY: toolchain +toolchain: toolchain-cc65 toolchain-exomizer + +.PHONY: toolchain-cc65 +toolchain-cc65: + [ -d cc65/src ] || git submodule update --init cc65 + + $(MAKE) -C cc65 CC=cc bin + + mkdir -p bin + + cp cc65/bin/ca65 bin/ + cp cc65/bin/ld65 bin/ + +.PHONY: toolchain-exomizer +toolchain-exomizer: + [ -d exomizer/exomizer2/src ] || git submodule update --init exomizer + + $(MAKE) -C exomizer/exomizer2/src CFLAGS="-Wall -Wstrict-prototypes -pedantic -O3" + + mkdir -p bin + + cp exomizer/exomizer2/src/exomizer bin/ + + # have to do this, or git will report untracked files + (cd exomizer && git clean -dxf) diff --git a/README.md b/README.md index a6fc410..8b56195 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,10 @@ The code is based on 80COLUMNS.PRG by an unknown author. It has been reverse-eng ## Building -Building requires a UNIX environment and [cc65](https://github.com/cc65/cc65) and [exomizer](https://github.com/bitshifters/exomizer). Running `make` will produce `80columns-compressed.prg`, which is about 2.2 KB in size and can be started using `LOAD`/`RUN`. +Building requires a UNIX environment and [cc65](https://github.com/cc65/cc65) and [exomizer](https://github.com/bitshifters/exomizer). +Running `make toolchain` will download and build cc65 and exomizer, assuming that you have a basic C development environment available. +(If your system has packages of cc65 or exomizer, it is probably better to use those, e.g., with `brew install cc65 exomizer` on MacOS) +Running `make` will produce `80columns-compressed.prg`, which is about 2.2 KB in size and can be started using `LOAD`/`RUN`. ## Features diff --git a/cc65 b/cc65 new file mode 160000 index 0000000..6de78c5 --- /dev/null +++ b/cc65 @@ -0,0 +1 @@ +Subproject commit 6de78c536f78bc47129a7d4da4ad10f7e3a27b8f diff --git a/exomizer b/exomizer new file mode 160000 index 0000000..2426d97 --- /dev/null +++ b/exomizer @@ -0,0 +1 @@ +Subproject commit 2426d97207c8dff23cd2a94cc768c8be87a7b5d0