llvm-device-build.mk revision 7817934515cdec7157a853376b2a5f83fae687fc
1LOCAL_CFLAGS :=	\
2	-D_GNU_SOURCE	\
3	-O2	\
4	-fomit-frame-pointer	\
5	-Wall	\
6	-W	\
7	-Wno-unused-parameter	\
8	-Wwrite-strings	\
9	$(LOCAL_CFLAGS)
10
11ifneq ($(HOST_OS),darwin)
12LOCAL_CFLAGS +=	\
13	-D__STDC_LIMIT_MACROS	\
14	-D__STDC_CONSTANT_MACROS	\
15	-D__STDC_FORMAT_MACROS
16endif
17
18# The three inline options together reduce libbcc.so almost 1MB.
19# We move them from global build/core/combo/TARGET_linux-arm.mk
20# to here.
21LOCAL_CFLAGS := -DANDROID_TARGET_BUILD \
22		-finline-limit=64 \
23		-finline-functions \
24		-fno-inline-functions-called-once \
25		$(LOCAL_CFLAGS)
26
27ifeq ($(TARGET_BUILD_VARIANT),eng)
28LOCAL_CFLAGS := -DANDROID_ENGINEERING_BUILD \
29                $(LOCAL_CFLAGS)
30endif
31
32ifeq ($(LLVM_ENABLE_ASSERTION),true)
33LOCAL_CFLAGS :=	\
34	$(LOCAL_CFLAGS) \
35	-D_DEBUG	\
36	-UNDEBUG
37endif
38
39ifneq ($(REQUIRES_EH),1)
40LOCAL_CFLAGS +=	-fno-exceptions
41else
42# No action. The device target should not have exception enabled since bionic
43# doesn't support it
44REQUIRES_EH := 0
45endif
46
47ifneq ($(REQUIRES_RTTI),1)
48LOCAL_CPPFLAGS +=	-fno-rtti
49else
50REQUIRES_RTTI := 0
51endif
52
53LOCAL_CPPFLAGS :=	\
54	$(LOCAL_CPPFLAGS)	\
55	-Woverloaded-virtual	\
56	-Wno-sign-promo
57
58# Make sure bionic is first so we can include system headers.
59LOCAL_C_INCLUDES :=	\
60	bionic \
61	external/stlport/stlport \
62	$(LLVM_ROOT_PATH)	\
63	$(LLVM_ROOT_PATH)/include	\
64	$(LLVM_ROOT_PATH)/device/include	\
65	$(LOCAL_C_INCLUDES)
66
67###########################################################
68## Commands for running tblgen to compile a td file
69###########################################################
70define transform-device-td-to-out
71@mkdir -p $(dir $@)
72@echo "Device TableGen (gen-$(1)): $(TBLGEN_LOCAL_MODULE) <= $<"
73$(hide) $(TBLGEN) \
74	-I $(dir $<)	\
75	-I $(LLVM_ROOT_PATH)/include	\
76	-I $(LLVM_ROOT_PATH)/device/include	\
77	-I $(LLVM_ROOT_PATH)/lib/Target	\
78    -gen-$(strip $(1)) \
79    -o $@ $<
80endef
81