aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorMiquel Sabaté Solà <mssola@mssola.com>2026-03-06 16:10:32 +0100
committerMiquel Sabaté Solà <mssola@mssola.com>2026-03-06 16:10:32 +0100
commit1efe10cf62ebf9f0749dd3329ea52f4c9ac2e96b (patch)
treeb63eceba50fcf9cbe5a16f320c70b162b3f2402b /Makefile
parentf3737201eda72e51730a0762be98598fee08d86b (diff)
downloadjetpac.nes-1efe10cf62ebf9f0749dd3329ea52f4c9ac2e96b.tar.gz
jetpac.nes-1efe10cf62ebf9f0749dd3329ea52f4c9ac2e96b.zip
Add the 'each' and 'release' make targets
The 'each' target is used to dump all the different combinations into my Everdrive so to test on real hardware. The 'release' target is used so the "DEV" version of the ROM does not make it into the releases page from Github. Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile31
1 files changed, 31 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 668dab8..84594b9 100644
--- a/Makefile
+++ b/Makefile
@@ -35,10 +35,17 @@ HAS_RUBY := $(shell command -v $(RUBY) >/dev/null 2>&1 && echo true || echo fals
##
# Variables for building the game.
LEVEL ?= 0
+LEVELS := $(shell seq 0 7)
+
+##
+# all: clean the workspace and build all ROM files.
.PHONY: all
all: clean deps build
+##
+# clean & deps: clean the workspace and check that all dependencies are met.
+
.PHONY: clean
clean:
@rm -rf out
@@ -51,6 +58,9 @@ clean:
deps:
@which $(CC65) >/dev/null 2>/dev/null || (echo "ERROR: '$(CC65)' not found." && false)
+##
+# Generate configuration values in 'config/values/'.
+
.PHONY: gen-values
gen-values:
ifeq ($(HAS_RUBY),true)
@@ -60,6 +70,10 @@ else
@(Q) echo "WARNING: '$(RUBY)' not found; files under 'config/values/' will not be generated."
endif
+##
+# build: create a ROM file for NTSC and PAL, while creating a DEV one for
+# testing purposes.
+
.PHONY: build
build: gen-values build-partial build-pal build-full
@@ -91,3 +105,20 @@ build-pal:
$(E) " CC jetpac (PAL)"
$(Q) $(CC65) $(CCOPTS) src/jetpac.s -C config/nrom.cfg -o "out/Jetpac (PAL).nes" 1>/dev/null
+
+##
+# release: generate ROM files which are only interesting for releases.
+
+release: clean deps gen-values build-full build-pal
+
+##
+# each: create a ROM file for each level.
+
+EACH_TARGETS := $(foreach i,$(LEVELS),out/jetpac.$(i).nes)
+
+.PHONY: each
+each: clean deps gen-values $(EACH_TARGETS)
+
+out/jetpac.%.nes:
+ $(Q) $(MAKE) build-full LEVEL=$*
+ $(Q) mv "out/Jetpac (NTSC).nes" "$@"