Stephen Hines | 150a70b | 2011-07-18 17:21:46 -0700 | [diff] [blame] | 1 | # |
Stephen Hines | 7cd4c49 | 2012-03-13 19:57:37 -0700 | [diff] [blame] | 2 | # Copyright (C) 2011-2012 The Android Open Source Project |
Stephen Hines | 150a70b | 2011-07-18 17:21:46 -0700 | [diff] [blame] | 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 | |
Tim Murray | 6297382 | 2013-02-06 17:22:23 -0800 | [diff] [blame] | 17 | # Don't build for unbundled branches |
| 18 | ifeq (,$(TARGET_BUILD_APPS)) |
| 19 | |
Stephen Hines | 150a70b | 2011-07-18 17:21:46 -0700 | [diff] [blame] | 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 | |
Stephen Hines | 932bc6e | 2011-07-27 16:26:26 -0700 | [diff] [blame] | 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 | |
Stephen Hines | 150a70b | 2011-07-18 17:21:46 -0700 | [diff] [blame] | 35 | LOCAL_PATH := $(call my-dir) |
| 36 | |
Stephen Hines | 932bc6e | 2011-07-27 16:26:26 -0700 | [diff] [blame] | 37 | libbcinfo_SRC_FILES := \ |
| 38 | BitcodeTranslator.cpp \ |
Stephen Hines | 825b9ae | 2011-11-22 19:43:31 -0800 | [diff] [blame] | 39 | BitcodeWrapper.cpp \ |
Stephen Hines | 932bc6e | 2011-07-27 16:26:26 -0700 | [diff] [blame] | 40 | MetadataExtractor.cpp |
| 41 | |
Stephen Hines | 16c9b36 | 2011-07-18 18:22:16 -0700 | [diff] [blame] | 42 | libbcinfo_C_INCLUDES := $(LOCAL_PATH)/../include |
| 43 | libbcinfo_STATIC_LIBRARIES := \ |
Stephen Hines | 7cd4c49 | 2012-03-13 19:57:37 -0700 | [diff] [blame] | 44 | libLLVMWrap \ |
Stephen Hines | 932bc6e | 2011-07-27 16:26:26 -0700 | [diff] [blame] | 45 | libLLVMBitReader_2_7 \ |
Logan Chien | c7d67a7 | 2011-12-16 17:06:49 +0800 | [diff] [blame] | 46 | libLLVMBitReader_3_0 |
Stephen Hines | 16c9b36 | 2011-07-18 18:22:16 -0700 | [diff] [blame] | 47 | |
Stephen Hines | 150a70b | 2011-07-18 17:21:46 -0700 | [diff] [blame] | 48 | LLVM_ROOT_PATH := external/llvm |
| 49 | |
| 50 | include $(CLEAR_VARS) |
| 51 | |
| 52 | LOCAL_MODULE := libbcinfo |
| 53 | LOCAL_MODULE_CLASS := SHARED_LIBRARIES |
| 54 | LOCAL_MODULE_TAGS := optional |
| 55 | intermediates := $(local-intermediates-dir) |
| 56 | |
Stephen Hines | 16c9b36 | 2011-07-18 18:22:16 -0700 | [diff] [blame] | 57 | LOCAL_SRC_FILES := $(libbcinfo_SRC_FILES) |
Stephen Hines | 150a70b | 2011-07-18 17:21:46 -0700 | [diff] [blame] | 58 | |
| 59 | LOCAL_CFLAGS += $(local_cflags_for_libbcinfo) |
| 60 | |
Stephen Hines | 16c9b36 | 2011-07-18 18:22:16 -0700 | [diff] [blame] | 61 | LOCAL_C_INCLUDES := $(libbcinfo_C_INCLUDES) |
Stephen Hines | 150a70b | 2011-07-18 17:21:46 -0700 | [diff] [blame] | 62 | |
Stephen Hines | 4b77872 | 2013-02-27 23:22:45 -0800 | [diff] [blame^] | 63 | LOCAL_STATIC_LIBRARIES := $(libbcinfo_STATIC_LIBRARIES) |
| 64 | LOCAL_SHARED_LIBRARIES := libLLVM libcutils libstlport |
Stephen Hines | 150a70b | 2011-07-18 17:21:46 -0700 | [diff] [blame] | 65 | |
| 66 | include $(LLVM_ROOT_PATH)/llvm-device-build.mk |
| 67 | include $(BUILD_SHARED_LIBRARY) |
Stephen Hines | 16c9b36 | 2011-07-18 18:22:16 -0700 | [diff] [blame] | 68 | |
| 69 | include $(CLEAR_VARS) |
| 70 | |
| 71 | LOCAL_MODULE := libbcinfo |
| 72 | LOCAL_MODULE_CLASS := SHARED_LIBRARIES |
| 73 | LOCAL_MODULE_TAGS := optional |
| 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 |
Stephen Hines | ba8d7ce | 2013-02-27 00:40:04 -0800 | [diff] [blame] | 84 | LOCAL_SHARED_LIBRARIES += libLLVM |
Stephen Hines | 16c9b36 | 2011-07-18 18:22:16 -0700 | [diff] [blame] | 85 | |
| 86 | LOCAL_LDLIBS := -ldl -lpthread |
| 87 | |
| 88 | include $(LLVM_ROOT_PATH)/llvm-host-build.mk |
| 89 | include $(BUILD_HOST_SHARED_LIBRARY) |
| 90 | |
Tim Murray | 6297382 | 2013-02-06 17:22:23 -0800 | [diff] [blame] | 91 | endif # don't build for unbundled branches |
| 92 | |
Stephen Hines | 932bc6e | 2011-07-27 16:26:26 -0700 | [diff] [blame] | 93 | #===================================================================== |
| 94 | # Include Subdirectories |
| 95 | #===================================================================== |
| 96 | include $(call all-makefiles-under,$(LOCAL_PATH)) |