blob: a1ee9c0dca1f10f779f830dd7b5c0248f62f676d [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
Alex Sakhartchouk9be93602011-03-17 17:03:36 -070018local_cflags_for_slang := -Wno-sign-promo -Wall -Wno-unused-parameter -Werror
19ifneq ($(TARGET_BUILD_VARIANT),eng)
20local_cflags_for_slang += -D__DISABLE_ASSERTS
21endif
22
Ying Wang000c3072011-01-27 19:06:02 -080023static_libraries_needed_by_slang := \
Zonr Chang08df36e2010-10-07 18:50:42 +080024 libLLVMLinker \
25 libLLVMipo \
26 libLLVMBitWriter \
27 libLLVMBitReader \
Zonr Chang08df36e2010-10-07 18:50:42 +080028 libLLVMARMCodeGen \
Loganbe274822011-02-16 22:02:54 +080029 libLLVMARMAsmPrinter \
Zonr Chang08df36e2010-10-07 18:50:42 +080030 libLLVMARMInfo \
31 libLLVMX86CodeGen \
Loganbe274822011-02-16 22:02:54 +080032 libLLVMX86AsmPrinter \
Zonr Chang08df36e2010-10-07 18:50:42 +080033 libLLVMX86Info \
Loganbe274822011-02-16 22:02:54 +080034 libLLVMX86Utils \
35 libLLVMAsmPrinter \
Zonr Chang08df36e2010-10-07 18:50:42 +080036 libLLVMSelectionDAG \
37 libLLVMCodeGen \
38 libLLVMScalarOpts \
39 libLLVMInstCombine \
40 libLLVMTransformUtils \
41 libLLVMInstrumentation \
42 libLLVMipa \
43 libLLVMAnalysis \
44 libLLVMTarget \
45 libLLVMMC \
Loganbe274822011-02-16 22:02:54 +080046 libLLVMMCParser \
Zonr Chang08df36e2010-10-07 18:50:42 +080047 libLLVMCore \
48 libclangParse \
49 libclangSema \
50 libclangAnalysis \
51 libclangAST \
52 libclangLex \
53 libclangFrontend \
54 libclangCodeGen \
55 libclangBasic \
Loganbe274822011-02-16 22:02:54 +080056 libLLVMSupport
Zonr Chang08df36e2010-10-07 18:50:42 +080057
Ying Wang000c3072011-01-27 19:06:02 -080058# Static library libslang for host
59# ========================================================
60include $(CLEAR_VARS)
61include $(CLEAR_TBLGEN_VARS)
62
63LLVM_ROOT_PATH := external/llvm
64CLANG_ROOT_PATH := external/clang
65
66include $(CLANG_ROOT_PATH)/clang.mk
67
68LOCAL_MODULE := libslang
69LOCAL_MODULE_TAGS := optional
70
Alex Sakhartchouk9be93602011-03-17 17:03:36 -070071LOCAL_CFLAGS += $(local_cflags_for_slang)
Ying Wang000c3072011-01-27 19:06:02 -080072
73TBLGEN_TABLES := \
74 AttrList.inc \
75 Attrs.inc \
76 DeclNodes.inc \
77 DiagnosticCommonKinds.inc \
78 DiagnosticFrontendKinds.inc \
79 DiagnosticSemaKinds.inc \
80 StmtNodes.inc
81
82LOCAL_SRC_FILES := \
83 slang.cpp \
84 slang_utils.cpp \
85 slang_backend.cpp \
86 slang_pragma_recorder.cpp \
87 slang_diagnostic_buffer.cpp
88
Zonr Chang08df36e2010-10-07 18:50:42 +080089LOCAL_LDLIBS := -ldl -lpthread
90
91include $(CLANG_HOST_BUILD_MK)
92include $(CLANG_TBLGEN_RULES_MK)
93include $(LLVM_GEN_INTRINSICS_MK)
Ying Wange2201c02011-01-11 17:29:32 -080094include $(BUILD_HOST_STATIC_LIBRARY)
Zonr Chang08df36e2010-10-07 18:50:42 +080095
Zonr Changa02010c2010-10-11 20:54:28 +080096# Host static library containing rslib.bc
97# ========================================================
98include $(CLEAR_VARS)
99
100input_data_file := frameworks/compile/slang/rslib.bc
101slangdata_output_var_name := rslib_bc
102
103LOCAL_IS_HOST_MODULE := true
104LOCAL_MODULE := librslib
105LOCAL_MODULE_TAGS := optional
106
Shih-wei Liao5dee9562011-01-13 02:16:00 -0800107LOCAL_MODULE_CLASS := STATIC_LIBRARIES
Shih-wei Liao99230212011-01-13 01:09:03 -0800108
Zonr Changa02010c2010-10-11 20:54:28 +0800109include $(LOCAL_PATH)/SlangData.mk
Shih-wei Liao5dee9562011-01-13 02:16:00 -0800110include $(BUILD_HOST_STATIC_LIBRARY)
Shih-wei Liao9901f892011-01-13 00:23:47 -0800111
112# Executable slang-data for host
113# ========================================================
114include $(CLEAR_VARS)
115
116LOCAL_MODULE := slang-data
117LOCAL_MODULE_TAGS := optional
118
119LOCAL_MODULE_CLASS := EXECUTABLES
120
121LOCAL_SRC_FILES := slang-data.c
122
123include $(BUILD_HOST_EXECUTABLE)
Zonr Changa02010c2010-10-11 20:54:28 +0800124
Zonr Chang3c250c52010-10-07 12:19:23 +0800125# Executable llvm-rs-link for host
Shih-wei Liao462aefd2010-06-04 15:32:04 -0700126# ========================================================
127include $(CLEAR_VARS)
128include $(CLEAR_TBLGEN_VARS)
129
Zonr Chang08df36e2010-10-07 18:50:42 +0800130include $(LLVM_ROOT_PATH)/llvm.mk
131
Shih-wei Liao835a7b72010-08-06 02:29:11 -0700132LOCAL_MODULE := llvm-rs-link
Zonr Changa02010c2010-10-11 20:54:28 +0800133LOCAL_MODULE_TAGS := optional
Shih-wei Liao835a7b72010-08-06 02:29:11 -0700134
135LOCAL_MODULE_CLASS := EXECUTABLES
136
137LOCAL_SRC_FILES := \
Zonr Chang92b344a2010-10-05 20:39:03 +0800138 llvm-rs-link.cpp
Shih-wei Liao835a7b72010-08-06 02:29:11 -0700139
Zonr Changa02010c2010-10-11 20:54:28 +0800140LOCAL_STATIC_LIBRARIES := \
Ying Wang000c3072011-01-27 19:06:02 -0800141 librslib libslang \
142 $(static_libraries_needed_by_slang)
Zonr Changa02010c2010-10-11 20:54:28 +0800143
Shih-wei Liao835a7b72010-08-06 02:29:11 -0700144LOCAL_LDLIBS := -ldl -lpthread
145
146include $(LLVM_HOST_BUILD_MK)
147include $(LLVM_GEN_INTRINSICS_MK)
148include $(BUILD_HOST_EXECUTABLE)
149
Zonr Changa65ec162010-10-17 01:53:05 +0800150# Executable rs-spec-gen for host
151# ========================================================
152include $(CLEAR_VARS)
153
154LOCAL_MODULE := rs-spec-gen
155LOCAL_MODULE_TAGS := optional
156
157LOCAL_MODULE_CLASS := EXECUTABLES
158
159LOCAL_SRC_FILES := \
160 slang_rs_spec_table.cpp
161
162include $(BUILD_HOST_EXECUTABLE)
163
Shih-wei Liaoffa58bb2010-10-10 14:15:13 -0700164# Executable llvm-rs-cc for host
Shih-wei Liao835a7b72010-08-06 02:29:11 -0700165# ========================================================
166include $(CLEAR_VARS)
167include $(CLEAR_TBLGEN_VARS)
168
Shih-wei Liaob81c6a42010-10-10 14:15:00 -0700169LOCAL_IS_HOST_MODULE := true
170LOCAL_MODULE := llvm-rs-cc
171LOCAL_MODULE_TAGS := optional
Shih-wei Liao462aefd2010-06-04 15:32:04 -0700172
Shih-wei Liaobdd78882010-06-06 05:55:36 -0700173LOCAL_MODULE_CLASS := EXECUTABLES
174
Alex Sakhartchouk9be93602011-03-17 17:03:36 -0700175LOCAL_CFLAGS += $(local_cflags_for_slang)
Shih-wei Liaocecd11d2010-09-21 08:07:58 -0700176
Shih-wei Liao462aefd2010-06-04 15:32:04 -0700177TBLGEN_TABLES := \
Shih-wei Liaof52a6202010-09-10 17:40:53 -0700178 AttrList.inc \
179 Attrs.inc \
180 DeclNodes.inc \
181 DiagnosticCommonKinds.inc \
Shih-wei Liaob81c6a42010-10-10 14:15:00 -0700182 DiagnosticDriverKinds.inc \
Zonr Changcf6af6a2010-10-12 12:38:51 +0800183 DiagnosticFrontendKinds.inc \
Shih-wei Liaob81c6a42010-10-10 14:15:00 -0700184 DiagnosticSemaKinds.inc \
Zonr Chang92b344a2010-10-05 20:39:03 +0800185 StmtNodes.inc \
Shih-wei Liaob81c6a42010-10-10 14:15:00 -0700186 RSCCOptions.inc
Shih-wei Liao462aefd2010-06-04 15:32:04 -0700187
Zonr Changa65ec162010-10-17 01:53:05 +0800188RS_SPEC_TABLES := \
189 RSClangBuiltinEnums.inc \
190 RSDataTypeEnums.inc \
191 RSDataElementEnums.inc \
192 RSDataKindEnums.inc \
Zonr Changb1771ef2010-10-22 18:03:46 +0800193 RSMatrixTypeEnums.inc \
Zonr Changa65ec162010-10-17 01:53:05 +0800194 RSObjectTypeEnums.inc
195
Shih-wei Liao462aefd2010-06-04 15:32:04 -0700196LOCAL_SRC_FILES := \
Shih-wei Liaob81c6a42010-10-10 14:15:00 -0700197 llvm-rs-cc.cpp \
Zonr Chang3a9ca1f2010-10-06 17:52:56 +0800198 slang_rs.cpp \
Shih-wei Liao462aefd2010-06-04 15:32:04 -0700199 slang_rs_context.cpp \
200 slang_rs_pragma_handler.cpp \
201 slang_rs_backend.cpp \
Zonr Chang641558f2010-10-12 21:07:06 +0800202 slang_rs_exportable.cpp \
Shih-wei Liao462aefd2010-06-04 15:32:04 -0700203 slang_rs_export_type.cpp \
204 slang_rs_export_element.cpp \
205 slang_rs_export_var.cpp \
206 slang_rs_export_func.cpp \
Stephen Hines4b32ffd2010-11-05 18:47:11 -0700207 slang_rs_object_ref_count.cpp \
Ying Wang3f8b44d2010-09-04 01:17:01 -0700208 slang_rs_reflection.cpp \
Zonr Chang66a1a5a2010-10-22 11:00:11 +0800209 slang_rs_reflect_utils.cpp \
210 slang_rs_metadata_spec_encoder.cpp
Shih-wei Liao462aefd2010-06-04 15:32:04 -0700211
212LOCAL_STATIC_LIBRARIES := \
Ying Wang000c3072011-01-27 19:06:02 -0800213 libclangDriver libslang \
214 $(static_libraries_needed_by_slang)
Ying Wange2201c02011-01-11 17:29:32 -0800215
Raphael11e2b932011-01-13 15:13:35 -0800216ifeq ($(HOST_OS),windows)
217 LOCAL_LDLIBS := -limagehlp -lpsapi
218else
219 LOCAL_LDLIBS := -ldl -lpthread
220endif
Shih-wei Liao462aefd2010-06-04 15:32:04 -0700221
Shih-wei Liaob81c6a42010-10-10 14:15:00 -0700222# For build RSCCOptions.inc from RSCCOptions.td
223intermediates := $(call local-intermediates-dir)
224LOCAL_GENERATED_SOURCES += $(intermediates)/RSCCOptions.inc
225$(intermediates)/RSCCOptions.inc: $(LOCAL_PATH)/RSCCOptions.td $(CLANG_ROOT_PATH)/include/clang/Driver/OptParser.td $(TBLGEN)
226 @echo "Building RenderScript compiler (llvm-rs-cc) Option tables with tblgen"
227 $(call transform-host-td-to-out,opt-parser-defs)
228
Zonr Changa65ec162010-10-17 01:53:05 +0800229include frameworks/compile/slang/RSSpec.mk
Shih-wei Liao462aefd2010-06-04 15:32:04 -0700230include $(CLANG_HOST_BUILD_MK)
231include $(CLANG_TBLGEN_RULES_MK)
232include $(BUILD_HOST_EXECUTABLE)