diff options
| -rw-r--r-- | .github/workflows/build.yml | 2 | ||||
| -rw-r--r-- | Makefile | 31 |
2 files changed, 32 insertions, 1 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 44c9761..5304de0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -32,7 +32,7 @@ jobs: rubocop bin/ --format github - name: Main task - run: V=1 make all + run: V=1 make release - name: Clean old release assets run: gh release delete latest --yes --cleanup-tag || true @@ -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" "$@" |
