Android.mk revision 99230217c5ef626487610b4b387d62158c06ae7b
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#
16LOCAL_PATH := $(call my-dir)
17
18# Static library libslang for host
19# ========================================================
20include $(CLEAR_VARS)
21include $(CLEAR_TBLGEN_VARS)
22
23LLVM_ROOT_PATH := external/llvm
24CLANG_ROOT_PATH := external/clang
25
26include $(CLANG_ROOT_PATH)/clang.mk
27
28LOCAL_MODULE := libslang
29LOCAL_MODULE_TAGS := optional
30
31LOCAL_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
49LOCAL_WHOLE_STATIC_LIBRARIES :=	\
50	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)
89include $(BUILD_HOST_STATIC_LIBRARY)
90
91# 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
102LOCAL_MODULE_CLASS := SHARED_LIBRARIES
103
104include $(LOCAL_PATH)/SlangData.mk
105include $(BUILD_HOST_SHARED_LIBRARY)
106
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)
119
120# Executable llvm-rs-link for host
121# ========================================================
122include $(CLEAR_VARS)
123include $(CLEAR_TBLGEN_VARS)
124
125include $(LLVM_ROOT_PATH)/llvm.mk
126
127LOCAL_MODULE := llvm-rs-link
128LOCAL_MODULE_TAGS := optional
129
130LOCAL_MODULE_CLASS := EXECUTABLES
131
132LOCAL_SRC_FILES :=	\
133	llvm-rs-link.cpp
134
135LOCAL_STATIC_LIBRARIES :=	\
136	librslib libslang
137
138LOCAL_LDLIBS := -ldl -lpthread
139
140include $(LLVM_HOST_BUILD_MK)
141include $(LLVM_GEN_INTRINSICS_MK)
142include $(BUILD_HOST_EXECUTABLE)
143
144# 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
158# Executable llvm-rs-cc for host
159# ========================================================
160include $(CLEAR_VARS)
161include $(CLEAR_TBLGEN_VARS)
162
163LOCAL_IS_HOST_MODULE := true
164LOCAL_MODULE := llvm-rs-cc
165LOCAL_MODULE_TAGS := optional
166
167LOCAL_MODULE_CLASS := EXECUTABLES
168
169LOCAL_CFLAGS += -Wno-sign-promo
170
171TBLGEN_TABLES :=    \
172	AttrList.inc    \
173	Attrs.inc    \
174	DeclNodes.inc    \
175	DiagnosticCommonKinds.inc   \
176	DiagnosticDriverKinds.inc	\
177	DiagnosticFrontendKinds.inc	\
178	DiagnosticSemaKinds.inc	\
179	StmtNodes.inc	\
180	RSCCOptions.inc
181
182RS_SPEC_TABLES :=	\
183	RSClangBuiltinEnums.inc	\
184	RSDataTypeEnums.inc	\
185	RSDataElementEnums.inc	\
186	RSDataKindEnums.inc	\
187	RSMatrixTypeEnums.inc	\
188	RSObjectTypeEnums.inc
189
190LOCAL_SRC_FILES :=	\
191	llvm-rs-cc.cpp	\
192	slang_rs.cpp	\
193	slang_rs_context.cpp	\
194	slang_rs_pragma_handler.cpp	\
195	slang_rs_backend.cpp	\
196	slang_rs_exportable.cpp	\
197	slang_rs_export_type.cpp	\
198	slang_rs_export_element.cpp	\
199	slang_rs_export_var.cpp	\
200	slang_rs_export_func.cpp	\
201	slang_rs_object_ref_count.cpp	\
202	slang_rs_reflection.cpp \
203	slang_rs_reflect_utils.cpp  \
204	slang_rs_metadata_spec_encoder.cpp
205
206LOCAL_STATIC_LIBRARIES :=	\
207	libclangDriver libslang
208
209LOCAL_LDLIBS := -ldl -lpthread
210
211# For build RSCCOptions.inc from RSCCOptions.td
212intermediates := $(call local-intermediates-dir)
213LOCAL_GENERATED_SOURCES += $(intermediates)/RSCCOptions.inc
214$(intermediates)/RSCCOptions.inc: $(LOCAL_PATH)/RSCCOptions.td $(CLANG_ROOT_PATH)/include/clang/Driver/OptParser.td $(TBLGEN)
215	@echo "Building RenderScript compiler (llvm-rs-cc) Option tables with tblgen"
216	$(call transform-host-td-to-out,opt-parser-defs)
217
218include frameworks/compile/slang/RSSpec.mk
219include $(CLANG_HOST_BUILD_MK)
220include $(CLANG_TBLGEN_RULES_MK)
221include $(BUILD_HOST_EXECUTABLE)
222