-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
68 lines (44 loc) · 1.47 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
66
67
# project directory
ROOT = $(CURDIR)
BUILD_ROOT = $(ROOT)/build
# CXX common settings and flags
CXX_FILE_SUFFIX = .cpp
CXX_HEADER_SUFFIX = .h
CXX = c++
CXXSTD = -std=c++1y
# preprocessor flags
CPPFLAGS = -U__STRICT_ANSI__
# compiler flags
IFLAGS = -iquote $(ROOT)/src/include -iquote $(ROOT)/src/fd/include
CXXFLAGS = $(CXXSTD) -Wall -Wpedantic -O2 -g -pipe $(IFLAGS)
# linker flags
LDFLAGS =
# static linking
# use LDSTATIC variable to specify static linking options, e.g.:
# LDSTATIC = -static
# or
# make LDSTATIC="-static -static-libgcc -static-libstdc++" <goal>
# or define the target-specific assignment for appropriate goals in local makefiles
# <goal>: LDSTATIC = -static
# linking a shared library
# use makefile.generic/link.rules and define the target-specific assignment
# to CXXFLAGS, LDFLAGS, and LDOUT for appropriate goals in local makefiles, e.g.
# <goal>: CXXFLAGS += -fPIC
# <goal>: LDFLAGS += -shared
# <goal>: LDOUT = [email protected]
# alternatively, use makefile.generic/link-so.rules which basically do the above but leaving aside CXXFLAGS
# also when makefile.generic/link-so.rules is used
# if SONAME_VERSION is nonempty LDFLAGS is added with -Wl,-soname=$(notdir $(LDOUT)).$(SONAME_VERSION)
# if SOFILE_VERSION is nonempty linker output is $(LDOUT).$(SOFILE_VERSION)
# AR common settings and flags
AR = ar
ARFLAGS = rvus
export
# no default goal
.DEFAULT_GOAL = $@
# project goals
%: lib/% test/% ;
lib/%:
$(MAKE) -C lib $*
test/%:
$(MAKE) -C test $*