-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
65 lines (38 loc) · 1.38 KB
/
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
CXX = g++-10
sources = source.cpp lexing.cpp parsing.cpp ast.cpp typing.cpp runtime.cpp runtime_variables.cpp \
runtime_jitting.cpp runtime_modules.cpp basically.cpp
objects = $(sources:.cpp=.o)
headers = $(sources:.cpp=.h)
executable = basically
pch_src = basically.h
pch = $(pch_src).gch
libs = -lgccjit
CXXFLAGS = -std=c++20 -fdiagnostics-color=always -g -O0
.PHONY: all clean
all: $(executable)
clean:
rm -f $(objects) $(pch) $(executable)
$(executable): $(pch) $(objects)
$(CXX) $(CXXFLAGS) $(objects) $(libs) -o $(executable)
$(pch): $(headers)
$(CXX) $(CXXFLAGS) -x c++-header -c $(pch_src) -o $(pch)
source.o: source.cpp $(pch)
$(CXX) $(CXXFLAGS) -c $(*).cpp -o $(*).o
lexing.o: lexing.cpp $(pch)
$(CXX) $(CXXFLAGS) -c $(*).cpp -o $(*).o
parsing.o: parsing.cpp $(pch)
$(CXX) $(CXXFLAGS) -c $(*).cpp -o $(*).o
ast.o: ast.cpp $(pch)
$(CXX) $(CXXFLAGS) -c $(*).cpp -o $(*).o
typing.o: typing.cpp $(pch)
$(CXX) $(CXXFLAGS) -c $(*).cpp -o $(*).o
runtime.o: runtime.cpp $(pch)
$(CXX) $(CXXFLAGS) -c $(*).cpp -o $(*).o
runtime_variables.o: runtime_variables.cpp $(pch)
$(CXX) $(CXXFLAGS) -c $(*).cpp -o $(*).o
runtime_jitting.o: runtime_jitting.cpp $(pch)
$(CXX) $(CXXFLAGS) -c $(*).cpp -o $(*).o
runtime_modules.o: runtime_modules.cpp $(pch)
$(CXX) $(CXXFLAGS) -c $(*).cpp -o $(*).o
basically.o: basically.cpp $(pch)
$(CXX) $(CXXFLAGS) -c $(*).cpp -o $(*).o