aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorMiquel Sabaté Solà <mssola@mssola.com>2025-10-12 22:37:39 +0200
committerMiquel Sabaté Solà <mssola@mssola.com>2025-10-12 22:37:39 +0200
commitdf763e6d73cb3e7afa5aa84fbc75aed6c87b3599 (patch)
tree95f30224d5093293df57f8cbe50a94f154b93b2e /Makefile
parent638dfdca6e773d4b1ec573606cac90bdb1778667 (diff)
downloadjetpac.nes-df763e6d73cb3e7afa5aa84fbc75aed6c87b3599.tar.gz
jetpac.nes-df763e6d73cb3e7afa5aa84fbc75aed6c87b3599.zip
Pick xa65 by default if that exists
And let it pass the --strict and --stats parameters to the underlying nasm command. Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile18
1 files changed, 13 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index 91bd0dd..b840d78 100644
--- a/Makefile
+++ b/Makefile
@@ -7,13 +7,21 @@ else
Q =
endif
+# CC65 is set to `xa65` if that exists, otherwise we resort to `cl65` by default.
+XA65_BIN := $(shell command -v xa65 2>/dev/null)
+ifneq ($(XA65_BIN),)
+ CC65 ?= xa65
+else
+ CC65 ?= cl65
+endif
+
# NOTE: you can configure `CC65` and `CCOPTS` with the compiler and its options
-# that you might require. Moreover, if you pass `DEBUG` to `make`, then an
-# `out/labels.txt` file will be generated.
-CC65 ?= cl65
+# that you might require.
CCOPTS ?= --target nes
-ifeq "$(DEBUG)" "1"
-CCOPTS += -g -Ln out/labels.txt
+
+# Be strict and more verbose when using xa65.
+ifeq ($(CC65),xa65)
+ CCOPTS += --strict --stats
endif
# Ruby is used to generate the files on `config/values/`. If it can't be found,