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-sign-compare \ 15 -Wno-unused-parameter \ 16 -Wwrite-strings \ 17 -Werror \ 18 -Dsprintf=sprintf \ 19 $(LOCAL_CFLAGS) 20 21# The three inline options together reduce libbcc.so almost 1MB. 22# We move them from global build/core/combo/TARGET_linux-arm.mk 23# to here. 24LOCAL_CFLAGS := -DANDROID_TARGET_BUILD \ 25 -finline-functions \ 26 $(LOCAL_CFLAGS) 27 28ifeq ($(TARGET_BUILD_VARIANT),eng) 29LOCAL_CFLAGS := -DANDROID_ENGINEERING_BUILD \ 30 $(LOCAL_CFLAGS) 31endif 32 33ifeq ($(FORCE_BUILD_LLVM_DISABLE_NDEBUG),true) 34LOCAL_CFLAGS := \ 35 $(LOCAL_CFLAGS) \ 36 -D_DEBUG \ 37 -UNDEBUG 38endif 39 40LOCAL_CPPFLAGS := \ 41 $(LOCAL_CPPFLAGS) \ 42 -Woverloaded-virtual \ 43 -Wno-sign-promo \ 44 -std=c++11 45 46# Make sure bionic is first so we can include system headers. 47LOCAL_C_INCLUDES := \ 48 bionic \ 49 $(LLVM_ROOT_PATH) \ 50 $(LLVM_ROOT_PATH)/include \ 51 $(LLVM_ROOT_PATH)/device/include \ 52 $(LOCAL_C_INCLUDES) 53 54########################################################### 55## Commands for running tblgen to compile a td file 56########################################################### 57define transform-device-td-to-out 58@mkdir -p $(dir $@) 59@echo "Device TableGen (gen-$(1)): $(TBLGEN_LOCAL_MODULE) <= $<" 60$(hide) $(LLVM_TBLGEN) \ 61 -I $(dir $<) \ 62 -I $(LLVM_ROOT_PATH)/include \ 63 -I $(LLVM_ROOT_PATH)/device/include \ 64 -I $(LLVM_ROOT_PATH)/lib/Target \ 65 -gen-$(strip $(1)) \ 66 -d $@.d -o $@ $< 67endef 68