This repository has been archived by the owner on May 21, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 85
/
Copy pathMakefile.common
66 lines (54 loc) · 1.96 KB
/
Makefile.common
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
# Copyright (c) 2014-present, Facebook, Inc.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
include $(LEVEL)/Makefile.config
# Typical compilation flags for Objective C examples
ifeq ($(HAS_OBJC),yes)
IOSFLAGS=-isysroot $(SDKPATH) -mios-simulator-version-min=8.2 -target x86_64-apple-darwin14 -fobjc-arc \
-Wno-unused-command-line-argument \
-Wno-objc-property-implementation
endif
# we assume that the targeted clang was configured with --enable-libcpp --enable-cxx14
CFLAGS_Darwin+=-stdlib=libc++ -std=c++14
LDFLAGS_Darwin+=-stdlib=libc++
CFLAGS_Linux+=-std=c++14 -fPIC
LDFLAGS_Linux+=
override CFLAGS+=$(CFLAGS_$(shell uname)) -g
override LDFLAGS+=$(LDFLAGS_$(shell uname))
override CFLAGS+=$(CLANG_INCLUDES:%=-I%) -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -fvisibility-inlines-hidden -fno-exceptions -fno-rtti -fno-common -Woverloaded-virtual -Wcast-qual -fno-strict-aliasing -pedantic -Wno-long-long -Wall -W -Wno-unused-parameter -Wwrite-strings -Wno-uninitialized -Wno-missing-field-initializers -Wno-vla-extension -Wno-c99-extensions
ifdef DEBUG
override CFLAGS+=-DDEBUG
export VERBOSE:=1
SHELL=bash -O nullglob
else
override CFLAGS+=-O3 -DNDEBUG
override LDFLAGS+=-O3
# early exit when tests fail
SHELL=bash -e -O nullglob
endif
# project headers (if any)
HEADERS?=
# test runner
RUNTEST=$(LEVEL)/scripts/run_test.sh
LDFLAGS_DYLIB=$(LDFLAGS)
LDFLAGS_DYLIB+=-Wl,-rpath -Wl,@executable_path/../lib -Wl,-undefined,dynamic_lookup -Wl,-flat_namespace -Wl,-undefined,suppress -dynamiclib -shared
CLANG_TOOL_LIBS := \
-lclangFrontend \
-lclangIndex \
-lclangSerialization \
-lclangDriver \
-lclangTooling \
-lclangCodeGen \
-lclangParse \
-lclangSema \
-lclangAnalysis \
-lclangRewriteFrontend \
-lclangRewrite \
-lclangEdit \
-lclangAST \
-lclangLex \
-lclangBasic
# Local Variables:
# mode: makefile
# End: