summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile20
1 files changed, 20 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..4beb6f1
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,20 @@
+TEST?=test/add.easm # you can use the enviornment variable TEST to specify what binary the "test" target will run
+BIN=${TEST:%.easm=%.bin}
+
+build/vm:
+ mkdir -p build
+ (cd vm && go build -o ../$@)
+
+build/as:
+ (cd as && go build -o ../$@)
+
+test: build/vm ${BIN}
+ ./build/vm ${BIN}
+
+clean:
+ rm -rf build test/*.bin
+
+%.bin: %.easm build/as
+ ./build/as $< -o $@
+
+.PHONY: test