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 | a20a2fd | 2011-03-30 12:58:06 -0700 | [diff] [blame] | 16 | |
| 17 | # The prebuilt tools should be used when we are doing app-only build. |
| 18 | ifeq ($(TARGET_BUILD_APPS),) |
| 19 | |
Shih-wei Liao | 462aefd | 2010-06-04 15:32:04 -0700 | [diff] [blame] | 20 | LOCAL_PATH := $(call my-dir) |
Shih-wei Liao | 462aefd | 2010-06-04 15:32:04 -0700 | [diff] [blame] | 21 | |
Alex Sakhartchouk | 9be9360 | 2011-03-17 17:03:36 -0700 | [diff] [blame] | 22 | local_cflags_for_slang := -Wno-sign-promo -Wall -Wno-unused-parameter -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 |
Alex Sakhartchouk | 9be9360 | 2011-03-17 17:03:36 -0700 | [diff] [blame] | 26 | local_cflags_for_slang += -D__DISABLE_ASSERTS |
| 27 | endif |
Stephen Hines | ba7c6dc | 2011-09-07 19:57:04 -0700 | [diff] [blame] | 28 | local_cflags_for_slang += -DTARGET_BUILD_VARIANT=$(TARGET_BUILD_VARIANT) |
Alex Sakhartchouk | 9be9360 | 2011-03-17 17:03:36 -0700 | [diff] [blame] | 29 | |
Stephen Hines | 9221935 | 2012-12-12 16:54:43 -0800 | [diff] [blame] | 30 | ifeq "REL" "$(PLATFORM_VERSION_CODENAME)" |
| 31 | RS_VERSION := $(PLATFORM_SDK_VERSION) |
| 32 | else |
| 33 | # Increment by 1 whenever this is not a final release build, since we want to |
| 34 | # be able to see the RS version number change during development. |
| 35 | # See build/core/version_defaults.mk for more information about this. |
| 36 | RS_VERSION := "(1 + $(PLATFORM_SDK_VERSION))" |
| 37 | endif |
Stephen Hines | 2e35b13 | 2011-07-22 02:50:19 -0700 | [diff] [blame] | 38 | local_cflags_for_slang += -DRS_VERSION=$(RS_VERSION) |
Stephen Hines | 6b201eb | 2011-07-20 17:08:16 -0700 | [diff] [blame] | 39 | |
Ying Wang | 000c307 | 2011-01-27 19:06:02 -0800 | [diff] [blame] | 40 | static_libraries_needed_by_slang := \ |
Stephen Hines | 376dc03 | 2012-08-23 00:22:25 -0700 | [diff] [blame] | 41 | libclangParse \ |
| 42 | libclangSema \ |
| 43 | libclangAnalysis \ |
| 44 | libclangCodeGen \ |
| 45 | libclangAST \ |
Stephen Hines | 376dc03 | 2012-08-23 00:22:25 -0700 | [diff] [blame] | 46 | libclangEdit \ |
Stephen Hines | 23c4358 | 2013-01-09 20:02:04 -0800 | [diff] [blame] | 47 | libclangLex \ |
Stephen Hines | 376dc03 | 2012-08-23 00:22:25 -0700 | [diff] [blame] | 48 | libclangFrontend \ |
| 49 | libclangBasic \ |
| 50 | libclangSerialization \ |
Logan Chien | 9207a2e | 2011-10-21 15:39:28 +0800 | [diff] [blame] | 51 | libLLVMLinker \ |
| 52 | libLLVMipo \ |
| 53 | libLLVMBitWriter \ |
| 54 | libLLVMBitWriter_2_9 \ |
Stephen Hines | 9b044ec | 2011-11-23 16:30:16 -0800 | [diff] [blame] | 55 | libLLVMBitWriter_2_9_func \ |
Stephen Hines | d711dec | 2013-01-08 16:23:30 -0800 | [diff] [blame] | 56 | libLLVMBitWriter_3_2 \ |
Logan Chien | 9207a2e | 2011-10-21 15:39:28 +0800 | [diff] [blame] | 57 | libLLVMBitReader \ |
| 58 | libLLVMARMCodeGen \ |
Stephen Hines | 376dc03 | 2012-08-23 00:22:25 -0700 | [diff] [blame] | 59 | libLLVMARMAsmParser \ |
Logan Chien | 9207a2e | 2011-10-21 15:39:28 +0800 | [diff] [blame] | 60 | libLLVMARMAsmPrinter \ |
| 61 | libLLVMARMInfo \ |
| 62 | libLLVMARMDesc \ |
| 63 | libLLVMX86CodeGen \ |
| 64 | libLLVMX86Info \ |
| 65 | libLLVMX86Desc \ |
Stephen Hines | 376dc03 | 2012-08-23 00:22:25 -0700 | [diff] [blame] | 66 | libLLVMX86AsmParser \ |
Logan Chien | 9207a2e | 2011-10-21 15:39:28 +0800 | [diff] [blame] | 67 | libLLVMX86AsmPrinter \ |
| 68 | libLLVMX86Utils \ |
Stephen Hines | 376dc03 | 2012-08-23 00:22:25 -0700 | [diff] [blame] | 69 | libLLVMMipsCodeGen \ |
| 70 | libLLVMMipsInfo \ |
| 71 | libLLVMMipsDesc \ |
| 72 | libLLVMMipsAsmParser \ |
| 73 | libLLVMMipsAsmPrinter \ |
Logan Chien | 9207a2e | 2011-10-21 15:39:28 +0800 | [diff] [blame] | 74 | libLLVMAsmPrinter \ |
| 75 | libLLVMSelectionDAG \ |
| 76 | libLLVMCodeGen \ |
| 77 | libLLVMScalarOpts \ |
| 78 | libLLVMInstCombine \ |
Logan Chien | 9207a2e | 2011-10-21 15:39:28 +0800 | [diff] [blame] | 79 | libLLVMInstrumentation \ |
Shih-wei Liao | 43730fe | 2012-08-02 23:06:18 -0700 | [diff] [blame] | 80 | libLLVMTransformUtils \ |
Logan Chien | 9207a2e | 2011-10-21 15:39:28 +0800 | [diff] [blame] | 81 | libLLVMipa \ |
| 82 | libLLVMAnalysis \ |
| 83 | libLLVMTarget \ |
| 84 | libLLVMMC \ |
| 85 | libLLVMMCParser \ |
| 86 | libLLVMCore \ |
Stephen Hines | 376dc03 | 2012-08-23 00:22:25 -0700 | [diff] [blame] | 87 | libLLVMArchive \ |
| 88 | libLLVMAsmParser \ |
Stephen Hines | 0444de0 | 2012-03-02 23:19:06 -0800 | [diff] [blame] | 89 | libLLVMSupport \ |
| 90 | libLLVMVectorize |
Zonr Chang | 08df36e | 2010-10-07 18:50:42 +0800 | [diff] [blame] | 91 | |
Ying Wang | 000c307 | 2011-01-27 19:06:02 -0800 | [diff] [blame] | 92 | # Static library libslang for host |
| 93 | # ======================================================== |
| 94 | include $(CLEAR_VARS) |
| 95 | include $(CLEAR_TBLGEN_VARS) |
| 96 | |
| 97 | LLVM_ROOT_PATH := external/llvm |
| 98 | CLANG_ROOT_PATH := external/clang |
| 99 | |
| 100 | include $(CLANG_ROOT_PATH)/clang.mk |
| 101 | |
| 102 | LOCAL_MODULE := libslang |
| 103 | LOCAL_MODULE_TAGS := optional |
| 104 | |
Alex Sakhartchouk | 9be9360 | 2011-03-17 17:03:36 -0700 | [diff] [blame] | 105 | LOCAL_CFLAGS += $(local_cflags_for_slang) |
Ying Wang | 000c307 | 2011-01-27 19:06:02 -0800 | [diff] [blame] | 106 | |
| 107 | TBLGEN_TABLES := \ |
| 108 | AttrList.inc \ |
| 109 | Attrs.inc \ |
Shih-wei Liao | 43730fe | 2012-08-02 23:06:18 -0700 | [diff] [blame] | 110 | CommentNodes.inc \ |
Ying Wang | 000c307 | 2011-01-27 19:06:02 -0800 | [diff] [blame] | 111 | DeclNodes.inc \ |
| 112 | DiagnosticCommonKinds.inc \ |
| 113 | DiagnosticFrontendKinds.inc \ |
| 114 | DiagnosticSemaKinds.inc \ |
| 115 | StmtNodes.inc |
| 116 | |
| 117 | LOCAL_SRC_FILES := \ |
| 118 | slang.cpp \ |
| 119 | slang_utils.cpp \ |
| 120 | slang_backend.cpp \ |
| 121 | slang_pragma_recorder.cpp \ |
| 122 | slang_diagnostic_buffer.cpp |
| 123 | |
Stephen Hines | 5e6d0d5 | 2011-11-22 19:42:41 -0800 | [diff] [blame] | 124 | LOCAL_C_INCLUDES += frameworks/compile/libbcc/include |
| 125 | |
Zonr Chang | 08df36e | 2010-10-07 18:50:42 +0800 | [diff] [blame] | 126 | LOCAL_LDLIBS := -ldl -lpthread |
| 127 | |
| 128 | include $(CLANG_HOST_BUILD_MK) |
| 129 | include $(CLANG_TBLGEN_RULES_MK) |
| 130 | include $(LLVM_GEN_INTRINSICS_MK) |
Ying Wang | e2201c0 | 2011-01-11 17:29:32 -0800 | [diff] [blame] | 131 | include $(BUILD_HOST_STATIC_LIBRARY) |
Zonr Chang | 08df36e | 2010-10-07 18:50:42 +0800 | [diff] [blame] | 132 | |
Zonr Chang | a02010c | 2010-10-11 20:54:28 +0800 | [diff] [blame] | 133 | # Host static library containing rslib.bc |
| 134 | # ======================================================== |
| 135 | include $(CLEAR_VARS) |
| 136 | |
| 137 | input_data_file := frameworks/compile/slang/rslib.bc |
| 138 | slangdata_output_var_name := rslib_bc |
| 139 | |
| 140 | LOCAL_IS_HOST_MODULE := true |
| 141 | LOCAL_MODULE := librslib |
| 142 | LOCAL_MODULE_TAGS := optional |
| 143 | |
Shih-wei Liao | 5dee956 | 2011-01-13 02:16:00 -0800 | [diff] [blame] | 144 | LOCAL_MODULE_CLASS := STATIC_LIBRARIES |
Shih-wei Liao | 9923021 | 2011-01-13 01:09:03 -0800 | [diff] [blame] | 145 | |
Zonr Chang | a02010c | 2010-10-11 20:54:28 +0800 | [diff] [blame] | 146 | include $(LOCAL_PATH)/SlangData.mk |
Shih-wei Liao | 5dee956 | 2011-01-13 02:16:00 -0800 | [diff] [blame] | 147 | include $(BUILD_HOST_STATIC_LIBRARY) |
Shih-wei Liao | 9901f89 | 2011-01-13 00:23:47 -0800 | [diff] [blame] | 148 | |
| 149 | # Executable slang-data for host |
| 150 | # ======================================================== |
| 151 | include $(CLEAR_VARS) |
| 152 | |
| 153 | LOCAL_MODULE := slang-data |
| 154 | LOCAL_MODULE_TAGS := optional |
| 155 | |
| 156 | LOCAL_MODULE_CLASS := EXECUTABLES |
| 157 | |
| 158 | LOCAL_SRC_FILES := slang-data.c |
| 159 | |
| 160 | include $(BUILD_HOST_EXECUTABLE) |
Zonr Chang | a02010c | 2010-10-11 20:54:28 +0800 | [diff] [blame] | 161 | |
Zonr Chang | a65ec16 | 2010-10-17 01:53:05 +0800 | [diff] [blame] | 162 | # Executable rs-spec-gen for host |
| 163 | # ======================================================== |
| 164 | include $(CLEAR_VARS) |
| 165 | |
| 166 | LOCAL_MODULE := rs-spec-gen |
| 167 | LOCAL_MODULE_TAGS := optional |
| 168 | |
| 169 | LOCAL_MODULE_CLASS := EXECUTABLES |
| 170 | |
| 171 | LOCAL_SRC_FILES := \ |
| 172 | slang_rs_spec_table.cpp |
| 173 | |
| 174 | include $(BUILD_HOST_EXECUTABLE) |
| 175 | |
Shih-wei Liao | ffa58bb | 2010-10-10 14:15:13 -0700 | [diff] [blame] | 176 | # Executable llvm-rs-cc for host |
Shih-wei Liao | 835a7b7 | 2010-08-06 02:29:11 -0700 | [diff] [blame] | 177 | # ======================================================== |
| 178 | include $(CLEAR_VARS) |
| 179 | include $(CLEAR_TBLGEN_VARS) |
| 180 | |
Shih-wei Liao | b81c6a4 | 2010-10-10 14:15:00 -0700 | [diff] [blame] | 181 | LOCAL_IS_HOST_MODULE := true |
| 182 | LOCAL_MODULE := llvm-rs-cc |
| 183 | LOCAL_MODULE_TAGS := optional |
Shih-wei Liao | 462aefd | 2010-06-04 15:32:04 -0700 | [diff] [blame] | 184 | |
Shih-wei Liao | bdd7888 | 2010-06-06 05:55:36 -0700 | [diff] [blame] | 185 | LOCAL_MODULE_CLASS := EXECUTABLES |
| 186 | |
Alex Sakhartchouk | 9be9360 | 2011-03-17 17:03:36 -0700 | [diff] [blame] | 187 | LOCAL_CFLAGS += $(local_cflags_for_slang) |
Shih-wei Liao | cecd11d | 2010-09-21 08:07:58 -0700 | [diff] [blame] | 188 | |
Shih-wei Liao | 462aefd | 2010-06-04 15:32:04 -0700 | [diff] [blame] | 189 | TBLGEN_TABLES := \ |
Shih-wei Liao | f52a620 | 2010-09-10 17:40:53 -0700 | [diff] [blame] | 190 | AttrList.inc \ |
| 191 | Attrs.inc \ |
Shih-wei Liao | 43730fe | 2012-08-02 23:06:18 -0700 | [diff] [blame] | 192 | CommentNodes.inc \ |
Shih-wei Liao | f52a620 | 2010-09-10 17:40:53 -0700 | [diff] [blame] | 193 | DeclNodes.inc \ |
| 194 | DiagnosticCommonKinds.inc \ |
Shih-wei Liao | b81c6a4 | 2010-10-10 14:15:00 -0700 | [diff] [blame] | 195 | DiagnosticDriverKinds.inc \ |
Zonr Chang | cf6af6a | 2010-10-12 12:38:51 +0800 | [diff] [blame] | 196 | DiagnosticFrontendKinds.inc \ |
Shih-wei Liao | b81c6a4 | 2010-10-10 14:15:00 -0700 | [diff] [blame] | 197 | DiagnosticSemaKinds.inc \ |
Zonr Chang | 92b344a | 2010-10-05 20:39:03 +0800 | [diff] [blame] | 198 | StmtNodes.inc \ |
Shih-wei Liao | b81c6a4 | 2010-10-10 14:15:00 -0700 | [diff] [blame] | 199 | RSCCOptions.inc |
Shih-wei Liao | 462aefd | 2010-06-04 15:32:04 -0700 | [diff] [blame] | 200 | |
Zonr Chang | a65ec16 | 2010-10-17 01:53:05 +0800 | [diff] [blame] | 201 | RS_SPEC_TABLES := \ |
| 202 | RSClangBuiltinEnums.inc \ |
| 203 | RSDataTypeEnums.inc \ |
| 204 | RSDataElementEnums.inc \ |
Zonr Chang | b1771ef | 2010-10-22 18:03:46 +0800 | [diff] [blame] | 205 | RSMatrixTypeEnums.inc \ |
Zonr Chang | a65ec16 | 2010-10-17 01:53:05 +0800 | [diff] [blame] | 206 | RSObjectTypeEnums.inc |
| 207 | |
Shih-wei Liao | 462aefd | 2010-06-04 15:32:04 -0700 | [diff] [blame] | 208 | LOCAL_SRC_FILES := \ |
Shih-wei Liao | b81c6a4 | 2010-10-10 14:15:00 -0700 | [diff] [blame] | 209 | llvm-rs-cc.cpp \ |
Zonr Chang | 3a9ca1f | 2010-10-06 17:52:56 +0800 | [diff] [blame] | 210 | slang_rs.cpp \ |
Stephen Hines | 292e00a | 2011-03-18 19:11:30 -0700 | [diff] [blame] | 211 | slang_rs_ast_replace.cpp \ |
Stephen Hines | 11274a7 | 2012-09-26 19:14:20 -0700 | [diff] [blame] | 212 | slang_rs_check_ast.cpp \ |
Shih-wei Liao | 462aefd | 2010-06-04 15:32:04 -0700 | [diff] [blame] | 213 | slang_rs_context.cpp \ |
| 214 | slang_rs_pragma_handler.cpp \ |
| 215 | slang_rs_backend.cpp \ |
Zonr Chang | 641558f | 2010-10-12 21:07:06 +0800 | [diff] [blame] | 216 | slang_rs_exportable.cpp \ |
Shih-wei Liao | 462aefd | 2010-06-04 15:32:04 -0700 | [diff] [blame] | 217 | slang_rs_export_type.cpp \ |
| 218 | slang_rs_export_element.cpp \ |
| 219 | slang_rs_export_var.cpp \ |
| 220 | slang_rs_export_func.cpp \ |
Stephen Hines | 593a894 | 2011-05-10 15:29:50 -0700 | [diff] [blame] | 221 | slang_rs_export_foreach.cpp \ |
Stephen Hines | 4b32ffd | 2010-11-05 18:47:11 -0700 | [diff] [blame] | 222 | slang_rs_object_ref_count.cpp \ |
Ying Wang | 3f8b44d | 2010-09-04 01:17:01 -0700 | [diff] [blame] | 223 | slang_rs_reflection.cpp \ |
Jason Sams | 1b6a088 | 2012-03-12 15:07:58 -0700 | [diff] [blame] | 224 | slang_rs_reflection_base.cpp \ |
| 225 | slang_rs_reflection_cpp.cpp \ |
| 226 | slang_rs_reflect_utils.cpp |
Shih-wei Liao | 462aefd | 2010-06-04 15:32:04 -0700 | [diff] [blame] | 227 | |
| 228 | LOCAL_STATIC_LIBRARIES := \ |
Ying Wang | 000c307 | 2011-01-27 19:06:02 -0800 | [diff] [blame] | 229 | libclangDriver libslang \ |
| 230 | $(static_libraries_needed_by_slang) |
Ying Wang | e2201c0 | 2011-01-11 17:29:32 -0800 | [diff] [blame] | 231 | |
Raphael | 11e2b93 | 2011-01-13 15:13:35 -0800 | [diff] [blame] | 232 | ifeq ($(HOST_OS),windows) |
| 233 | LOCAL_LDLIBS := -limagehlp -lpsapi |
| 234 | else |
| 235 | LOCAL_LDLIBS := -ldl -lpthread |
| 236 | endif |
Shih-wei Liao | 462aefd | 2010-06-04 15:32:04 -0700 | [diff] [blame] | 237 | |
Shih-wei Liao | b81c6a4 | 2010-10-10 14:15:00 -0700 | [diff] [blame] | 238 | # For build RSCCOptions.inc from RSCCOptions.td |
| 239 | intermediates := $(call local-intermediates-dir) |
| 240 | LOCAL_GENERATED_SOURCES += $(intermediates)/RSCCOptions.inc |
Logan Chien | f612c7a | 2011-10-28 08:54:54 +0800 | [diff] [blame] | 241 | $(intermediates)/RSCCOptions.inc: $(LOCAL_PATH)/RSCCOptions.td $(CLANG_ROOT_PATH)/include/clang/Driver/OptParser.td $(CLANG_TBLGEN) |
Stephen Hines | b7d1269 | 2011-09-02 18:16:19 -0700 | [diff] [blame] | 242 | @echo "Building Renderscript compiler (llvm-rs-cc) Option tables with tblgen" |
Logan Chien | 9207a2e | 2011-10-21 15:39:28 +0800 | [diff] [blame] | 243 | $(call transform-host-clang-td-to-out,opt-parser-defs) |
Shih-wei Liao | b81c6a4 | 2010-10-10 14:15:00 -0700 | [diff] [blame] | 244 | |
Zonr Chang | a65ec16 | 2010-10-17 01:53:05 +0800 | [diff] [blame] | 245 | include frameworks/compile/slang/RSSpec.mk |
Shih-wei Liao | 462aefd | 2010-06-04 15:32:04 -0700 | [diff] [blame] | 246 | include $(CLANG_HOST_BUILD_MK) |
| 247 | include $(CLANG_TBLGEN_RULES_MK) |
| 248 | include $(BUILD_HOST_EXECUTABLE) |
Ying Wang | a20a2fd | 2011-03-30 12:58:06 -0700 | [diff] [blame] | 249 | |
| 250 | endif # TARGET_BUILD_APPS |
Stephen Hines | 4cc499d | 2011-08-24 19:06:17 -0700 | [diff] [blame] | 251 | |
| 252 | #===================================================================== |
| 253 | # Include Subdirectories |
| 254 | #===================================================================== |
| 255 | include $(call all-makefiles-under,$(LOCAL_PATH)) |