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