Zonr Chang | e86245a | 2010-10-12 21:42:13 +0800 | [diff] [blame] | 1 | # |
| 2 | # Copyright (C) 2010 The Android Open Source Project |
| 3 | # |
| 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 | # |
Ying Wang | 94ca204 | 2014-08-01 14:20:35 -0700 | [diff] [blame] | 16 | LOCAL_PATH := $(call my-dir) |
Pirama Arumuga Nainar | f71356c | 2015-02-23 08:52:14 -0800 | [diff] [blame] | 17 | SLANG_ENABLE_ASSERTIONS := false |
Ying Wang | a20a2fd | 2011-03-30 12:58:06 -0700 | [diff] [blame] | 18 | |
| 19 | # The prebuilt tools should be used when we are doing app-only build. |
| 20 | ifeq ($(TARGET_BUILD_APPS),) |
| 21 | |
Shih-wei Liao | 462aefd | 2010-06-04 15:32:04 -0700 | [diff] [blame] | 22 | |
Stephen Hines | 7332039 | 2015-06-10 17:08:16 -0700 | [diff] [blame] | 23 | local_cflags_for_slang := -Wall -Werror -std=c++11 |
Tim Murray | 881abe9 | 2012-09-28 14:14:24 -0700 | [diff] [blame] | 24 | ifeq ($(TARGET_BUILD_VARIANT),eng) |
| 25 | local_cflags_for_slang += -O0 |
| 26 | else |
Jean-Luc Brouillet | 4324394 | 2014-05-23 10:17:22 -0700 | [diff] [blame] | 27 | ifeq ($(TARGET_BUILD_VARIANT),userdebug) |
| 28 | else |
Alex Sakhartchouk | 9be9360 | 2011-03-17 17:03:36 -0700 | [diff] [blame] | 29 | local_cflags_for_slang += -D__DISABLE_ASSERTS |
| 30 | endif |
Jean-Luc Brouillet | 4324394 | 2014-05-23 10:17:22 -0700 | [diff] [blame] | 31 | endif |
Stephen Hines | ba7c6dc | 2011-09-07 19:57:04 -0700 | [diff] [blame] | 32 | local_cflags_for_slang += -DTARGET_BUILD_VARIANT=$(TARGET_BUILD_VARIANT) |
Alex Sakhartchouk | 9be9360 | 2011-03-17 17:03:36 -0700 | [diff] [blame] | 33 | |
Stephen Hines | 483f47c | 2014-05-13 17:28:57 -0700 | [diff] [blame] | 34 | include $(LOCAL_PATH)/rs_version.mk |
| 35 | local_cflags_for_slang += $(RS_VERSION_DEFINE) |
Stephen Hines | 6b201eb | 2011-07-20 17:08:16 -0700 | [diff] [blame] | 36 | |
Pirama Arumuga Nainar | f71356c | 2015-02-23 08:52:14 -0800 | [diff] [blame] | 37 | ifeq ($(SLANG_ENABLE_ASSERTIONS),true) |
| 38 | local_cflags_for_slang += -D_DEBUG -UNDEBUG |
| 39 | endif |
| 40 | |
Ying Wang | 000c307 | 2011-01-27 19:06:02 -0800 | [diff] [blame] | 41 | static_libraries_needed_by_slang := \ |
Logan Chien | 9207a2e | 2011-10-21 15:39:28 +0800 | [diff] [blame] | 42 | libLLVMBitWriter_2_9 \ |
Stephen Hines | 9b044ec | 2011-11-23 16:30:16 -0800 | [diff] [blame] | 43 | libLLVMBitWriter_2_9_func \ |
Stephen Hines | bfe3e97 | 2013-02-27 13:52:15 -0800 | [diff] [blame] | 44 | libLLVMBitWriter_3_2 |
Zonr Chang | 08df36e | 2010-10-07 18:50:42 +0800 | [diff] [blame] | 45 | |
Ying Wang | 000c307 | 2011-01-27 19:06:02 -0800 | [diff] [blame] | 46 | # Static library libslang for host |
| 47 | # ======================================================== |
| 48 | include $(CLEAR_VARS) |
| 49 | include $(CLEAR_TBLGEN_VARS) |
| 50 | |
| 51 | LLVM_ROOT_PATH := external/llvm |
| 52 | CLANG_ROOT_PATH := external/clang |
| 53 | |
| 54 | include $(CLANG_ROOT_PATH)/clang.mk |
| 55 | |
| 56 | LOCAL_MODULE := libslang |
| 57 | LOCAL_MODULE_TAGS := optional |
Logan Chien | 231f578 | 2014-05-26 23:03:25 +0800 | [diff] [blame] | 58 | ifneq ($(HOST_OS),windows) |
Andrew Hsieh | 19bb5f5 | 2014-05-08 21:44:57 +0800 | [diff] [blame] | 59 | LOCAL_CLANG := true |
Logan Chien | 231f578 | 2014-05-26 23:03:25 +0800 | [diff] [blame] | 60 | endif |
Ying Wang | 000c307 | 2011-01-27 19:06:02 -0800 | [diff] [blame] | 61 | |
Alex Sakhartchouk | 9be9360 | 2011-03-17 17:03:36 -0700 | [diff] [blame] | 62 | LOCAL_CFLAGS += $(local_cflags_for_slang) |
Ying Wang | 000c307 | 2011-01-27 19:06:02 -0800 | [diff] [blame] | 63 | |
| 64 | TBLGEN_TABLES := \ |
| 65 | AttrList.inc \ |
| 66 | Attrs.inc \ |
Stephen Hines | 0da7f6c | 2013-03-05 15:19:02 -0800 | [diff] [blame] | 67 | CommentCommandList.inc \ |
Shih-wei Liao | 43730fe | 2012-08-02 23:06:18 -0700 | [diff] [blame] | 68 | CommentNodes.inc \ |
Ying Wang | 000c307 | 2011-01-27 19:06:02 -0800 | [diff] [blame] | 69 | DeclNodes.inc \ |
| 70 | DiagnosticCommonKinds.inc \ |
| 71 | DiagnosticFrontendKinds.inc \ |
| 72 | DiagnosticSemaKinds.inc \ |
| 73 | StmtNodes.inc |
| 74 | |
| 75 | LOCAL_SRC_FILES := \ |
| 76 | slang.cpp \ |
Ying Wang | 000c307 | 2011-01-27 19:06:02 -0800 | [diff] [blame] | 77 | slang_backend.cpp \ |
| 78 | slang_pragma_recorder.cpp \ |
| 79 | slang_diagnostic_buffer.cpp |
| 80 | |
Stephen Hines | 5e6d0d5 | 2011-11-22 19:42:41 -0800 | [diff] [blame] | 81 | LOCAL_C_INCLUDES += frameworks/compile/libbcc/include |
| 82 | |
Logan Chien | 231f578 | 2014-05-26 23:03:25 +0800 | [diff] [blame] | 83 | LOCAL_LDLIBS := -ldl -lpthread |
| 84 | ifneq ($(HOST_OS),windows) |
Stephen Hines | e1c25bd | 2014-10-06 12:33:18 -0700 | [diff] [blame] | 85 | LOCAL_CXX_STL := libc++ |
Logan Chien | 231f578 | 2014-05-26 23:03:25 +0800 | [diff] [blame] | 86 | endif |
Zonr Chang | 08df36e | 2010-10-07 18:50:42 +0800 | [diff] [blame] | 87 | |
| 88 | include $(CLANG_HOST_BUILD_MK) |
| 89 | include $(CLANG_TBLGEN_RULES_MK) |
| 90 | include $(LLVM_GEN_INTRINSICS_MK) |
Ying Wang | e2201c0 | 2011-01-11 17:29:32 -0800 | [diff] [blame] | 91 | include $(BUILD_HOST_STATIC_LIBRARY) |
Zonr Chang | 08df36e | 2010-10-07 18:50:42 +0800 | [diff] [blame] | 92 | |
Tobias Grosser | c908b90 | 2013-06-21 11:28:49 -0700 | [diff] [blame] | 93 | # ======================================================== |
| 94 | include $(CLEAR_VARS) |
| 95 | |
| 96 | LOCAL_MODULE := llvm-rs-as |
| 97 | LOCAL_MODULE_TAGS := optional |
| 98 | |
| 99 | LOCAL_MODULE_CLASS := EXECUTABLES |
| 100 | |
| 101 | LOCAL_SRC_FILES := \ |
| 102 | llvm-rs-as.cpp |
| 103 | |
| 104 | LOCAL_CFLAGS += $(local_cflags_for_slang) |
| 105 | LOCAL_STATIC_LIBRARIES := \ |
| 106 | libslang \ |
| 107 | $(static_libraries_needed_by_slang) |
| 108 | LOCAL_SHARED_LIBRARIES := \ |
| 109 | libLLVM |
| 110 | |
| 111 | include $(CLANG_HOST_BUILD_MK) |
| 112 | include $(BUILD_HOST_EXECUTABLE) |
| 113 | |
Shih-wei Liao | ffa58bb | 2010-10-10 14:15:13 -0700 | [diff] [blame] | 114 | # Executable llvm-rs-cc for host |
Shih-wei Liao | 835a7b7 | 2010-08-06 02:29:11 -0700 | [diff] [blame] | 115 | # ======================================================== |
| 116 | include $(CLEAR_VARS) |
| 117 | include $(CLEAR_TBLGEN_VARS) |
| 118 | |
Shih-wei Liao | b81c6a4 | 2010-10-10 14:15:00 -0700 | [diff] [blame] | 119 | LOCAL_IS_HOST_MODULE := true |
| 120 | LOCAL_MODULE := llvm-rs-cc |
Logan Chien | 231f578 | 2014-05-26 23:03:25 +0800 | [diff] [blame] | 121 | ifneq ($(HOST_OS),windows) |
Andrew Hsieh | 19bb5f5 | 2014-05-08 21:44:57 +0800 | [diff] [blame] | 122 | LOCAL_CLANG := true |
Logan Chien | 231f578 | 2014-05-26 23:03:25 +0800 | [diff] [blame] | 123 | endif |
Shih-wei Liao | b81c6a4 | 2010-10-10 14:15:00 -0700 | [diff] [blame] | 124 | LOCAL_MODULE_TAGS := optional |
Shih-wei Liao | 462aefd | 2010-06-04 15:32:04 -0700 | [diff] [blame] | 125 | |
Shih-wei Liao | bdd7888 | 2010-06-06 05:55:36 -0700 | [diff] [blame] | 126 | LOCAL_MODULE_CLASS := EXECUTABLES |
| 127 | |
Alex Sakhartchouk | 9be9360 | 2011-03-17 17:03:36 -0700 | [diff] [blame] | 128 | LOCAL_CFLAGS += $(local_cflags_for_slang) |
Shih-wei Liao | cecd11d | 2010-09-21 08:07:58 -0700 | [diff] [blame] | 129 | |
Shih-wei Liao | 462aefd | 2010-06-04 15:32:04 -0700 | [diff] [blame] | 130 | TBLGEN_TABLES := \ |
Shih-wei Liao | f52a620 | 2010-09-10 17:40:53 -0700 | [diff] [blame] | 131 | AttrList.inc \ |
| 132 | Attrs.inc \ |
Stephen Hines | 0da7f6c | 2013-03-05 15:19:02 -0800 | [diff] [blame] | 133 | CommentCommandList.inc \ |
Shih-wei Liao | 43730fe | 2012-08-02 23:06:18 -0700 | [diff] [blame] | 134 | CommentNodes.inc \ |
Shih-wei Liao | f52a620 | 2010-09-10 17:40:53 -0700 | [diff] [blame] | 135 | DeclNodes.inc \ |
| 136 | DiagnosticCommonKinds.inc \ |
Shih-wei Liao | b81c6a4 | 2010-10-10 14:15:00 -0700 | [diff] [blame] | 137 | DiagnosticDriverKinds.inc \ |
Zonr Chang | cf6af6a | 2010-10-12 12:38:51 +0800 | [diff] [blame] | 138 | DiagnosticFrontendKinds.inc \ |
Shih-wei Liao | b81c6a4 | 2010-10-10 14:15:00 -0700 | [diff] [blame] | 139 | DiagnosticSemaKinds.inc \ |
Zonr Chang | 92b344a | 2010-10-05 20:39:03 +0800 | [diff] [blame] | 140 | StmtNodes.inc \ |
Shih-wei Liao | b81c6a4 | 2010-10-10 14:15:00 -0700 | [diff] [blame] | 141 | RSCCOptions.inc |
Shih-wei Liao | 462aefd | 2010-06-04 15:32:04 -0700 | [diff] [blame] | 142 | |
| 143 | LOCAL_SRC_FILES := \ |
Shih-wei Liao | b81c6a4 | 2010-10-10 14:15:00 -0700 | [diff] [blame] | 144 | llvm-rs-cc.cpp \ |
Stephen Hines | 8b5c5c6 | 2014-06-06 18:03:18 -0700 | [diff] [blame] | 145 | rs_cc_options.cpp \ |
Stephen Hines | 292e00a | 2011-03-18 19:11:30 -0700 | [diff] [blame] | 146 | slang_rs_ast_replace.cpp \ |
Stephen Hines | 11274a7 | 2012-09-26 19:14:20 -0700 | [diff] [blame] | 147 | slang_rs_check_ast.cpp \ |
Shih-wei Liao | 462aefd | 2010-06-04 15:32:04 -0700 | [diff] [blame] | 148 | slang_rs_context.cpp \ |
| 149 | slang_rs_pragma_handler.cpp \ |
Zonr Chang | 641558f | 2010-10-12 21:07:06 +0800 | [diff] [blame] | 150 | slang_rs_exportable.cpp \ |
Shih-wei Liao | 462aefd | 2010-06-04 15:32:04 -0700 | [diff] [blame] | 151 | slang_rs_export_type.cpp \ |
| 152 | slang_rs_export_element.cpp \ |
| 153 | slang_rs_export_var.cpp \ |
| 154 | slang_rs_export_func.cpp \ |
Stephen Hines | 593a894 | 2011-05-10 15:29:50 -0700 | [diff] [blame] | 155 | slang_rs_export_foreach.cpp \ |
Stephen Hines | 4b32ffd | 2010-11-05 18:47:11 -0700 | [diff] [blame] | 156 | slang_rs_object_ref_count.cpp \ |
Ying Wang | 3f8b44d | 2010-09-04 01:17:01 -0700 | [diff] [blame] | 157 | slang_rs_reflection.cpp \ |
Jason Sams | 1b6a088 | 2012-03-12 15:07:58 -0700 | [diff] [blame] | 158 | slang_rs_reflection_cpp.cpp \ |
Stephen Hines | 552d872 | 2013-12-18 12:21:50 -0800 | [diff] [blame] | 159 | slang_rs_reflect_utils.cpp \ |
| 160 | strip_unknown_attributes.cpp |
Shih-wei Liao | 462aefd | 2010-06-04 15:32:04 -0700 | [diff] [blame] | 161 | |
David Gross | 18c50eb | 2015-01-30 11:39:22 -0800 | [diff] [blame] | 162 | LOCAL_C_INCLUDES += frameworks/compile/libbcc/include |
| 163 | |
Shih-wei Liao | 462aefd | 2010-06-04 15:32:04 -0700 | [diff] [blame] | 164 | LOCAL_STATIC_LIBRARIES := \ |
Stephen Hines | bfe3e97 | 2013-02-27 13:52:15 -0800 | [diff] [blame] | 165 | libslang \ |
Ying Wang | 000c307 | 2011-01-27 19:06:02 -0800 | [diff] [blame] | 166 | $(static_libraries_needed_by_slang) |
Ying Wang | e2201c0 | 2011-01-11 17:29:32 -0800 | [diff] [blame] | 167 | |
Stephen Hines | bfe3e97 | 2013-02-27 13:52:15 -0800 | [diff] [blame] | 168 | LOCAL_SHARED_LIBRARIES := \ |
| 169 | libclang \ |
| 170 | libLLVM |
| 171 | |
Raphael | 11e2b93 | 2011-01-13 15:13:35 -0800 | [diff] [blame] | 172 | ifeq ($(HOST_OS),windows) |
| 173 | LOCAL_LDLIBS := -limagehlp -lpsapi |
| 174 | else |
| 175 | LOCAL_LDLIBS := -ldl -lpthread |
| 176 | endif |
Shih-wei Liao | 462aefd | 2010-06-04 15:32:04 -0700 | [diff] [blame] | 177 | |
Shih-wei Liao | b81c6a4 | 2010-10-10 14:15:00 -0700 | [diff] [blame] | 178 | # For build RSCCOptions.inc from RSCCOptions.td |
Ying Wang | d1e54f5 | 2014-05-20 15:53:17 -0700 | [diff] [blame] | 179 | intermediates := $(call local-generated-sources-dir) |
Shih-wei Liao | b81c6a4 | 2010-10-10 14:15:00 -0700 | [diff] [blame] | 180 | LOCAL_GENERATED_SOURCES += $(intermediates)/RSCCOptions.inc |
Tim Murray | 0e3f8c7 | 2014-06-04 12:24:50 -0700 | [diff] [blame] | 181 | $(intermediates)/RSCCOptions.inc: $(LOCAL_PATH)/RSCCOptions.td $(LLVM_ROOT_PATH)/include/llvm/Option/OptParser.td $(LLVM_TBLGEN) |
Stephen Hines | b7d1269 | 2011-09-02 18:16:19 -0700 | [diff] [blame] | 182 | @echo "Building Renderscript compiler (llvm-rs-cc) Option tables with tblgen" |
Stephen Hines | a1f95ee | 2013-08-09 01:26:08 -0700 | [diff] [blame] | 183 | $(call transform-host-td-to-out,opt-parser-defs) |
Shih-wei Liao | b81c6a4 | 2010-10-10 14:15:00 -0700 | [diff] [blame] | 184 | |
Shih-wei Liao | 462aefd | 2010-06-04 15:32:04 -0700 | [diff] [blame] | 185 | include $(CLANG_HOST_BUILD_MK) |
| 186 | include $(CLANG_TBLGEN_RULES_MK) |
| 187 | include $(BUILD_HOST_EXECUTABLE) |
Ying Wang | a20a2fd | 2011-03-30 12:58:06 -0700 | [diff] [blame] | 188 | |
| 189 | endif # TARGET_BUILD_APPS |
Stephen Hines | 4cc499d | 2011-08-24 19:06:17 -0700 | [diff] [blame] | 190 | |
| 191 | #===================================================================== |
| 192 | # Include Subdirectories |
| 193 | #===================================================================== |
| 194 | include $(call all-makefiles-under,$(LOCAL_PATH)) |