aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile30
1 files changed, 30 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..fee742d
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,30 @@
+BIN:=fib_eqI_b fib_ltI nfib
+OPTLL:=$(addsuffix .opt.ll,$(BIN))
+OBJ:=$(addsuffix .o,$(BIN))
+ASM:=$(addsuffix .s,$(BIN))
+BC:=$(addsuffix .bc,$(BIN))
+
+all: $(BIN)
+
+$(BIN): %: %.o
+ clang-11 $^ -o $@
+
+$(OBJ): %.o: %.bc
+ llc-11 -filetype=obj $^ -o $@
+
+$(ASM): %.s: %.bc
+ llc-11 $^ -o $@
+
+$(BC): %.bc: %.opt.ll
+ llvm-as-11 $^ -o $@
+
+$(OPTLL): %.opt.ll: %.ll
+ opt-11 -S -always-inline $^ -o $@
+ opt-11 -S -instcombine $@ -o $@
+ opt-11 -S -O3 $@ -o $@
+ opt-11 -S -O3 $@ -o $@
+
+clean:
+ $(RM) $(BIN) $(OBJ) $(ASM) $(BC)
+
+.PHONY: all clean