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 # Don't build for unbundled branches 18 ifeq (,$(TARGET_BUILD_APPS)) 19 20 local_cflags_for_libbcinfo := -Wall -Wno-unused-parameter -Werror 21 ifneq ($(TARGET_BUILD_VARIANT),eng) 22 local_cflags_for_libbcinfo += -D__DISABLE_ASSERTS 23 endif 24 25 ifeq "REL" "$(PLATFORM_VERSION_CODENAME)" 26 BCINFO_API_VERSION := $(PLATFORM_SDK_VERSION) 27 else 28 # Increment by 1 whenever this is not a final release build, since we want to 29 # be able to see the RS version number change during development. 30 # See build/core/version_defaults.mk for more information about this. 31 BCINFO_API_VERSION := "(1 + $(PLATFORM_SDK_VERSION))" 32 endif 33 local_cflags_for_libbcinfo += -DBCINFO_API_VERSION=$(BCINFO_API_VERSION) 34 35 LOCAL_PATH := $(call my-dir) 36 37 libbcinfo_SRC_FILES := \ 38 BitcodeTranslator.cpp \ 39 BitcodeWrapper.cpp \ 40 MetadataExtractor.cpp 41 42 libbcinfo_C_INCLUDES := \ 43 $(LOCAL_PATH)/../include \ 44 $(LOCAL_PATH)/../../slang 45 46 libbcinfo_STATIC_LIBRARIES := \ 47 libLLVMWrap \ 48 libLLVMBitReader_2_7 \ 49 libLLVMBitReader_3_0 \ 50 libLLVMBitWriter_3_2 51 52 LLVM_ROOT_PATH := external/llvm 53 54 include $(CLEAR_VARS) 55 56 LOCAL_MODULE := libbcinfo 57 LOCAL_MODULE_CLASS := SHARED_LIBRARIES 58 LOCAL_MODULE_TAGS := optional 59 intermediates := $(local-intermediates-dir) 60 61 LOCAL_SRC_FILES := $(libbcinfo_SRC_FILES) 62 63 LOCAL_CFLAGS += $(local_cflags_for_libbcinfo) 64 65 LOCAL_C_INCLUDES := $(libbcinfo_C_INCLUDES) 66 67 LOCAL_STATIC_LIBRARIES := $(libbcinfo_STATIC_LIBRARIES) 68 LOCAL_SHARED_LIBRARIES := libLLVM libcutils liblog libstlport 69 70 include $(LLVM_ROOT_PATH)/llvm-device-build.mk 71 include $(BUILD_SHARED_LIBRARY) 72 73 include $(CLEAR_VARS) 74 75 LOCAL_MODULE := libbcinfo 76 LOCAL_MODULE_CLASS := SHARED_LIBRARIES 77 LOCAL_MODULE_TAGS := optional 78 LOCAL_IS_HOST_MODULE := true 79 80 LOCAL_SRC_FILES := $(libbcinfo_SRC_FILES) 81 82 LOCAL_CFLAGS += $(local_cflags_for_libbcinfo) 83 84 LOCAL_C_INCLUDES := $(libbcinfo_C_INCLUDES) 85 86 LOCAL_STATIC_LIBRARIES += $(libbcinfo_STATIC_LIBRARIES) 87 LOCAL_STATIC_LIBRARIES += libcutils liblog 88 LOCAL_SHARED_LIBRARIES += libLLVM 89 90 ifndef USE_MINGW 91 LOCAL_LDLIBS := -ldl -lpthread 92 endif 93 94 include $(LLVM_ROOT_PATH)/llvm-host-build.mk 95 include $(BUILD_HOST_SHARED_LIBRARY) 96 97 endif # don't build for unbundled branches 98 99 #===================================================================== 100 # Include Subdirectories 101 #===================================================================== 102 include $(call all-makefiles-under,$(LOCAL_PATH)) 103