blob: 6dd389429fd0daa90a9f3e42f24103ed974eb64f (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
BIN:=fib_eqI_b fib_ltI nfib nfib_nsa
OPTLL:=$(addsuffix .opt.ll,$(BIN))
OBJ:=$(addsuffix .o,$(BIN))
ASM:=$(addsuffix .s,$(BIN))
BC:=$(addsuffix .bc,$(BIN))
DEPS:=rts.ll
OPT:=opt-11
AS:=llvm-as-11
LLC:=~/projects/llvm-project/build/bin/llc
CLANG:=clang-11
all: $(BIN)
$(BIN): %: %.o
$(CLANG) $^ -o $@
$(OBJ): %.o: %.bc
$(LLC) -relocation-model=static -filetype=obj $^ -o $@
$(ASM): %.s: %.bc
$(LLC) -relocation-model=static $^ -o $@
$(BC): %.bc: %.opt.ll
$(AS) $^ -o $@
$(OPTLL): %.opt.ll: $(DEPS) %.ll
cat $^ \
| $(OPT) -S -always-inline \
| $(OPT) -S -O3 \
| sed 's/noinline nounwind optnone/nounwind/' \
| $(OPT) -S -O3 \
-o $@
clean:
$(RM) $(BIN) $(OBJ) $(ASM) $(BC)
.PHONY: all clean
|