blob: 6e073c1272ffa366eebf4edf4e133aa4d3b672dd [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
25LOCAL_PATH := $(call my-dir)
26
Stephen Hinese1094342014-05-13 17:55:49 -070027include frameworks/compile/slang/rs_version.mk
28local_cflags_for_libbcinfo += $(RS_VERSION_DEFINE)
29
Stephen Hines932bc6e2011-07-27 16:26:26 -070030libbcinfo_SRC_FILES := \
31 BitcodeTranslator.cpp \
Stephen Hines825b9ae2011-11-22 19:43:31 -080032 BitcodeWrapper.cpp \
Stephen Hines932bc6e2011-07-27 16:26:26 -070033 MetadataExtractor.cpp
34
Stephen Hines8dbca8e2013-06-21 16:30:26 -070035libbcinfo_C_INCLUDES := \
36 $(LOCAL_PATH)/../include \
37 $(LOCAL_PATH)/../../slang
38
Stephen Hines16c9b362011-07-18 18:22:16 -070039libbcinfo_STATIC_LIBRARIES := \
Stephen Hines7cd4c492012-03-13 19:57:37 -070040 libLLVMWrap \
Stephen Hines932bc6e2011-07-27 16:26:26 -070041 libLLVMBitReader_2_7 \
Stephen Hines8dbca8e2013-06-21 16:30:26 -070042 libLLVMBitReader_3_0 \
43 libLLVMBitWriter_3_2
Stephen Hines16c9b362011-07-18 18:22:16 -070044
Stephen Hines150a70b2011-07-18 17:21:46 -070045LLVM_ROOT_PATH := external/llvm
46
Colin Cross71df0502014-02-04 16:27:32 -080047ifeq ($(TARGET_ARCH),arm64)
48$(info TODOArm64: $(LOCAL_PATH)/Android.mk Enable build of libbcinfo device shared library)
49endif
50
51ifeq ($(TARGET_ARCH),mips64)
52$(info TODOMips64: $(LOCAL_PATH)/Android.mk Enable build of libbcinfo device shared library)
53endif
Ashok Bhatad7d4c32013-11-22 13:29:44 +000054
Tim Murrayc6e6ee42014-04-07 14:13:26 -070055ifneq (true,$(DISABLE_LLVM_DEVICE_BUILDS))
Stephen Hines150a70b2011-07-18 17:21:46 -070056include $(CLEAR_VARS)
57
58LOCAL_MODULE := libbcinfo
59LOCAL_MODULE_CLASS := SHARED_LIBRARIES
60LOCAL_MODULE_TAGS := optional
Stephen Hines150a70b2011-07-18 17:21:46 -070061
Stephen Hines16c9b362011-07-18 18:22:16 -070062LOCAL_SRC_FILES := $(libbcinfo_SRC_FILES)
Stephen Hines150a70b2011-07-18 17:21:46 -070063
64LOCAL_CFLAGS += $(local_cflags_for_libbcinfo)
65
Stephen Hines16c9b362011-07-18 18:22:16 -070066LOCAL_C_INCLUDES := $(libbcinfo_C_INCLUDES)
Stephen Hines150a70b2011-07-18 17:21:46 -070067
Stephen Hines4b778722013-02-27 23:22:45 -080068LOCAL_STATIC_LIBRARIES := $(libbcinfo_STATIC_LIBRARIES)
Stephen Hines52031f22014-06-05 14:29:44 -070069LOCAL_SHARED_LIBRARIES := libLLVM libcutils liblog
Stephen Hines150a70b2011-07-18 17:21:46 -070070
71include $(LLVM_ROOT_PATH)/llvm-device-build.mk
72include $(BUILD_SHARED_LIBRARY)
Tim Murrayc6e6ee42014-04-07 14:13:26 -070073endif
Stephen Hines16c9b362011-07-18 18:22:16 -070074
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)
Ying Wang2edf6d62013-04-09 21:54:38 -070089LOCAL_STATIC_LIBRARIES += libcutils liblog
Stephen Hinesba8d7ce2013-02-27 00:40:04 -080090LOCAL_SHARED_LIBRARIES += libLLVM
Stephen Hines16c9b362011-07-18 18:22:16 -070091
Stephen Hines48cd7452013-07-30 22:33:44 -070092ifndef USE_MINGW
Stephen Hines16c9b362011-07-18 18:22:16 -070093LOCAL_LDLIBS := -ldl -lpthread
Stephen Hines48cd7452013-07-30 22:33:44 -070094endif
Stephen Hines16c9b362011-07-18 18:22:16 -070095
96include $(LLVM_ROOT_PATH)/llvm-host-build.mk
97include $(BUILD_HOST_SHARED_LIBRARY)
98
Tim Murray62973822013-02-06 17:22:23 -080099endif # don't build for unbundled branches
100
Stephen Hines932bc6e2011-07-27 16:26:26 -0700101#=====================================================================
102# Include Subdirectories
103#=====================================================================
104include $(call all-makefiles-under,$(LOCAL_PATH))