summaryrefslogtreecommitdiff
path: root/6502/Makefile
diff options
context:
space:
mode:
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)