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