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