blob: 07989a877ba5bcaea300f65720bd45da72075c3d [file] [log] [blame]
Stephen Hines150a70b2011-07-18 17:21:46 -07001#
Stephen Hines7cd4c492012-03-13 19:57:37 -07002# Copyright (C) 2011-2012 The Android Open Source Project
Stephen Hines150a70b2011-07-18 17:21:46 -07003#
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 Murray62973822013-02-06 17:22:23 -080017# Don't build for unbundled branches
18ifeq (,$(TARGET_BUILD_APPS))
19
Stephen Hines150a70b2011-07-18 17:21:46 -070020local_cflags_for_libbcinfo := -Wall -Wno-unused-parameter -Werror
21ifneq ($(TARGET_BUILD_VARIANT),eng)
22local_cflags_for_libbcinfo += -D__DISABLE_ASSERTS
23endif
24
Stephen Hines932bc6e2011-07-27 16:26:26 -070025ifeq "REL" "$(PLATFORM_VERSION_CODENAME)"
26 BCINFO_API_VERSION := $(PLATFORM_SDK_VERSION)
27else
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))"
32endif
33local_cflags_for_libbcinfo += -DBCINFO_API_VERSION=$(BCINFO_API_VERSION)
34
Stephen Hines150a70b2011-07-18 17:21:46 -070035LOCAL_PATH := $(call my-dir)
36
Stephen Hines932bc6e2011-07-27 16:26:26 -070037libbcinfo_SRC_FILES := \
38 BitcodeTranslator.cpp \
Stephen Hines825b9ae2011-11-22 19:43:31 -080039 BitcodeWrapper.cpp \
Stephen Hines932bc6e2011-07-27 16:26:26 -070040 MetadataExtractor.cpp
41
Stephen Hines8dbca8e2013-06-21 16:30:26 -070042libbcinfo_C_INCLUDES := \
43 $(LOCAL_PATH)/../include \
44 $(LOCAL_PATH)/../../slang
45
Stephen Hines16c9b362011-07-18 18:22:16 -070046libbcinfo_STATIC_LIBRARIES := \
Stephen Hines7cd4c492012-03-13 19:57:37 -070047 libLLVMWrap \
Stephen Hines932bc6e2011-07-27 16:26:26 -070048 libLLVMBitReader_2_7 \
Stephen Hines8dbca8e2013-06-21 16:30:26 -070049 libLLVMBitReader_3_0 \
50 libLLVMBitWriter_3_2
Stephen Hines16c9b362011-07-18 18:22:16 -070051
Stephen Hines150a70b2011-07-18 17:21:46 -070052LLVM_ROOT_PATH := external/llvm
53
Colin Cross71df0502014-02-04 16:27:32 -080054ifeq ($(TARGET_ARCH),arm64)
55$(info TODOArm64: $(LOCAL_PATH)/Android.mk Enable build of libbcinfo device shared library)
56endif
57
58ifeq ($(TARGET_ARCH),mips64)
59$(info TODOMips64: $(LOCAL_PATH)/Android.mk Enable build of libbcinfo device shared library)
60endif
Ashok Bhatad7d4c32013-11-22 13:29:44 +000061
Tim Murrayc6e6ee42014-04-07 14:13:26 -070062ifneq (true,$(DISABLE_LLVM_DEVICE_BUILDS))
Stephen Hines150a70b2011-07-18 17:21:46 -070063include $(CLEAR_VARS)
64
65LOCAL_MODULE := libbcinfo
66LOCAL_MODULE_CLASS := SHARED_LIBRARIES
67LOCAL_MODULE_TAGS := optional
Stephen Hines150a70b2011-07-18 17:21:46 -070068
Stephen Hines16c9b362011-07-18 18:22:16 -070069LOCAL_SRC_FILES := $(libbcinfo_SRC_FILES)
Stephen Hines150a70b2011-07-18 17:21:46 -070070
71LOCAL_CFLAGS += $(local_cflags_for_libbcinfo)
72
Stephen Hines16c9b362011-07-18 18:22:16 -070073LOCAL_C_INCLUDES := $(libbcinfo_C_INCLUDES)
Stephen Hines150a70b2011-07-18 17:21:46 -070074
Stephen Hines4b778722013-02-27 23:22:45 -080075LOCAL_STATIC_LIBRARIES := $(libbcinfo_STATIC_LIBRARIES)
Ying Wang2edf6d62013-04-09 21:54:38 -070076LOCAL_SHARED_LIBRARIES := libLLVM libcutils liblog libstlport
Stephen Hines150a70b2011-07-18 17:21:46 -070077
78include $(LLVM_ROOT_PATH)/llvm-device-build.mk
79include $(BUILD_SHARED_LIBRARY)
Tim Murrayc6e6ee42014-04-07 14:13:26 -070080endif
Stephen Hines16c9b362011-07-18 18:22:16 -070081
82include $(CLEAR_VARS)
83
84LOCAL_MODULE := libbcinfo
85LOCAL_MODULE_CLASS := SHARED_LIBRARIES
86LOCAL_MODULE_TAGS := optional
87LOCAL_IS_HOST_MODULE := true
88
89LOCAL_SRC_FILES := $(libbcinfo_SRC_FILES)
90
91LOCAL_CFLAGS += $(local_cflags_for_libbcinfo)
92
93LOCAL_C_INCLUDES := $(libbcinfo_C_INCLUDES)
94
95LOCAL_STATIC_LIBRARIES += $(libbcinfo_STATIC_LIBRARIES)
Ying Wang2edf6d62013-04-09 21:54:38 -070096LOCAL_STATIC_LIBRARIES += libcutils liblog
Stephen Hinesba8d7ce2013-02-27 00:40:04 -080097LOCAL_SHARED_LIBRARIES += libLLVM
Stephen Hines16c9b362011-07-18 18:22:16 -070098
Stephen Hines48cd7452013-07-30 22:33:44 -070099ifndef USE_MINGW
Stephen Hines16c9b362011-07-18 18:22:16 -0700100LOCAL_LDLIBS := -ldl -lpthread
Stephen Hines48cd7452013-07-30 22:33:44 -0700101endif
Stephen Hines16c9b362011-07-18 18:22:16 -0700102
103include $(LLVM_ROOT_PATH)/llvm-host-build.mk
104include $(BUILD_HOST_SHARED_LIBRARY)
105
Tim Murray62973822013-02-06 17:22:23 -0800106endif # don't build for unbundled branches
107
Stephen Hines932bc6e2011-07-27 16:26:26 -0700108#=====================================================================
109# Include Subdirectories
110#=====================================================================
111include $(call all-makefiles-under,$(LOCAL_PATH))