blob: cb6af9764624e10bbd03adb516a358f718d7f37f [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
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
Stephen Hinese1094342014-05-13 17:55:49 -070024include frameworks/compile/slang/rs_version.mk
25local_cflags_for_libbcinfo += $(RS_VERSION_DEFINE)
26
Stephen Hines932bc6e2011-07-27 16:26:26 -070027libbcinfo_SRC_FILES := \
28 BitcodeTranslator.cpp \
Stephen Hines825b9ae2011-11-22 19:43:31 -080029 BitcodeWrapper.cpp \
Stephen Hines932bc6e2011-07-27 16:26:26 -070030 MetadataExtractor.cpp
31
Stephen Hines8dbca8e2013-06-21 16:30:26 -070032libbcinfo_C_INCLUDES := \
33 $(LOCAL_PATH)/../include \
34 $(LOCAL_PATH)/../../slang
35
Stephen Hines16c9b362011-07-18 18:22:16 -070036libbcinfo_STATIC_LIBRARIES := \
Stephen Hines7cd4c492012-03-13 19:57:37 -070037 libLLVMWrap \
Stephen Hines932bc6e2011-07-27 16:26:26 -070038 libLLVMBitReader_2_7 \
Stephen Hines8dbca8e2013-06-21 16:30:26 -070039 libLLVMBitReader_3_0 \
40 libLLVMBitWriter_3_2
Stephen Hines16c9b362011-07-18 18:22:16 -070041
Stephen Hines150a70b2011-07-18 17:21:46 -070042LLVM_ROOT_PATH := external/llvm
43
Colin Cross71df0502014-02-04 16:27:32 -080044ifeq ($(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
Ashok Bhatad7d4c32013-11-22 13:29:44 +000051
Tim Murrayc6e6ee42014-04-07 14:13:26 -070052ifneq (true,$(DISABLE_LLVM_DEVICE_BUILDS))
Stephen Hines150a70b2011-07-18 17:21:46 -070053include $(CLEAR_VARS)
54
55LOCAL_MODULE := libbcinfo
56LOCAL_MODULE_CLASS := SHARED_LIBRARIES
57LOCAL_MODULE_TAGS := optional
Stephen Hines150a70b2011-07-18 17:21:46 -070058
Stephen Hines16c9b362011-07-18 18:22:16 -070059LOCAL_SRC_FILES := $(libbcinfo_SRC_FILES)
Stephen Hines150a70b2011-07-18 17:21:46 -070060
61LOCAL_CFLAGS += $(local_cflags_for_libbcinfo)
62
Stephen Hines16c9b362011-07-18 18:22:16 -070063LOCAL_C_INCLUDES := $(libbcinfo_C_INCLUDES)
Stephen Hines150a70b2011-07-18 17:21:46 -070064
Stephen Hines4b778722013-02-27 23:22:45 -080065LOCAL_STATIC_LIBRARIES := $(libbcinfo_STATIC_LIBRARIES)
Stephen Hines52031f22014-06-05 14:29:44 -070066LOCAL_SHARED_LIBRARIES := libLLVM libcutils liblog
Stephen Hines150a70b2011-07-18 17:21:46 -070067
68include $(LLVM_ROOT_PATH)/llvm-device-build.mk
69include $(BUILD_SHARED_LIBRARY)
Tim Murrayc6e6ee42014-04-07 14:13:26 -070070endif
Stephen Hines16c9b362011-07-18 18:22:16 -070071
Ying Wang8d01bd82014-08-01 14:19:38 -070072# Don't build for unbundled branches
73ifeq (,$(TARGET_BUILD_APPS))
74
Stephen Hines16c9b362011-07-18 18:22:16 -070075include $(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))