forked from facebookarchive/facebook-clang-plugins
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.common
41 lines (33 loc) · 1.55 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
# Copyright (c) 2014, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
include $(LEVEL)/Makefile.config
# Typical compilation flags for Objective C examples
ifneq "$(SDKPATH)" ""
IOSFLAGS=-arch i386 -fmessage-length=0 -fpascal-strings -isysroot $(SDKPATH) -fexceptions -fasm-blocks -fstrict-aliasing -g -fobjc-abi-version=2 -mios-simulator-version-min=5.0 -Wno-objc-property-synthesis -Werror
endif
# we assume that the targeted clang was configured with --enable-libcpp --enable-cxx11
CFLAGS?=-stdlib=libc++ -std=c++11
LDFLAGS?=-stdlib=libc++
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
LDFLAGS+=-Wl,-rpath -Wl,@executable_path/../lib -Wl,-undefined,dynamic_lookup -Wl,-flat_namespace -Wl,-undefined,suppress -dynamiclib
ifdef DEBUG
CFLAGS+=-DDEBUG -g
export VERBOSE:=1
SHELL=bash -O nullglob
else
CFLAGS+=-O3 -DNDEBUG
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
# Local Variables:
# mode: makefile
# End: