Home | History | Annotate | Download | only in llvm
      1 LOCAL_MODULE_TARGET_ARCH := $(LLVM_SUPPORTED_ARCH)
      2 
      3 LOCAL_CLANG := true
      4 
      5 LOCAL_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 	-Werror \
     17         -Dsprintf=sprintf \
     18 	$(LOCAL_CFLAGS)
     19 
     20 # The three inline options together reduce libbcc.so almost 1MB.
     21 # We move them from global build/core/combo/TARGET_linux-arm.mk
     22 # to here.
     23 LOCAL_CFLAGS := -DANDROID_TARGET_BUILD \
     24 		-finline-functions \
     25 		$(LOCAL_CFLAGS)
     26 
     27 ifeq ($(TARGET_BUILD_VARIANT),eng)
     28 LOCAL_CFLAGS := -DANDROID_ENGINEERING_BUILD \
     29                 $(LOCAL_CFLAGS)
     30 endif
     31 
     32 ifeq ($(FORCE_BUILD_LLVM_DISABLE_NDEBUG),true)
     33 LOCAL_CFLAGS :=	\
     34 	$(LOCAL_CFLAGS) \
     35 	-D_DEBUG	\
     36 	-UNDEBUG
     37 endif
     38 
     39 ifneq ($(REQUIRES_EH),1)
     40 LOCAL_CFLAGS +=	-fno-exceptions
     41 else
     42 # No action. The device target should not have exception enabled since bionic
     43 # doesn't support it
     44 REQUIRES_EH := 0
     45 endif
     46 
     47 ifneq ($(REQUIRES_RTTI),1)
     48 LOCAL_CPPFLAGS +=	-fno-rtti
     49 else
     50 REQUIRES_RTTI := 0
     51 endif
     52 
     53 LOCAL_CPPFLAGS :=	\
     54 	$(LOCAL_CPPFLAGS)	\
     55 	-Woverloaded-virtual	\
     56 	-Wno-sign-promo         \
     57 	-std=c++11
     58 
     59 # Make sure bionic is first so we can include system headers.
     60 LOCAL_C_INCLUDES :=	\
     61 	bionic \
     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 ###########################################################
     70 define transform-device-td-to-out
     71 @mkdir -p $(dir $@)
     72 @echo "Device TableGen (gen-$(1)): $(TBLGEN_LOCAL_MODULE) <= $<"
     73 $(hide) $(LLVM_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 $@ $<
     80 endef
     81