1LOCAL_CFLAGS := \ 2 -D_GNU_SOURCE \ 3 -D__STDC_LIMIT_MACROS \ 4 -D__STDC_CONSTANT_MACROS \ 5 -D__STDC_FORMAT_MACROS \ 6 -O2 \ 7 -fomit-frame-pointer \ 8 -Wall \ 9 -W \ 10 -Wno-unused-parameter \ 11 -Wwrite-strings \ 12 $(LOCAL_CFLAGS) 13 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) 22 23ifeq ($(TARGET_BUILD_VARIANT),eng) 24LOCAL_CFLAGS := -DANDROID_ENGINEERING_BUILD \ 25 $(LOCAL_CFLAGS) 26endif 27 28ifeq ($(LLVM_ENABLE_ASSERTION),true) 29LOCAL_CFLAGS := \ 30 $(LOCAL_CFLAGS) \ 31 -D_DEBUG \ 32 -UNDEBUG 33endif 34 35ifneq ($(REQUIRES_EH),1) 36LOCAL_CFLAGS += -fno-exceptions 37else 38# No action. The device target should not have exception enabled since bionic 39# doesn't support it 40REQUIRES_EH := 0 41endif 42 43ifneq ($(REQUIRES_RTTI),1) 44LOCAL_CPPFLAGS += -fno-rtti 45else 46REQUIRES_RTTI := 0 47endif 48 49LOCAL_CPPFLAGS := \ 50 $(LOCAL_CPPFLAGS) \ 51 -Woverloaded-virtual \ 52 -Wno-sign-promo 53 54# Make sure bionic is first so we can include system headers. 55LOCAL_C_INCLUDES := \ 56 bionic \ 57 external/stlport/stlport \ 58 $(LLVM_ROOT_PATH) \ 59 $(LLVM_ROOT_PATH)/include \ 60 $(LLVM_ROOT_PATH)/device/include \ 61 $(LOCAL_C_INCLUDES) 62 63########################################################### 64## Commands for running tblgen to compile a td file 65########################################################### 66define transform-device-td-to-out 67@mkdir -p $(dir $@) 68@echo "Device TableGen (gen-$(1)): $(TBLGEN_LOCAL_MODULE) <= $<" 69$(hide) $(TBLGEN) \ 70 -I $(dir $<) \ 71 -I $(LLVM_ROOT_PATH)/include \ 72 -I $(LLVM_ROOT_PATH)/device/include \ 73 -I $(LLVM_ROOT_PATH)/lib/Target \ 74 -gen-$(strip $(1)) \ 75 -o $@ $< 76endef 77