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