blob: 5a5501439c6007e101ffb264e6bd9ad1764aa463 [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
72LOCAL_MODULE_TAGS := optional
73LOCAL_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 Hinesba8d7ce2013-02-27 00:40:04 -080083LOCAL_SHARED_LIBRARIES += libLLVM
Stephen Hines16c9b362011-07-18 18:22:16 -070084
Stephen Hines48cd7452013-07-30 22:33:44 -070085ifndef USE_MINGW
Stephen Hines16c9b362011-07-18 18:22:16 -070086LOCAL_LDLIBS := -ldl -lpthread
Stephen Hines48cd7452013-07-30 22:33:44 -070087endif
Stephen Hines16c9b362011-07-18 18:22:16 -070088
89include $(LLVM_ROOT_PATH)/llvm-host-build.mk
90include $(BUILD_HOST_SHARED_LIBRARY)
91
Tim Murray62973822013-02-06 17:22:23 -080092endif # don't build for unbundled branches
93
Stephen Hines932bc6e2011-07-27 16:26:26 -070094#=====================================================================
95# Include Subdirectories
96#=====================================================================
97include $(call all-makefiles-under,$(LOCAL_PATH))