aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorMiquel Sabaté Solà <msabate@suse.com>2023-12-21 00:02:51 +0100
committerMiquel Sabaté Solà <msabate@suse.com>2023-12-21 18:41:41 +0100
commit9e22faffffa20aa256a05468157404006e2e4d1e (patch)
tree04266bf24d93a5a11452c27c10dbca16e3a3a8d9 /Makefile
downloadlist.nes-9e22faffffa20aa256a05468157404006e2e4d1e.tar.gz
list.nes-9e22faffffa20aa256a05468157404006e2e4d1e.zip
Initial commit
Implemented the List scope which brings some handy macros and functions to manipulate big lists on the NES. Signed-off-by: Miquel Sabaté Solà <msabate@suse.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile43
1 files changed, 43 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..ef3cb0e
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,43 @@
+CA65 ?= ca65
+CC65 ?= cl65
+CCOPTS ?= --target nes
+ifeq "$(DEBUG)" "1"
+CCOPTS += -g -Ln tmp/labels.txt
+endif
+
+
+.PHONY: test
+test: prepare build example unit
+
+.PHONY: prepare
+prepare: clean deps
+
+.PHONY: clean
+clean:
+ @sed -i '/RUN_TESTS = 1/d' test/suite.s
+ @rm -rf tmp
+ @mkdir tmp
+ @find . -type f -name "*.o" -delete
+ @find . -type f -name "*.nes" -delete
+
+.PHONY: deps
+deps:
+ @which $(CC65) >/dev/null 2>/dev/null || (echo "ERROR: $(CC65) not found." && false)
+ @which fceux >/dev/null 2>/dev/null || (echo "ERROR: fceux not found." && false)
+
+.PHONY: build
+build: list.o
+
+%.o: %.s
+ $(CA65) $< -o $@
+
+test/%.nes: test/%.s
+ $(CC65) $(CCOPTS) $< -o $@
+
+.PHONY: unit
+unit:
+ @bash test/run.sh
+
+.PHONY: example
+example:
+ $(CC65) $(CCOPTS) examples/mul.s -o examples/mul.nes