1 # 2 # Copyright (C) 2011-2012 The Android Open Source Project 3 # 4 # Licensed under the Apache License, Version 2.0 (the "License"); 5 # you may not use this file except in compliance with the License. 6 # You may obtain a copy of the License at 7 # 8 # http://www.apache.org/licenses/LICENSE-2.0 9 # 10 # Unless required by applicable law or agreed to in writing, software 11 # distributed under the License is distributed on an "AS IS" BASIS, 12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 # See the License for the specific language governing permissions and 14 # limitations under the License. 15 # 16 17 local_cflags_for_libbcinfo := -Wall -Wno-unused-parameter -Werror 18 ifneq ($(TARGET_BUILD_VARIANT),eng) 19 local_cflags_for_libbcinfo += -D__DISABLE_ASSERTS 20 endif 21 22 LOCAL_PATH := $(call my-dir) 23 24 include frameworks/compile/slang/rs_version.mk 25 local_cflags_for_libbcinfo += $(RS_VERSION_DEFINE) 26 27 libbcinfo_SRC_FILES := \ 28 BitcodeTranslator.cpp \ 29 BitcodeWrapper.cpp \ 30 MetadataExtractor.cpp 31 32 libbcinfo_C_INCLUDES := \ 33 $(LOCAL_PATH)/../include \ 34 $(RS_ROOT_PATH) \ 35 $(LOCAL_PATH)/../../slang 36 37 libbcinfo_STATIC_LIBRARIES := \ 38 libLLVMWrap \ 39 libLLVMBitReader_2_7 \ 40 libLLVMBitReader_3_0 \ 41 libLLVMBitWriter_3_2 42 43 LLVM_ROOT_PATH := external/llvm 44 45 ifneq (true,$(DISABLE_LLVM_DEVICE_BUILDS)) 46 include $(CLEAR_VARS) 47 48 LOCAL_MODULE := libbcinfo 49 LOCAL_MODULE_CLASS := SHARED_LIBRARIES 50 LOCAL_MODULE_TAGS := optional 51 52 LOCAL_SRC_FILES := $(libbcinfo_SRC_FILES) 53 54 LOCAL_CFLAGS += $(local_cflags_for_libbcinfo) 55 56 LOCAL_C_INCLUDES := $(libbcinfo_C_INCLUDES) 57 58 LOCAL_STATIC_LIBRARIES := $(libbcinfo_STATIC_LIBRARIES) 59 LOCAL_SHARED_LIBRARIES := libLLVM libcutils liblog 60 61 include $(LLVM_ROOT_PATH)/llvm-device-build.mk 62 include $(LLVM_GEN_ATTRIBUTES_MK) 63 include $(BUILD_SHARED_LIBRARY) 64 endif 65 66 # Don't build for unbundled branches 67 ifeq (,$(TARGET_BUILD_APPS)) 68 69 include $(CLEAR_VARS) 70 71 LOCAL_MODULE := libbcinfo 72 LOCAL_MODULE_CLASS := SHARED_LIBRARIES 73 LOCAL_MODULE_HOST_OS := darwin linux windows 74 LOCAL_IS_HOST_MODULE := true 75 76 LOCAL_SRC_FILES := $(libbcinfo_SRC_FILES) 77 78 LOCAL_CFLAGS += $(local_cflags_for_libbcinfo) 79 80 LOCAL_C_INCLUDES := $(libbcinfo_C_INCLUDES) 81 82 LOCAL_STATIC_LIBRARIES += $(libbcinfo_STATIC_LIBRARIES) 83 LOCAL_STATIC_LIBRARIES += libcutils liblog 84 85 LOCAL_LDLIBS_darwin := -ldl -lpthread 86 LOCAL_LDLIBS_linux := -ldl -lpthread 87 88 include $(LOCAL_PATH)/../llvm-loadable-libbcc.mk 89 90 ifneq ($(CAN_BUILD_HOST_LLVM_LOADABLE_MODULE),true) 91 LOCAL_SHARED_LIBRARIES_linux += libLLVM 92 endif 93 LOCAL_SHARED_LIBRARIES_darwin += libLLVM 94 LOCAL_SHARED_LIBRARIES_windows += libLLVM 95 96 include $(LLVM_ROOT_PATH)/llvm-host-build.mk 97 include $(LLVM_GEN_ATTRIBUTES_MK) 98 include $(BUILD_HOST_SHARED_LIBRARY) 99 100 endif # don't build for unbundled branches 101 102 #===================================================================== 103 # Include Subdirectories 104 #===================================================================== 105 include $(call all-makefiles-under,$(LOCAL_PATH)) 106