-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
100 lines (77 loc) · 2.41 KB
/
Makefile
File metadata and controls
100 lines (77 loc) · 2.41 KB
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
#
# Cross Platform Makefile
# Compatible with MSYS2/MINGW, Ubuntu 14.04.1 and Mac OS X
#
# You will need GLFW (http://www.glfw.org):
# Linux:
# apt-get install libglfw-dev
# Mac OS X:
# brew install glfw
# MSYS2:
# pacman -S --noconfirm --needed mingw-w64-x86_64-toolchain mingw-w64-x86_64-glfw
#
#CXX = g++-8 -std=c++17
CXX = clang++-8
EXE = CallGraph
SOURCES = src/main.cpp libs/text_editor/TextEditor.cpp src/graph.cpp src/clang_interface.cpp src/gui.cpp
SOURCES += libs/imgui/glfw_opengl3/imgui_impl_glfw.cpp libs/imgui/glfw_opengl3/imgui_impl_opengl3.cpp
SOURCES += libs/imgui/imgui.cpp libs/imgui/imgui_draw.cpp libs/imgui/imgui_widgets.cpp
OBJS = $(addsuffix .o, $(basename $(notdir $(SOURCES))))
UNAME_S := $(shell uname -s)
LLVMCOMPONENTS := cppbackend
RTTIFLAG := -fno-rtti
LLVMCONFIG := /usr/bin/llvm-config-8
INCLUDE = -Ilibs/imgui/glfw_opengl3/
INCLUDE += -Ilibs/imgui/
INCLUDE += -I$(shell $(LLVMCONFIG) --src-root)/tools/clang/include
INCLUDE += -I$(shell $(LLVMCONFIG) --obj-root)/tools/clang/include
INCLUDE += -Ilibs/text_editor/
INCLUDE += -Ilibs/imgui/misc/cpp/
CXXFLAGS = $(shell $(LLVMCONFIG) --cxxflags) $(RTTIFLAG) -std=c++17 -g -Wall -Wformat
CFLAGS = -std=c99
LIBS = \
-lclangTooling\
-lclangFrontendTool\
-lclangFrontend\
-lclangDriver\
-lclangSerialization\
-lclangParse\
-lclangSema\
-lclangStaticAnalyzerFrontend\
-lclangStaticAnalyzerCheckers\
-lclangStaticAnalyzerCore\
-lclangAnalysis\
-lclangEdit\
-lclangAST\
-lclangLex\
-lclangBasic\
-lclangAST\
-lclangASTMatchers\
$(shell $(LLVMCONFIG) --libs)\
$(shell $(LLVMCONFIG) --system-libs)\
-lcurses\
-lstdc++fs\
-lGLEW\
-lGL\
`pkg-config --static --libs glfw3`\
CXXFLAGS += -DIMGUI_IMPL_OPENGL_LOADER_GLEW
CXXFLAGS += `pkg-config --cflags glfw3`
##---------------------------------------------------------------------
## BUILD RULES
##---------------------------------------------------------------------
%.o:src/%.cpp
$(CXX) $(INCLUDE) $(LLVMDFLAGS) $(CXXFLAGS) -c -o $@ $<
%.o:libs/imgui/glfw_opengl3/%.cpp
$(CXX) $(INCLUDE) $(CXXFLAGS) -c -o $@ $<
%.o:libs/imgui/%.cpp
$(CXX) $(INCLUDE) $(CXXFLAGS) -c -o $@ $<
%.o:libs/text_editor/%.cpp
$(CXX) $(INCLUDE) $(CXXFLAGS) -c -o $@ $<
all: $(EXE)
@echo Build complete for $(ECHO_MESSAGE)
$(EXE): $(OBJS)
$(CXX) -o $@ $^ $(CXXFLAGS) $(LIBS)
.PRECIOUS: %.o Makefile
.PHONY: clean
clean:
rm -f $(OBJS) $(EXE)