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