summaryrefslogtreecommitdiffstats
path: root/bytecode/Makefile
diff options
context:
space:
mode:
authorRose Hogenson <rhogenson@posteo.net>2023-02-11 09:41:54 -0800
committerRose Hogenson <rhogenson@posteo.net>2023-02-11 09:41:54 -0800
commit4c3b2fec322feb8afd23703866d81f1dda51b6ae (patch)
treecae4d14c66f639c13198a4bfafc9425cb8aa70bf /bytecode/Makefile
parentddb69212f03a82e980144594d809a072b50e7f19 (diff)
downloadsml-4c3b2fec322feb8afd23703866d81f1dda51b6ae.tar.zst
Add a bytecode interpreter.
I wrote it in C because I actually like programming in C. Turns out setting up a Makefile is really easy too.
Diffstat (limited to 'bytecode/Makefile')
-rw-r--r--bytecode/Makefile17
1 files changed, 17 insertions, 0 deletions
diff --git a/bytecode/Makefile b/bytecode/Makefile
new file mode 100644
index 0000000..2e23fba
--- /dev/null
+++ b/bytecode/Makefile
@@ -0,0 +1,17 @@
+CFLAGS = -std=c11 -Wall -Wextra -Wpedantic -Werror -O3
+
+sources = $(wildcard *.c)
+
+default: bytecode
+
+bytecode: $(sources:.c=.o)
+
+%.d: %.c
+ $(CC) -MM $< > $@.$$$$ && \
+ sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@ && \
+ rm $@.$$$$
+
+include $(sources:.c=.d)
+
+clean:
+ rm *.o *.d bytecode