summaryrefslogtreecommitdiff
path: root/6502/Makefile
diff options
context:
space:
mode:
authorLLLL Colonq <llll@colonq>2026-07-10 05:19:06 -0400
committerLLLL Colonq <llll@colonq>2026-07-10 05:19:06 -0400
commit9ba3ccd51d94e2db6920351eccb9050d1a2c41e1 (patch)
tree95d4eb6d18147fea2890aac74f3001a9db1f8c7b /6502/Makefile
parent6f9276b24b371758bf9dbe87110843b6d6dc6f8e (diff)
6502: Lua bindings for testing
Diffstat (limited to '6502/Makefile')
-rw-r--r--6502/Makefile10
1 files changed, 9 insertions, 1 deletions
diff --git a/6502/Makefile b/6502/Makefile
index c8119f3..db70fa8 100644
--- a/6502/Makefile
+++ b/6502/Makefile
@@ -11,6 +11,7 @@ CHK_SOURCES ?= $(SRCS)
OBJECTS := $(SRCS:src/%.c=$(BUILD)/%.o)
EXE ?= 6502
LIB := libcolonq-6502.a
+TEST := l6502-lua.so
prefix ?= /usr/local
exec_prefix ?= $(prefix)
@@ -18,7 +19,7 @@ bindir ?= $(exec_prefix)/bin
includedir ?= $(prefix)/include
libdir ?= $(exec_prefix)/lib
-.PHONY: all clean install install-bin install-headers install-lib check-syntax
+.PHONY: all test clean install install-bin install-headers install-lib check-syntax
all: $(EXE) $(LIB)
@@ -28,6 +29,12 @@ $(EXE): $(BUILD)/main.o $(LIB)
$(LIB): $(OBJECTS)
$(AR) rcs $@ $^
+test: $(TEST)
+ @make --no-print-directory -C test
+
+$(TEST): $(BUILD)/test.o $(LIB)
+ $(CC) -o $@ $^ -g -llua -fPIC -shared
+
$(BUILD):
mkdir $(BUILD)/
@@ -37,6 +44,7 @@ $(BUILD)/%.o: src/%.c | $(BUILD)
clean:
-rm $(EXE)
-rm $(LIB)
+ -rm $(TEST)
-rm -r $(BUILD)/
TAGS: $(SRCS)