blob: ec0a2102d153f7467d8bb011ac5a5c8c8643903e [file] [log] [blame]
Zonr Change86245a2010-10-12 21:42:13 +08001#
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 Liao462aefd2010-06-04 15:32:04 -070016LOCAL_PATH := $(call my-dir)
Shih-wei Liao462aefd2010-06-04 15:32:04 -070017
Ying Wange2201c02011-01-11 17:29:32 -080018# Static library libslang for host
Zonr Chang08df36e2010-10-07 18:50:42 +080019# ========================================================
20include $(CLEAR_VARS)
21include $(CLEAR_TBLGEN_VARS)
Shih-wei Liao462aefd2010-06-04 15:32:04 -070022
Zonr Chang08df36e2010-10-07 18:50:42 +080023LLVM_ROOT_PATH := external/llvm
Ying Wang12f4d682010-09-08 09:54:32 -070024CLANG_ROOT_PATH := external/clang
Zonr Chang08df36e2010-10-07 18:50:42 +080025
Ying Wang12f4d682010-09-08 09:54:32 -070026include $(CLANG_ROOT_PATH)/clang.mk
27
Zonr Chang08df36e2010-10-07 18:50:42 +080028LOCAL_MODULE := libslang
29LOCAL_MODULE_TAGS := optional
30
Zonr Chang08df36e2010-10-07 18:50:42 +080031LOCAL_CFLAGS += -Wno-sign-promo
32
33TBLGEN_TABLES := \
34 AttrList.inc \
35 Attrs.inc \
36 DeclNodes.inc \
37 DiagnosticCommonKinds.inc \
38 DiagnosticFrontendKinds.inc \
39 DiagnosticSemaKinds.inc \
40 StmtNodes.inc
41
42LOCAL_SRC_FILES := \
43 slang.cpp \
44 slang_utils.cpp \
45 slang_backend.cpp \
46 slang_pragma_recorder.cpp \
47 slang_diagnostic_buffer.cpp
48
Ying Wange2201c02011-01-11 17:29:32 -080049LOCAL_WHOLE_STATIC_LIBRARIES := \
Zonr Chang08df36e2010-10-07 18:50:42 +080050 libLLVMLinker \
51 libLLVMipo \
52 libLLVMBitWriter \
53 libLLVMBitReader \
54 libLLVMARMAsmPrinter \
55 libLLVMX86AsmPrinter \
56 libLLVMAsmPrinter \
57 libLLVMMCParser \
58 libLLVMARMCodeGen \
59 libLLVMARMInfo \
60 libLLVMX86CodeGen \
61 libLLVMX86Info \
62 libLLVMSelectionDAG \
63 libLLVMCodeGen \
64 libLLVMScalarOpts \
65 libLLVMInstCombine \
66 libLLVMTransformUtils \
67 libLLVMInstrumentation \
68 libLLVMipa \
69 libLLVMAnalysis \
70 libLLVMTarget \
71 libLLVMMC \
72 libLLVMCore \
73 libclangParse \
74 libclangSema \
75 libclangAnalysis \
76 libclangAST \
77 libclangLex \
78 libclangFrontend \
79 libclangCodeGen \
80 libclangBasic \
81 libLLVMSupport \
82 libLLVMSystem
83
84LOCAL_LDLIBS := -ldl -lpthread
85
86include $(CLANG_HOST_BUILD_MK)
87include $(CLANG_TBLGEN_RULES_MK)
88include $(LLVM_GEN_INTRINSICS_MK)
Ying Wange2201c02011-01-11 17:29:32 -080089include $(BUILD_HOST_STATIC_LIBRARY)
Zonr Chang08df36e2010-10-07 18:50:42 +080090
Zonr Changa02010c2010-10-11 20:54:28 +080091# Host static library containing rslib.bc
92# ========================================================
93include $(CLEAR_VARS)
94
95input_data_file := frameworks/compile/slang/rslib.bc
96slangdata_output_var_name := rslib_bc
97
98LOCAL_IS_HOST_MODULE := true
99LOCAL_MODULE := librslib
100LOCAL_MODULE_TAGS := optional
101
Shih-wei Liao5dee9562011-01-13 02:16:00 -0800102LOCAL_MODULE_CLASS := STATIC_LIBRARIES
Shih-wei Liao99230212011-01-13 01:09:03 -0800103
Zonr Changa02010c2010-10-11 20:54:28 +0800104include $(LOCAL_PATH)/SlangData.mk
Shih-wei Liao5dee9562011-01-13 02:16:00 -0800105include $(BUILD_HOST_STATIC_LIBRARY)
Shih-wei Liao9901f892011-01-13 00:23:47 -0800106
107# Executable slang-data for host
108# ========================================================
109include $(CLEAR_VARS)
110
111LOCAL_MODULE := slang-data
112LOCAL_MODULE_TAGS := optional
113
114LOCAL_MODULE_CLASS := EXECUTABLES
115
116LOCAL_SRC_FILES := slang-data.c
117
118include $(BUILD_HOST_EXECUTABLE)
Zonr Changa02010c2010-10-11 20:54:28 +0800119
Zonr Chang3c250c52010-10-07 12:19:23 +0800120# Executable llvm-rs-link for host
Shih-wei Liao462aefd2010-06-04 15:32:04 -0700121# ========================================================
122include $(CLEAR_VARS)
123include $(CLEAR_TBLGEN_VARS)
124
Zonr Chang08df36e2010-10-07 18:50:42 +0800125include $(LLVM_ROOT_PATH)/llvm.mk
126
Shih-wei Liao835a7b72010-08-06 02:29:11 -0700127LOCAL_MODULE := llvm-rs-link
Zonr Changa02010c2010-10-11 20:54:28 +0800128LOCAL_MODULE_TAGS := optional
Shih-wei Liao835a7b72010-08-06 02:29:11 -0700129
130LOCAL_MODULE_CLASS := EXECUTABLES
131
132LOCAL_SRC_FILES := \
Zonr Chang92b344a2010-10-05 20:39:03 +0800133 llvm-rs-link.cpp
Shih-wei Liao835a7b72010-08-06 02:29:11 -0700134
Zonr Changa02010c2010-10-11 20:54:28 +0800135LOCAL_STATIC_LIBRARIES := \
Ying Wange2201c02011-01-11 17:29:32 -0800136 librslib libslang
Zonr Changa02010c2010-10-11 20:54:28 +0800137
Shih-wei Liao835a7b72010-08-06 02:29:11 -0700138LOCAL_LDLIBS := -ldl -lpthread
139
140include $(LLVM_HOST_BUILD_MK)
141include $(LLVM_GEN_INTRINSICS_MK)
142include $(BUILD_HOST_EXECUTABLE)
143
Zonr Changa65ec162010-10-17 01:53:05 +0800144# Executable rs-spec-gen for host
145# ========================================================
146include $(CLEAR_VARS)
147
148LOCAL_MODULE := rs-spec-gen
149LOCAL_MODULE_TAGS := optional
150
151LOCAL_MODULE_CLASS := EXECUTABLES
152
153LOCAL_SRC_FILES := \
154 slang_rs_spec_table.cpp
155
156include $(BUILD_HOST_EXECUTABLE)
157
Shih-wei Liaoffa58bb2010-10-10 14:15:13 -0700158# Executable llvm-rs-cc for host
Shih-wei Liao835a7b72010-08-06 02:29:11 -0700159# ========================================================
160include $(CLEAR_VARS)
161include $(CLEAR_TBLGEN_VARS)
162
Shih-wei Liaob81c6a42010-10-10 14:15:00 -0700163LOCAL_IS_HOST_MODULE := true
164LOCAL_MODULE := llvm-rs-cc
165LOCAL_MODULE_TAGS := optional
Shih-wei Liao462aefd2010-06-04 15:32:04 -0700166
Shih-wei Liaobdd78882010-06-06 05:55:36 -0700167LOCAL_MODULE_CLASS := EXECUTABLES
168
Shih-wei Liaocecd11d2010-09-21 08:07:58 -0700169LOCAL_CFLAGS += -Wno-sign-promo
170
Shih-wei Liao462aefd2010-06-04 15:32:04 -0700171TBLGEN_TABLES := \
Shih-wei Liaof52a6202010-09-10 17:40:53 -0700172 AttrList.inc \
173 Attrs.inc \
174 DeclNodes.inc \
175 DiagnosticCommonKinds.inc \
Shih-wei Liaob81c6a42010-10-10 14:15:00 -0700176 DiagnosticDriverKinds.inc \
Zonr Changcf6af6a2010-10-12 12:38:51 +0800177 DiagnosticFrontendKinds.inc \
Shih-wei Liaob81c6a42010-10-10 14:15:00 -0700178 DiagnosticSemaKinds.inc \
Zonr Chang92b344a2010-10-05 20:39:03 +0800179 StmtNodes.inc \
Shih-wei Liaob81c6a42010-10-10 14:15:00 -0700180 RSCCOptions.inc
Shih-wei Liao462aefd2010-06-04 15:32:04 -0700181
Zonr Changa65ec162010-10-17 01:53:05 +0800182RS_SPEC_TABLES := \
183 RSClangBuiltinEnums.inc \
184 RSDataTypeEnums.inc \
185 RSDataElementEnums.inc \
186 RSDataKindEnums.inc \
Zonr Changb1771ef2010-10-22 18:03:46 +0800187 RSMatrixTypeEnums.inc \
Zonr Changa65ec162010-10-17 01:53:05 +0800188 RSObjectTypeEnums.inc
189
Shih-wei Liao462aefd2010-06-04 15:32:04 -0700190LOCAL_SRC_FILES := \
Shih-wei Liaob81c6a42010-10-10 14:15:00 -0700191 llvm-rs-cc.cpp \
Zonr Chang3a9ca1f2010-10-06 17:52:56 +0800192 slang_rs.cpp \
Shih-wei Liao462aefd2010-06-04 15:32:04 -0700193 slang_rs_context.cpp \
194 slang_rs_pragma_handler.cpp \
195 slang_rs_backend.cpp \
Zonr Chang641558f2010-10-12 21:07:06 +0800196 slang_rs_exportable.cpp \
Shih-wei Liao462aefd2010-06-04 15:32:04 -0700197 slang_rs_export_type.cpp \
198 slang_rs_export_element.cpp \
199 slang_rs_export_var.cpp \
200 slang_rs_export_func.cpp \
Stephen Hines4b32ffd2010-11-05 18:47:11 -0700201 slang_rs_object_ref_count.cpp \
Ying Wang3f8b44d2010-09-04 01:17:01 -0700202 slang_rs_reflection.cpp \
Zonr Chang66a1a5a2010-10-22 11:00:11 +0800203 slang_rs_reflect_utils.cpp \
204 slang_rs_metadata_spec_encoder.cpp
Shih-wei Liao462aefd2010-06-04 15:32:04 -0700205
206LOCAL_STATIC_LIBRARIES := \
Ying Wange2201c02011-01-11 17:29:32 -0800207 libclangDriver libslang
208
Raphael11e2b932011-01-13 15:13:35 -0800209ifeq ($(HOST_OS),windows)
210 LOCAL_LDLIBS := -limagehlp -lpsapi
211else
212 LOCAL_LDLIBS := -ldl -lpthread
213endif
Shih-wei Liao462aefd2010-06-04 15:32:04 -0700214
Shih-wei Liaob81c6a42010-10-10 14:15:00 -0700215# For build RSCCOptions.inc from RSCCOptions.td
216intermediates := $(call local-intermediates-dir)
217LOCAL_GENERATED_SOURCES += $(intermediates)/RSCCOptions.inc
218$(intermediates)/RSCCOptions.inc: $(LOCAL_PATH)/RSCCOptions.td $(CLANG_ROOT_PATH)/include/clang/Driver/OptParser.td $(TBLGEN)
219 @echo "Building RenderScript compiler (llvm-rs-cc) Option tables with tblgen"
220 $(call transform-host-td-to-out,opt-parser-defs)
221
Zonr Changa65ec162010-10-17 01:53:05 +0800222include frameworks/compile/slang/RSSpec.mk
Shih-wei Liao462aefd2010-06-04 15:32:04 -0700223include $(CLANG_HOST_BUILD_MK)
224include $(CLANG_TBLGEN_RULES_MK)
225include $(BUILD_HOST_EXECUTABLE)