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 17local_cflags_for_libbcinfo := -Wall -Wno-unused-parameter -Werror 18ifneq ($(TARGET_BUILD_VARIANT),eng) 19local_cflags_for_libbcinfo += -D__DISABLE_ASSERTS 20endif 21 22LOCAL_PATH := $(call my-dir) 23 24include frameworks/compile/slang/rs_version.mk 25local_cflags_for_libbcinfo += $(RS_VERSION_DEFINE) 26 27libbcinfo_SRC_FILES := \ 28 BitcodeTranslator.cpp \ 29 BitcodeWrapper.cpp \ 30 MetadataExtractor.cpp 31 32libbcinfo_C_INCLUDES := \ 33 $(LOCAL_PATH)/../include \ 34 $(LOCAL_PATH)/../../slang 35 36libbcinfo_STATIC_LIBRARIES := \ 37 libLLVMWrap \ 38 libLLVMBitReader_2_7 \ 39 libLLVMBitReader_3_0 \ 40 libLLVMBitWriter_3_2 41 42LLVM_ROOT_PATH := external/llvm 43 44ifeq ($(TARGET_ARCH),arm64) 45$(info TODOArm64: $(LOCAL_PATH)/Android.mk Enable build of libbcinfo device shared library) 46endif 47 48ifeq ($(TARGET_ARCH),mips64) 49$(info TODOMips64: $(LOCAL_PATH)/Android.mk Enable build of libbcinfo device shared library) 50endif 51 52ifneq (true,$(DISABLE_LLVM_DEVICE_BUILDS)) 53include $(CLEAR_VARS) 54 55LOCAL_MODULE := libbcinfo 56LOCAL_MODULE_CLASS := SHARED_LIBRARIES 57LOCAL_MODULE_TAGS := optional 58 59LOCAL_SRC_FILES := $(libbcinfo_SRC_FILES) 60 61LOCAL_CFLAGS += $(local_cflags_for_libbcinfo) 62 63LOCAL_C_INCLUDES := $(libbcinfo_C_INCLUDES) 64 65LOCAL_STATIC_LIBRARIES := $(libbcinfo_STATIC_LIBRARIES) 66LOCAL_SHARED_LIBRARIES := libLLVM libcutils liblog 67 68include $(LLVM_ROOT_PATH)/llvm-device-build.mk 69include $(BUILD_SHARED_LIBRARY) 70endif 71 72# Don't build for unbundled branches 73ifeq (,$(TARGET_BUILD_APPS)) 74 75include $(CLEAR_VARS) 76 77LOCAL_MODULE := libbcinfo 78LOCAL_MODULE_CLASS := SHARED_LIBRARIES 79LOCAL_MODULE_TAGS := optional 80LOCAL_IS_HOST_MODULE := true 81 82LOCAL_SRC_FILES := $(libbcinfo_SRC_FILES) 83 84LOCAL_CFLAGS += $(local_cflags_for_libbcinfo) 85 86LOCAL_C_INCLUDES := $(libbcinfo_C_INCLUDES) 87 88LOCAL_STATIC_LIBRARIES += $(libbcinfo_STATIC_LIBRARIES) 89LOCAL_STATIC_LIBRARIES += libcutils liblog 90LOCAL_SHARED_LIBRARIES += libLLVM 91 92ifndef USE_MINGW 93LOCAL_LDLIBS := -ldl -lpthread 94endif 95 96include $(LLVM_ROOT_PATH)/llvm-host-build.mk 97include $(BUILD_HOST_SHARED_LIBRARY) 98 99endif # don't build for unbundled branches 100 101#===================================================================== 102# Include Subdirectories 103#===================================================================== 104include $(call all-makefiles-under,$(LOCAL_PATH)) 105