-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathc.mk
executable file
·69 lines (66 loc) · 2.36 KB
/
c.mk
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
# clang
CXX := g++
LD := $(CXX)
# flags g++
ifeq ($(CXX), g++)
CXX_ALL_WARNINGS_FLAG := -Wall
# CXX_INFORMATIONAL_WARNINGS_FLAG := -wi
# CXX_WARNDEPRECATE_FLAG := -dw
CXX_IMPORTPATH_FLAG := -I
CXX_NOLINK_FLAG := -c
CXX_OUTPUTFILE_FLAG := -o
# CXX_SYMBOLICDEBUGINFO_FLAG := -g
# CXX_INLINE_FLAG := -inline
CXX_OPTIMIZE_FLAG := -O3
# CXX_NOBOUNDSCHECK_FLAG := -noboundscheck
CXX_UNITTEST_FLAG := -DTEST_RUN
CXX_RELEASE_FLAG := -DRELEASE
CXX_DEBUG_FLAG := -DDEBUG -ggdb
# CXX_VERSION_FLAG := -version=
# CXX_NOOBJECT_FLAG := -o-
# CXX_STATIC_LIBRARY_FLAG := -lib
# CXX_SHARED_LIBRARY_FLAG := -shared
# CXX_LINKER_FLAG := -L
# CXX_DOCFILE_FLAG := -Df
# CXX_FPIC_FLAG := -fPIC
CXX_GTEST_LIB := -pthread -lgtest
CXX_LINK_STDLIB :=
CXX_LINK_LIBMATH := -lm
CXX_STD_CPP11 := -std=c++11
CXX_ARCH_AMD64 := -D_AMD64_CPU
CXX_ARCH_X86 := -D_X86_CPU
endif
# flags clang
ifeq ($(CXX), clang)
CXX_ALL_WARNINGS_FLAG := -Weverything -Wno-c++98-compat
# CXX_INFORMATIONAL_WARNINGS_FLAG := -wi
# CXX_WARNDEPRECATE_FLAG := -dw
CXX_IMPORTPATH_FLAG := -I
CXX_NOLINK_FLAG := -c
CXX_OUTPUTFILE_FLAG := -o
# CXX_SYMBOLICDEBUGINFO_FLAG := -g
# CXX_INLINE_FLAG := -inline
CXX_OPTIMIZE_FLAG := -O3
# CXX_NOBOUNDSCHECK_FLAG := -noboundscheck
CXX_UNITTEST_FLAG := -DTEST_RUN
CXX_RELEASE_FLAG := -DRELEASE
CXX_DEBUG_FLAG := -DDEBUG
# CXX_VERSION_FLAG := -version=
# CXX_NOOBJECT_FLAG := -o-
# CXX_STATIC_LIBRARY_FLAG := -lib
# CXX_SHARED_LIBRARY_FLAG := -shared
# CXX_LINKER_FLAG := -L
# CXX_DOCFILE_FLAG := -Df
# CXX_FPIC_FLAG := -fPIC
CXX_GTEST_LIB := -pthread -lgtest
CXX_LINK_STDLIB := -lstdc++
CXX_LINK_LIBMATH := -lm
CXX_STD_CPP11 := -std=c++11
CXX_ARCH_AMD64 := -D_AMD64_CPU
CXX_ARCH_X86 := -D_X86_CPU
endif
# implicit rules
%.o: %.cpp
$(CXX) $(CXXFLAGS) $(CXX_NOLINK_FLAG) $^ $(CXX_OUTPUTFILE_FLAG)$@
%.html: %.cpp
$(CXX) $(CXXFLAGS) $(CXX_NOLINK_FLAG) $(CXX_NOOBJECT_FLAG) $^ $(CXX_DOCFILE_FLAG)$@