-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
37 lines (27 loc) · 854 Bytes
/
Makefile
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
FLAG_INCLUDE := -I ./include
FLAG_CPP := -std=gnu++17
FLAG_DEBUG := -fsanitize=address -static-libasan -g
COMMON_FILES := $(wildcard *.cpp ./common/*)
LLVM_FLAGS := `llvm-config --cxxflags --ldflags --system-libs --libs core`
FLAGS := $(COMMON_FILES) $(FLAG_INCLUDE) $(FLAG_CPP)
#MAIN_FILE := ./learn_llvm/c_global_show.cpp
#MAIN_FILE := ./learn_llvm/c_fun_if_else.cpp
#MAIN_FILE := ./src/test_lexer.cpp
MAIN_FILE := ./src/auto.cpp
all: a.out run compile
time ./code
a.out: $(MAIN_FILE)
g++ $< $(FLAGS)
debug: $(MAIN_FILE)
g++ $< $(FLAGS) $(FLAG_DEBUG)
gdb ./a.out -tui -x gdb.txt
.PHONY: clean run compile
clean:
rm -f ./a.out code.ll code.s code log.txt
run: a.out
./a.out testcode4.in rules.in code.ll <grammar.in >log.txt
# ./a.out 1.in rules.in <grammar2.in >log.txt
compile:
# lli code.ll
llc code.ll
gcc code.s -o code