blob: de6931a7a6ece55ff75e5dc1b5decd9731db6176 [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#
Ying Wanga20a2fd2011-03-30 12:58:06 -070016
17# The prebuilt tools should be used when we are doing app-only build.
18ifeq ($(TARGET_BUILD_APPS),)
19
Shih-wei Liao462aefd2010-06-04 15:32:04 -070020LOCAL_PATH := $(call my-dir)
Shih-wei Liao462aefd2010-06-04 15:32:04 -070021
Alex Sakhartchouk9be93602011-03-17 17:03:36 -070022local_cflags_for_slang := -Wno-sign-promo -Wall -Wno-unused-parameter -Werror
23ifneq ($(TARGET_BUILD_VARIANT),eng)
24local_cflags_for_slang += -D__DISABLE_ASSERTS
25endif
26
Ying Wang000c3072011-01-27 19:06:02 -080027static_libraries_needed_by_slang := \
Zonr Chang08df36e2010-10-07 18:50:42 +080028 libLLVMLinker \
29 libLLVMipo \
30 libLLVMBitWriter \
31 libLLVMBitReader \
Zonr Chang08df36e2010-10-07 18:50:42 +080032 libLLVMARMCodeGen \
Loganbe274822011-02-16 22:02:54 +080033 libLLVMARMAsmPrinter \
Zonr Chang08df36e2010-10-07 18:50:42 +080034 libLLVMARMInfo \
35 libLLVMX86CodeGen \
Loganbe274822011-02-16 22:02:54 +080036 libLLVMX86AsmPrinter \
Zonr Chang08df36e2010-10-07 18:50:42 +080037 libLLVMX86Info \
Loganbe274822011-02-16 22:02:54 +080038 libLLVMX86Utils \
39 libLLVMAsmPrinter \
Zonr Chang08df36e2010-10-07 18:50:42 +080040 libLLVMSelectionDAG \
41 libLLVMCodeGen \
42 libLLVMScalarOpts \
43 libLLVMInstCombine \
44 libLLVMTransformUtils \
45 libLLVMInstrumentation \
46 libLLVMipa \
47 libLLVMAnalysis \
48 libLLVMTarget \
49 libLLVMMC \
Loganbe274822011-02-16 22:02:54 +080050 libLLVMMCParser \
Zonr Chang08df36e2010-10-07 18:50:42 +080051 libLLVMCore \
52 libclangParse \
53 libclangSema \
54 libclangAnalysis \
55 libclangAST \
56 libclangLex \
57 libclangFrontend \
58 libclangCodeGen \
59 libclangBasic \
Loganbe274822011-02-16 22:02:54 +080060 libLLVMSupport
Zonr Chang08df36e2010-10-07 18:50:42 +080061
Ying Wang000c3072011-01-27 19:06:02 -080062# Static library libslang for host
63# ========================================================
64include $(CLEAR_VARS)
65include $(CLEAR_TBLGEN_VARS)
66
67LLVM_ROOT_PATH := external/llvm
68CLANG_ROOT_PATH := external/clang
69
70include $(CLANG_ROOT_PATH)/clang.mk
71
72LOCAL_MODULE := libslang
73LOCAL_MODULE_TAGS := optional
74
Alex Sakhartchouk9be93602011-03-17 17:03:36 -070075LOCAL_CFLAGS += $(local_cflags_for_slang)
Ying Wang000c3072011-01-27 19:06:02 -080076
77TBLGEN_TABLES := \
78 AttrList.inc \
79 Attrs.inc \
80 DeclNodes.inc \
81 DiagnosticCommonKinds.inc \
82 DiagnosticFrontendKinds.inc \
83 DiagnosticSemaKinds.inc \
84 StmtNodes.inc
85
86LOCAL_SRC_FILES := \
87 slang.cpp \
88 slang_utils.cpp \
89 slang_backend.cpp \
90 slang_pragma_recorder.cpp \
91 slang_diagnostic_buffer.cpp
92
Zonr Chang08df36e2010-10-07 18:50:42 +080093LOCAL_LDLIBS := -ldl -lpthread
94
95include $(CLANG_HOST_BUILD_MK)
96include $(CLANG_TBLGEN_RULES_MK)
97include $(LLVM_GEN_INTRINSICS_MK)
Ying Wange2201c02011-01-11 17:29:32 -080098include $(BUILD_HOST_STATIC_LIBRARY)
Zonr Chang08df36e2010-10-07 18:50:42 +080099
Zonr Changa02010c2010-10-11 20:54:28 +0800100# Host static library containing rslib.bc
101# ========================================================
102include $(CLEAR_VARS)
103
104input_data_file := frameworks/compile/slang/rslib.bc
105slangdata_output_var_name := rslib_bc
106
107LOCAL_IS_HOST_MODULE := true
108LOCAL_MODULE := librslib
109LOCAL_MODULE_TAGS := optional
110
Shih-wei Liao5dee9562011-01-13 02:16:00 -0800111LOCAL_MODULE_CLASS := STATIC_LIBRARIES
Shih-wei Liao99230212011-01-13 01:09:03 -0800112
Zonr Changa02010c2010-10-11 20:54:28 +0800113include $(LOCAL_PATH)/SlangData.mk
Shih-wei Liao5dee9562011-01-13 02:16:00 -0800114include $(BUILD_HOST_STATIC_LIBRARY)
Shih-wei Liao9901f892011-01-13 00:23:47 -0800115
116# Executable slang-data for host
117# ========================================================
118include $(CLEAR_VARS)
119
120LOCAL_MODULE := slang-data
121LOCAL_MODULE_TAGS := optional
122
123LOCAL_MODULE_CLASS := EXECUTABLES
124
125LOCAL_SRC_FILES := slang-data.c
126
127include $(BUILD_HOST_EXECUTABLE)
Zonr Changa02010c2010-10-11 20:54:28 +0800128
Zonr Chang3c250c52010-10-07 12:19:23 +0800129# Executable llvm-rs-link for host
Shih-wei Liao462aefd2010-06-04 15:32:04 -0700130# ========================================================
131include $(CLEAR_VARS)
132include $(CLEAR_TBLGEN_VARS)
133
Zonr Chang08df36e2010-10-07 18:50:42 +0800134include $(LLVM_ROOT_PATH)/llvm.mk
135
Shih-wei Liao835a7b72010-08-06 02:29:11 -0700136LOCAL_MODULE := llvm-rs-link
Zonr Changa02010c2010-10-11 20:54:28 +0800137LOCAL_MODULE_TAGS := optional
Shih-wei Liao835a7b72010-08-06 02:29:11 -0700138
139LOCAL_MODULE_CLASS := EXECUTABLES
140
141LOCAL_SRC_FILES := \
Zonr Chang92b344a2010-10-05 20:39:03 +0800142 llvm-rs-link.cpp
Shih-wei Liao835a7b72010-08-06 02:29:11 -0700143
Zonr Changa02010c2010-10-11 20:54:28 +0800144LOCAL_STATIC_LIBRARIES := \
Ying Wang000c3072011-01-27 19:06:02 -0800145 librslib libslang \
146 $(static_libraries_needed_by_slang)
Zonr Changa02010c2010-10-11 20:54:28 +0800147
Shih-wei Liao835a7b72010-08-06 02:29:11 -0700148LOCAL_LDLIBS := -ldl -lpthread
149
150include $(LLVM_HOST_BUILD_MK)
151include $(LLVM_GEN_INTRINSICS_MK)
152include $(BUILD_HOST_EXECUTABLE)
153
Zonr Changa65ec162010-10-17 01:53:05 +0800154# Executable rs-spec-gen for host
155# ========================================================
156include $(CLEAR_VARS)
157
158LOCAL_MODULE := rs-spec-gen
159LOCAL_MODULE_TAGS := optional
160
161LOCAL_MODULE_CLASS := EXECUTABLES
162
163LOCAL_SRC_FILES := \
164 slang_rs_spec_table.cpp
165
166include $(BUILD_HOST_EXECUTABLE)
167
Shih-wei Liaoffa58bb2010-10-10 14:15:13 -0700168# Executable llvm-rs-cc for host
Shih-wei Liao835a7b72010-08-06 02:29:11 -0700169# ========================================================
170include $(CLEAR_VARS)
171include $(CLEAR_TBLGEN_VARS)
172
Shih-wei Liaob81c6a42010-10-10 14:15:00 -0700173LOCAL_IS_HOST_MODULE := true
174LOCAL_MODULE := llvm-rs-cc
175LOCAL_MODULE_TAGS := optional
Shih-wei Liao462aefd2010-06-04 15:32:04 -0700176
Shih-wei Liaobdd78882010-06-06 05:55:36 -0700177LOCAL_MODULE_CLASS := EXECUTABLES
178
Alex Sakhartchouk9be93602011-03-17 17:03:36 -0700179LOCAL_CFLAGS += $(local_cflags_for_slang)
Shih-wei Liaocecd11d2010-09-21 08:07:58 -0700180
Shih-wei Liao462aefd2010-06-04 15:32:04 -0700181TBLGEN_TABLES := \
Shih-wei Liaof52a6202010-09-10 17:40:53 -0700182 AttrList.inc \
183 Attrs.inc \
184 DeclNodes.inc \
185 DiagnosticCommonKinds.inc \
Shih-wei Liaob81c6a42010-10-10 14:15:00 -0700186 DiagnosticDriverKinds.inc \
Zonr Changcf6af6a2010-10-12 12:38:51 +0800187 DiagnosticFrontendKinds.inc \
Shih-wei Liaob81c6a42010-10-10 14:15:00 -0700188 DiagnosticSemaKinds.inc \
Zonr Chang92b344a2010-10-05 20:39:03 +0800189 StmtNodes.inc \
Shih-wei Liaob81c6a42010-10-10 14:15:00 -0700190 RSCCOptions.inc
Shih-wei Liao462aefd2010-06-04 15:32:04 -0700191
Zonr Changa65ec162010-10-17 01:53:05 +0800192RS_SPEC_TABLES := \
193 RSClangBuiltinEnums.inc \
194 RSDataTypeEnums.inc \
195 RSDataElementEnums.inc \
196 RSDataKindEnums.inc \
Zonr Changb1771ef2010-10-22 18:03:46 +0800197 RSMatrixTypeEnums.inc \
Zonr Changa65ec162010-10-17 01:53:05 +0800198 RSObjectTypeEnums.inc
199
Shih-wei Liao462aefd2010-06-04 15:32:04 -0700200LOCAL_SRC_FILES := \
Shih-wei Liaob81c6a42010-10-10 14:15:00 -0700201 llvm-rs-cc.cpp \
Zonr Chang3a9ca1f2010-10-06 17:52:56 +0800202 slang_rs.cpp \
Stephen Hines292e00a2011-03-18 19:11:30 -0700203 slang_rs_ast_replace.cpp \
Shih-wei Liao462aefd2010-06-04 15:32:04 -0700204 slang_rs_context.cpp \
205 slang_rs_pragma_handler.cpp \
206 slang_rs_backend.cpp \
Zonr Chang641558f2010-10-12 21:07:06 +0800207 slang_rs_exportable.cpp \
Shih-wei Liao462aefd2010-06-04 15:32:04 -0700208 slang_rs_export_type.cpp \
209 slang_rs_export_element.cpp \
210 slang_rs_export_var.cpp \
211 slang_rs_export_func.cpp \
Stephen Hines4b32ffd2010-11-05 18:47:11 -0700212 slang_rs_object_ref_count.cpp \
Ying Wang3f8b44d2010-09-04 01:17:01 -0700213 slang_rs_reflection.cpp \
Zonr Chang66a1a5a2010-10-22 11:00:11 +0800214 slang_rs_reflect_utils.cpp \
215 slang_rs_metadata_spec_encoder.cpp
Shih-wei Liao462aefd2010-06-04 15:32:04 -0700216
217LOCAL_STATIC_LIBRARIES := \
Ying Wang000c3072011-01-27 19:06:02 -0800218 libclangDriver libslang \
219 $(static_libraries_needed_by_slang)
Ying Wange2201c02011-01-11 17:29:32 -0800220
Raphael11e2b932011-01-13 15:13:35 -0800221ifeq ($(HOST_OS),windows)
222 LOCAL_LDLIBS := -limagehlp -lpsapi
223else
224 LOCAL_LDLIBS := -ldl -lpthread
225endif
Shih-wei Liao462aefd2010-06-04 15:32:04 -0700226
Shih-wei Liaob81c6a42010-10-10 14:15:00 -0700227# For build RSCCOptions.inc from RSCCOptions.td
228intermediates := $(call local-intermediates-dir)
229LOCAL_GENERATED_SOURCES += $(intermediates)/RSCCOptions.inc
230$(intermediates)/RSCCOptions.inc: $(LOCAL_PATH)/RSCCOptions.td $(CLANG_ROOT_PATH)/include/clang/Driver/OptParser.td $(TBLGEN)
231 @echo "Building RenderScript compiler (llvm-rs-cc) Option tables with tblgen"
232 $(call transform-host-td-to-out,opt-parser-defs)
233
Zonr Changa65ec162010-10-17 01:53:05 +0800234include frameworks/compile/slang/RSSpec.mk
Shih-wei Liao462aefd2010-06-04 15:32:04 -0700235include $(CLANG_HOST_BUILD_MK)
236include $(CLANG_TBLGEN_RULES_MK)
237include $(BUILD_HOST_EXECUTABLE)
Ying Wanga20a2fd2011-03-30 12:58:06 -0700238
239endif # TARGET_BUILD_APPS