blob: 89dd817ce7c29c8d58f9ffa026dbbbcc48f9adab [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 \
Stephen Hinesfb81ec12015-05-18 20:04:23 -070034 $(RS_ROOT_PATH) \
Stephen Hines8dbca8e2013-06-21 16:30:26 -070035 $(LOCAL_PATH)/../../slang
36
Stephen Hines16c9b362011-07-18 18:22:16 -070037libbcinfo_STATIC_LIBRARIES := \
Stephen Hines7cd4c492012-03-13 19:57:37 -070038 libLLVMWrap \
Stephen Hines932bc6e2011-07-27 16:26:26 -070039 libLLVMBitReader_2_7 \
Stephen Hines8dbca8e2013-06-21 16:30:26 -070040 libLLVMBitReader_3_0 \
41 libLLVMBitWriter_3_2
Stephen Hines16c9b362011-07-18 18:22:16 -070042
Stephen Hines150a70b2011-07-18 17:21:46 -070043LLVM_ROOT_PATH := external/llvm
44
Tim Murrayc6e6ee42014-04-07 14:13:26 -070045ifneq (true,$(DISABLE_LLVM_DEVICE_BUILDS))
Stephen Hines150a70b2011-07-18 17:21:46 -070046include $(CLEAR_VARS)
47
48LOCAL_MODULE := libbcinfo
49LOCAL_MODULE_CLASS := SHARED_LIBRARIES
50LOCAL_MODULE_TAGS := optional
Stephen Hines150a70b2011-07-18 17:21:46 -070051
Stephen Hines16c9b362011-07-18 18:22:16 -070052LOCAL_SRC_FILES := $(libbcinfo_SRC_FILES)
Stephen Hines150a70b2011-07-18 17:21:46 -070053
54LOCAL_CFLAGS += $(local_cflags_for_libbcinfo)
55
Stephen Hines16c9b362011-07-18 18:22:16 -070056LOCAL_C_INCLUDES := $(libbcinfo_C_INCLUDES)
Stephen Hines150a70b2011-07-18 17:21:46 -070057
Stephen Hines4b778722013-02-27 23:22:45 -080058LOCAL_STATIC_LIBRARIES := $(libbcinfo_STATIC_LIBRARIES)
Stephen Hines52031f22014-06-05 14:29:44 -070059LOCAL_SHARED_LIBRARIES := libLLVM libcutils liblog
Stephen Hines150a70b2011-07-18 17:21:46 -070060
61include $(LLVM_ROOT_PATH)/llvm-device-build.mk
62include $(BUILD_SHARED_LIBRARY)
Tim Murrayc6e6ee42014-04-07 14:13:26 -070063endif
Stephen Hines16c9b362011-07-18 18:22:16 -070064
Ying Wang8d01bd82014-08-01 14:19:38 -070065# Don't build for unbundled branches
66ifeq (,$(TARGET_BUILD_APPS))
67
Stephen Hines16c9b362011-07-18 18:22:16 -070068include $(CLEAR_VARS)
69
70LOCAL_MODULE := libbcinfo
71LOCAL_MODULE_CLASS := SHARED_LIBRARIES
Dan Willemsen6af50b72015-08-18 16:52:32 -070072LOCAL_MODULE_HOST_OS := darwin linux windows
Stephen Hines16c9b362011-07-18 18:22:16 -070073LOCAL_IS_HOST_MODULE := true
74
75LOCAL_SRC_FILES := $(libbcinfo_SRC_FILES)
76
77LOCAL_CFLAGS += $(local_cflags_for_libbcinfo)
78
79LOCAL_C_INCLUDES := $(libbcinfo_C_INCLUDES)
80
81LOCAL_STATIC_LIBRARIES += $(libbcinfo_STATIC_LIBRARIES)
Ying Wang2edf6d62013-04-09 21:54:38 -070082LOCAL_STATIC_LIBRARIES += libcutils liblog
Stephen Hinesa6485fc2015-07-23 20:11:03 -070083
Dan Willemsen6af50b72015-08-18 16:52:32 -070084LOCAL_LDLIBS_darwin := -ldl -lpthread
85LOCAL_LDLIBS_linux := -ldl -lpthread
Stephen Hines16c9b362011-07-18 18:22:16 -070086
Matt Wala999d9242015-08-04 11:35:27 -070087include $(LOCAL_PATH)/../llvm-loadable-libbcc.mk
88
89ifneq ($(CAN_BUILD_HOST_LLVM_LOADABLE_MODULE),true)
Dan Willemsen6af50b72015-08-18 16:52:32 -070090LOCAL_SHARED_LIBRARIES_linux += libLLVM
Matt Wala999d9242015-08-04 11:35:27 -070091endif
Dan Willemsen6af50b72015-08-18 16:52:32 -070092LOCAL_SHARED_LIBRARIES_darwin += libLLVM
93LOCAL_SHARED_LIBRARIES_windows += libLLVM
Matt Wala999d9242015-08-04 11:35:27 -070094
Stephen Hines16c9b362011-07-18 18:22:16 -070095include $(LLVM_ROOT_PATH)/llvm-host-build.mk
96include $(BUILD_HOST_SHARED_LIBRARY)
97
Tim Murray62973822013-02-06 17:22:23 -080098endif # don't build for unbundled branches
99
Stephen Hines932bc6e2011-07-27 16:26:26 -0700100#=====================================================================
101# Include Subdirectories
102#=====================================================================
103include $(call all-makefiles-under,$(LOCAL_PATH))