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 | # |
Shih-wei Liao | 462aefd | 2010-06-04 15:32:04 -0700 | [diff] [blame] | 16 | LOCAL_PATH := $(call my-dir) |
Shih-wei Liao | 462aefd | 2010-06-04 15:32:04 -0700 | [diff] [blame] | 17 | |
Ying Wang | 000c307 | 2011-01-27 19:06:02 -0800 | [diff] [blame^] | 18 | static_libraries_needed_by_slang := \ |
Zonr Chang | 08df36e | 2010-10-07 18:50:42 +0800 | [diff] [blame] | 19 | libLLVMLinker \ |
| 20 | libLLVMipo \ |
| 21 | libLLVMBitWriter \ |
| 22 | libLLVMBitReader \ |
| 23 | libLLVMARMAsmPrinter \ |
| 24 | libLLVMX86AsmPrinter \ |
| 25 | libLLVMAsmPrinter \ |
| 26 | libLLVMMCParser \ |
| 27 | libLLVMARMCodeGen \ |
| 28 | libLLVMARMInfo \ |
| 29 | libLLVMX86CodeGen \ |
| 30 | libLLVMX86Info \ |
| 31 | libLLVMSelectionDAG \ |
| 32 | libLLVMCodeGen \ |
| 33 | libLLVMScalarOpts \ |
| 34 | libLLVMInstCombine \ |
| 35 | libLLVMTransformUtils \ |
| 36 | libLLVMInstrumentation \ |
| 37 | libLLVMipa \ |
| 38 | libLLVMAnalysis \ |
| 39 | libLLVMTarget \ |
| 40 | libLLVMMC \ |
| 41 | libLLVMCore \ |
| 42 | libclangParse \ |
| 43 | libclangSema \ |
| 44 | libclangAnalysis \ |
| 45 | libclangAST \ |
| 46 | libclangLex \ |
| 47 | libclangFrontend \ |
| 48 | libclangCodeGen \ |
| 49 | libclangBasic \ |
| 50 | libLLVMSupport \ |
| 51 | libLLVMSystem |
| 52 | |
Ying Wang | 000c307 | 2011-01-27 19:06:02 -0800 | [diff] [blame^] | 53 | # Static library libslang for host |
| 54 | # ======================================================== |
| 55 | include $(CLEAR_VARS) |
| 56 | include $(CLEAR_TBLGEN_VARS) |
| 57 | |
| 58 | LLVM_ROOT_PATH := external/llvm |
| 59 | CLANG_ROOT_PATH := external/clang |
| 60 | |
| 61 | include $(CLANG_ROOT_PATH)/clang.mk |
| 62 | |
| 63 | LOCAL_MODULE := libslang |
| 64 | LOCAL_MODULE_TAGS := optional |
| 65 | |
| 66 | LOCAL_CFLAGS += -Wno-sign-promo |
| 67 | |
| 68 | TBLGEN_TABLES := \ |
| 69 | AttrList.inc \ |
| 70 | Attrs.inc \ |
| 71 | DeclNodes.inc \ |
| 72 | DiagnosticCommonKinds.inc \ |
| 73 | DiagnosticFrontendKinds.inc \ |
| 74 | DiagnosticSemaKinds.inc \ |
| 75 | StmtNodes.inc |
| 76 | |
| 77 | LOCAL_SRC_FILES := \ |
| 78 | slang.cpp \ |
| 79 | slang_utils.cpp \ |
| 80 | slang_backend.cpp \ |
| 81 | slang_pragma_recorder.cpp \ |
| 82 | slang_diagnostic_buffer.cpp |
| 83 | |
Zonr Chang | 08df36e | 2010-10-07 18:50:42 +0800 | [diff] [blame] | 84 | LOCAL_LDLIBS := -ldl -lpthread |
| 85 | |
| 86 | include $(CLANG_HOST_BUILD_MK) |
| 87 | include $(CLANG_TBLGEN_RULES_MK) |
| 88 | include $(LLVM_GEN_INTRINSICS_MK) |
Ying Wang | e2201c0 | 2011-01-11 17:29:32 -0800 | [diff] [blame] | 89 | include $(BUILD_HOST_STATIC_LIBRARY) |
Zonr Chang | 08df36e | 2010-10-07 18:50:42 +0800 | [diff] [blame] | 90 | |
Zonr Chang | a02010c | 2010-10-11 20:54:28 +0800 | [diff] [blame] | 91 | # Host static library containing rslib.bc |
| 92 | # ======================================================== |
| 93 | include $(CLEAR_VARS) |
| 94 | |
| 95 | input_data_file := frameworks/compile/slang/rslib.bc |
| 96 | slangdata_output_var_name := rslib_bc |
| 97 | |
| 98 | LOCAL_IS_HOST_MODULE := true |
| 99 | LOCAL_MODULE := librslib |
| 100 | LOCAL_MODULE_TAGS := optional |
| 101 | |
Shih-wei Liao | 5dee956 | 2011-01-13 02:16:00 -0800 | [diff] [blame] | 102 | LOCAL_MODULE_CLASS := STATIC_LIBRARIES |
Shih-wei Liao | 9923021 | 2011-01-13 01:09:03 -0800 | [diff] [blame] | 103 | |
Zonr Chang | a02010c | 2010-10-11 20:54:28 +0800 | [diff] [blame] | 104 | include $(LOCAL_PATH)/SlangData.mk |
Shih-wei Liao | 5dee956 | 2011-01-13 02:16:00 -0800 | [diff] [blame] | 105 | include $(BUILD_HOST_STATIC_LIBRARY) |
Shih-wei Liao | 9901f89 | 2011-01-13 00:23:47 -0800 | [diff] [blame] | 106 | |
| 107 | # Executable slang-data for host |
| 108 | # ======================================================== |
| 109 | include $(CLEAR_VARS) |
| 110 | |
| 111 | LOCAL_MODULE := slang-data |
| 112 | LOCAL_MODULE_TAGS := optional |
| 113 | |
| 114 | LOCAL_MODULE_CLASS := EXECUTABLES |
| 115 | |
| 116 | LOCAL_SRC_FILES := slang-data.c |
| 117 | |
| 118 | include $(BUILD_HOST_EXECUTABLE) |
Zonr Chang | a02010c | 2010-10-11 20:54:28 +0800 | [diff] [blame] | 119 | |
Zonr Chang | 3c250c5 | 2010-10-07 12:19:23 +0800 | [diff] [blame] | 120 | # Executable llvm-rs-link for host |
Shih-wei Liao | 462aefd | 2010-06-04 15:32:04 -0700 | [diff] [blame] | 121 | # ======================================================== |
| 122 | include $(CLEAR_VARS) |
| 123 | include $(CLEAR_TBLGEN_VARS) |
| 124 | |
Zonr Chang | 08df36e | 2010-10-07 18:50:42 +0800 | [diff] [blame] | 125 | include $(LLVM_ROOT_PATH)/llvm.mk |
| 126 | |
Shih-wei Liao | 835a7b7 | 2010-08-06 02:29:11 -0700 | [diff] [blame] | 127 | LOCAL_MODULE := llvm-rs-link |
Zonr Chang | a02010c | 2010-10-11 20:54:28 +0800 | [diff] [blame] | 128 | LOCAL_MODULE_TAGS := optional |
Shih-wei Liao | 835a7b7 | 2010-08-06 02:29:11 -0700 | [diff] [blame] | 129 | |
| 130 | LOCAL_MODULE_CLASS := EXECUTABLES |
| 131 | |
| 132 | LOCAL_SRC_FILES := \ |
Zonr Chang | 92b344a | 2010-10-05 20:39:03 +0800 | [diff] [blame] | 133 | llvm-rs-link.cpp |
Shih-wei Liao | 835a7b7 | 2010-08-06 02:29:11 -0700 | [diff] [blame] | 134 | |
Zonr Chang | a02010c | 2010-10-11 20:54:28 +0800 | [diff] [blame] | 135 | LOCAL_STATIC_LIBRARIES := \ |
Ying Wang | 000c307 | 2011-01-27 19:06:02 -0800 | [diff] [blame^] | 136 | librslib libslang \ |
| 137 | $(static_libraries_needed_by_slang) |
Zonr Chang | a02010c | 2010-10-11 20:54:28 +0800 | [diff] [blame] | 138 | |
Shih-wei Liao | 835a7b7 | 2010-08-06 02:29:11 -0700 | [diff] [blame] | 139 | LOCAL_LDLIBS := -ldl -lpthread |
| 140 | |
| 141 | include $(LLVM_HOST_BUILD_MK) |
| 142 | include $(LLVM_GEN_INTRINSICS_MK) |
| 143 | include $(BUILD_HOST_EXECUTABLE) |
| 144 | |
Zonr Chang | a65ec16 | 2010-10-17 01:53:05 +0800 | [diff] [blame] | 145 | # Executable rs-spec-gen for host |
| 146 | # ======================================================== |
| 147 | include $(CLEAR_VARS) |
| 148 | |
| 149 | LOCAL_MODULE := rs-spec-gen |
| 150 | LOCAL_MODULE_TAGS := optional |
| 151 | |
| 152 | LOCAL_MODULE_CLASS := EXECUTABLES |
| 153 | |
| 154 | LOCAL_SRC_FILES := \ |
| 155 | slang_rs_spec_table.cpp |
| 156 | |
| 157 | include $(BUILD_HOST_EXECUTABLE) |
| 158 | |
Shih-wei Liao | ffa58bb | 2010-10-10 14:15:13 -0700 | [diff] [blame] | 159 | # Executable llvm-rs-cc for host |
Shih-wei Liao | 835a7b7 | 2010-08-06 02:29:11 -0700 | [diff] [blame] | 160 | # ======================================================== |
| 161 | include $(CLEAR_VARS) |
| 162 | include $(CLEAR_TBLGEN_VARS) |
| 163 | |
Shih-wei Liao | b81c6a4 | 2010-10-10 14:15:00 -0700 | [diff] [blame] | 164 | LOCAL_IS_HOST_MODULE := true |
| 165 | LOCAL_MODULE := llvm-rs-cc |
| 166 | LOCAL_MODULE_TAGS := optional |
Shih-wei Liao | 462aefd | 2010-06-04 15:32:04 -0700 | [diff] [blame] | 167 | |
Shih-wei Liao | bdd7888 | 2010-06-06 05:55:36 -0700 | [diff] [blame] | 168 | LOCAL_MODULE_CLASS := EXECUTABLES |
| 169 | |
Shih-wei Liao | cecd11d | 2010-09-21 08:07:58 -0700 | [diff] [blame] | 170 | LOCAL_CFLAGS += -Wno-sign-promo |
| 171 | |
Shih-wei Liao | 462aefd | 2010-06-04 15:32:04 -0700 | [diff] [blame] | 172 | TBLGEN_TABLES := \ |
Shih-wei Liao | f52a620 | 2010-09-10 17:40:53 -0700 | [diff] [blame] | 173 | AttrList.inc \ |
| 174 | Attrs.inc \ |
| 175 | DeclNodes.inc \ |
| 176 | DiagnosticCommonKinds.inc \ |
Shih-wei Liao | b81c6a4 | 2010-10-10 14:15:00 -0700 | [diff] [blame] | 177 | DiagnosticDriverKinds.inc \ |
Zonr Chang | cf6af6a | 2010-10-12 12:38:51 +0800 | [diff] [blame] | 178 | DiagnosticFrontendKinds.inc \ |
Shih-wei Liao | b81c6a4 | 2010-10-10 14:15:00 -0700 | [diff] [blame] | 179 | DiagnosticSemaKinds.inc \ |
Zonr Chang | 92b344a | 2010-10-05 20:39:03 +0800 | [diff] [blame] | 180 | StmtNodes.inc \ |
Shih-wei Liao | b81c6a4 | 2010-10-10 14:15:00 -0700 | [diff] [blame] | 181 | RSCCOptions.inc |
Shih-wei Liao | 462aefd | 2010-06-04 15:32:04 -0700 | [diff] [blame] | 182 | |
Zonr Chang | a65ec16 | 2010-10-17 01:53:05 +0800 | [diff] [blame] | 183 | RS_SPEC_TABLES := \ |
| 184 | RSClangBuiltinEnums.inc \ |
| 185 | RSDataTypeEnums.inc \ |
| 186 | RSDataElementEnums.inc \ |
| 187 | RSDataKindEnums.inc \ |
Zonr Chang | b1771ef | 2010-10-22 18:03:46 +0800 | [diff] [blame] | 188 | RSMatrixTypeEnums.inc \ |
Zonr Chang | a65ec16 | 2010-10-17 01:53:05 +0800 | [diff] [blame] | 189 | RSObjectTypeEnums.inc |
| 190 | |
Shih-wei Liao | 462aefd | 2010-06-04 15:32:04 -0700 | [diff] [blame] | 191 | LOCAL_SRC_FILES := \ |
Shih-wei Liao | b81c6a4 | 2010-10-10 14:15:00 -0700 | [diff] [blame] | 192 | llvm-rs-cc.cpp \ |
Zonr Chang | 3a9ca1f | 2010-10-06 17:52:56 +0800 | [diff] [blame] | 193 | slang_rs.cpp \ |
Shih-wei Liao | 462aefd | 2010-06-04 15:32:04 -0700 | [diff] [blame] | 194 | slang_rs_context.cpp \ |
| 195 | slang_rs_pragma_handler.cpp \ |
| 196 | slang_rs_backend.cpp \ |
Zonr Chang | 641558f | 2010-10-12 21:07:06 +0800 | [diff] [blame] | 197 | slang_rs_exportable.cpp \ |
Shih-wei Liao | 462aefd | 2010-06-04 15:32:04 -0700 | [diff] [blame] | 198 | slang_rs_export_type.cpp \ |
| 199 | slang_rs_export_element.cpp \ |
| 200 | slang_rs_export_var.cpp \ |
| 201 | slang_rs_export_func.cpp \ |
Stephen Hines | 4b32ffd | 2010-11-05 18:47:11 -0700 | [diff] [blame] | 202 | slang_rs_object_ref_count.cpp \ |
Ying Wang | 3f8b44d | 2010-09-04 01:17:01 -0700 | [diff] [blame] | 203 | slang_rs_reflection.cpp \ |
Zonr Chang | 66a1a5a | 2010-10-22 11:00:11 +0800 | [diff] [blame] | 204 | slang_rs_reflect_utils.cpp \ |
| 205 | slang_rs_metadata_spec_encoder.cpp |
Shih-wei Liao | 462aefd | 2010-06-04 15:32:04 -0700 | [diff] [blame] | 206 | |
| 207 | LOCAL_STATIC_LIBRARIES := \ |
Ying Wang | 000c307 | 2011-01-27 19:06:02 -0800 | [diff] [blame^] | 208 | libclangDriver libslang \ |
| 209 | $(static_libraries_needed_by_slang) |
Ying Wang | e2201c0 | 2011-01-11 17:29:32 -0800 | [diff] [blame] | 210 | |
Raphael | 11e2b93 | 2011-01-13 15:13:35 -0800 | [diff] [blame] | 211 | ifeq ($(HOST_OS),windows) |
| 212 | LOCAL_LDLIBS := -limagehlp -lpsapi |
| 213 | else |
| 214 | LOCAL_LDLIBS := -ldl -lpthread |
| 215 | endif |
Shih-wei Liao | 462aefd | 2010-06-04 15:32:04 -0700 | [diff] [blame] | 216 | |
Shih-wei Liao | b81c6a4 | 2010-10-10 14:15:00 -0700 | [diff] [blame] | 217 | # For build RSCCOptions.inc from RSCCOptions.td |
| 218 | intermediates := $(call local-intermediates-dir) |
| 219 | LOCAL_GENERATED_SOURCES += $(intermediates)/RSCCOptions.inc |
| 220 | $(intermediates)/RSCCOptions.inc: $(LOCAL_PATH)/RSCCOptions.td $(CLANG_ROOT_PATH)/include/clang/Driver/OptParser.td $(TBLGEN) |
| 221 | @echo "Building RenderScript compiler (llvm-rs-cc) Option tables with tblgen" |
| 222 | $(call transform-host-td-to-out,opt-parser-defs) |
| 223 | |
Zonr Chang | a65ec16 | 2010-10-17 01:53:05 +0800 | [diff] [blame] | 224 | include frameworks/compile/slang/RSSpec.mk |
Shih-wei Liao | 462aefd | 2010-06-04 15:32:04 -0700 | [diff] [blame] | 225 | include $(CLANG_HOST_BUILD_MK) |
| 226 | include $(CLANG_TBLGEN_RULES_MK) |
| 227 | include $(BUILD_HOST_EXECUTABLE) |