From df763e6d73cb3e7afa5aa84fbc75aed6c87b3599 Mon Sep 17 00:00:00 2001 From: Miquel Sabaté Solà Date: Sun, 12 Oct 2025 22:37:39 +0200 Subject: Pick xa65 by default if that exists MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit And let it pass the --strict and --stats parameters to the underlying nasm command. Signed-off-by: Miquel Sabaté Solà --- .gitignore | 1 + CONTRIBUTING.md | 10 ++++------ Makefile | 18 +++++++++++++----- 3 files changed, 18 insertions(+), 11 deletions(-) diff --git a/.gitignore b/.gitignore index 51d8263..b1b1f83 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ out/ config/generated.s +.nasm/ TODO diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 215034b..133aa85 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -41,14 +41,12 @@ In order to test your changes, I'd go this way: You can pass the following arguments to `make`: -- `CC65`: the compiler to use (defaults to `cl65`). -- `CCOPTS`: the options to use for the compiler (defaults to `--target nes`). +- `CC65`: the compiler to use (defaults to + [xa65](https://github.com/mssola/tools.nes) if that exists, otherwise `cl65`). +- `CCOPTS`: the options to use for the compiler (defaults to `--target nes` and + it adds `--strict` if using `xa65`). - `RUBY`: the ruby to use (defaults to `ruby`). -Note that you can also set `DEBUG=1`, and with that you will pass sobre extra -debugging options, like telling `cl65` to also output a `out/labels.txt` file -with memory address on the symbols that have been evaluated. - ## Modifying assets I am using [NEXXT studio 3](https://frankengraphics.itch.io/nexxt) for managing 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, -- cgit v1.2.3