1From be91378db0840d26ae20bd4d13a2aa96d3d02249 Mon Sep 17 00:00:00 2001
2From: Tim Murray <timmurray@google.com>
3Date: Thu, 3 Apr 2014 14:29:15 -0700
4Subject: [PATCH 4/4] Add Android build system.
5
6Change-Id: I9738582ea6bcede99a42fd3926ba22e81d5fff02
7---
8 Android.mk                             |  34 +++++
9 clang-host-build.mk                    |  38 ++++++
10 clang-tblgen-rules.mk                  | 237 +++++++++++++++++++++++++++++++++
11 clang-version-inc.mk                   |  36 +++++
12 clang.mk                               |   7 +
13 host_shared_clang.mk                   |  41 ++++++
14 include/clang/Config/config.h          |  25 ++++
15 lib/ARCMigrate/Android.mk              |  51 +++++++
16 lib/AST/Android.mk                     |  94 +++++++++++++
17 lib/Analysis/Android.mk                |  51 +++++++
18 lib/Basic/Android.mk                   |  57 ++++++++
19 lib/CodeGen/Android.mk                 |  75 +++++++++++
20 lib/Driver/Android.mk                  |  44 ++++++
21 lib/Edit/Android.mk                    |  32 +++++
22 lib/Format/Android.mk                  |  43 ++++++
23 lib/Frontend/Android.mk                |  66 +++++++++
24 lib/FrontendTool/Android.mk            |  24 ++++
25 lib/Headers/Android.mk                 |  11 ++
26 lib/Lex/Android.mk                     |  45 +++++++
27 lib/Parse/Android.mk                   |  47 +++++++
28 lib/Rewrite/Core/Android.mk            |  34 +++++
29 lib/Rewrite/Frontend/Android.mk        |  38 ++++++
30 lib/Sema/Android.mk                    |  84 ++++++++++++
31 lib/Serialization/Android.mk           |  46 +++++++
32 lib/StaticAnalyzer/Checkers/Android.mk | 100 ++++++++++++++
33 lib/StaticAnalyzer/Core/Android.mk     |  68 ++++++++++
34 lib/StaticAnalyzer/Frontend/Android.mk |  40 ++++++
35 tools/driver/Android.mk                | 119 +++++++++++++++++
36 utils/TableGen/Android.mk              |  35 +++++
37 29 files changed, 1622 insertions(+)
38 create mode 100644 Android.mk
39 create mode 100644 clang-host-build.mk
40 create mode 100644 clang-tblgen-rules.mk
41 create mode 100644 clang-version-inc.mk
42 create mode 100644 clang.mk
43 create mode 100644 host_shared_clang.mk
44 create mode 100644 include/clang/Config/config.h
45 create mode 100644 lib/ARCMigrate/Android.mk
46 create mode 100644 lib/AST/Android.mk
47 create mode 100644 lib/Analysis/Android.mk
48 create mode 100644 lib/Basic/Android.mk
49 create mode 100644 lib/CodeGen/Android.mk
50 create mode 100644 lib/Driver/Android.mk
51 create mode 100644 lib/Edit/Android.mk
52 create mode 100644 lib/Format/Android.mk
53 create mode 100644 lib/Frontend/Android.mk
54 create mode 100644 lib/FrontendTool/Android.mk
55 create mode 100644 lib/Headers/Android.mk
56 create mode 100644 lib/Lex/Android.mk
57 create mode 100644 lib/Parse/Android.mk
58 create mode 100644 lib/Rewrite/Core/Android.mk
59 create mode 100644 lib/Rewrite/Frontend/Android.mk
60 create mode 100644 lib/Sema/Android.mk
61 create mode 100644 lib/Serialization/Android.mk
62 create mode 100644 lib/StaticAnalyzer/Checkers/Android.mk
63 create mode 100644 lib/StaticAnalyzer/Core/Android.mk
64 create mode 100644 lib/StaticAnalyzer/Frontend/Android.mk
65 create mode 100644 tools/driver/Android.mk
66 create mode 100644 utils/TableGen/Android.mk
67
68diff --git a/Android.mk b/Android.mk
69new file mode 100644
70index 0000000..5f62da3
71--- /dev/null
72+++ b/Android.mk
73@@ -0,0 +1,34 @@
74+LOCAL_PATH := $(call my-dir)
75+CLANG_ROOT_PATH := $(LOCAL_PATH)
76+
77+include $(CLEAR_VARS)
78+
79+subdirs := $(addprefix $(LOCAL_PATH)/,$(addsuffix /Android.mk, \
80+  lib/Analysis \
81+  lib/AST \
82+  lib/ARCMigrate \
83+  lib/Basic \
84+  lib/CodeGen \
85+  lib/Driver \
86+  lib/Edit \
87+  lib/Format \
88+  lib/Frontend \
89+  lib/FrontendTool \
90+  lib/Headers \
91+  lib/Lex \
92+  lib/Parse \
93+  lib/Rewrite/Core \
94+  lib/Rewrite/Frontend \
95+  lib/Sema \
96+  lib/Serialization \
97+  lib/StaticAnalyzer/Checkers \
98+  lib/StaticAnalyzer/Core \
99+  lib/StaticAnalyzer/Frontend \
100+  tools/driver \
101+  utils/TableGen \
102+  ))
103+
104+include $(LOCAL_PATH)/clang.mk
105+include $(LOCAL_PATH)/host_shared_clang.mk
106+
107+include $(subdirs)
108diff --git a/clang-host-build.mk b/clang-host-build.mk
109new file mode 100644
110index 0000000..e0ba2e6
111--- /dev/null
112+++ b/clang-host-build.mk
113@@ -0,0 +1,38 @@
114+LOCAL_CFLAGS :=	\
115+	-pedantic	\
116+	-Wcast-qual	\
117+	-Wno-long-long	\
118+	$(LOCAL_CFLAGS)
119+
120+LOCAL_CPPFLAGS := \
121+	-Wno-sign-promo \
122+	$(LOCAL_CPPFLAGS)
123+
124+# Make sure bionic is first so we can include system headers.
125+LOCAL_C_INCLUDES :=	\
126+	$(CLANG_ROOT_PATH)/include	\
127+        $(CLANG_ROOT_PATH)/lib/CodeGen    \
128+	$(LOCAL_C_INCLUDES)
129+
130+LLVM_ROOT_PATH := external/llvm
131+include $(LLVM_ROOT_PATH)/llvm.mk
132+
133+ifneq ($(LLVM_HOST_BUILD_MK),)
134+include $(LLVM_HOST_BUILD_MK)
135+endif
136+
137+###########################################################
138+## Commands for running tblgen to compile a td file
139+###########################################################
140+define transform-host-clang-td-to-out
141+@mkdir -p $(dir $@)
142+@echo "Host Clang TableGen: $(TBLGEN_LOCAL_MODULE) (gen-$(1)) <= $<"
143+$(hide) $(CLANG_TBLGEN) \
144+	-I $(dir $<)	\
145+	-I $(LLVM_ROOT_PATH)/include	\
146+	-I $(LLVM_ROOT_PATH)/host/include	\
147+	-I $(LLVM_ROOT_PATH)/lib/Target	\
148+	$(if $(strip $(CLANG_ROOT_PATH)),-I $(CLANG_ROOT_PATH)/include,)	\
149+	-gen-$(strip $(1))	\
150+	-o $@ $<
151+endef
152diff --git a/clang-tblgen-rules.mk b/clang-tblgen-rules.mk
153new file mode 100644
154index 0000000..a2ae405
155--- /dev/null
156+++ b/clang-tblgen-rules.mk
157@@ -0,0 +1,237 @@
158+###################################4########################
159+## TableGen: Compile .td files to .inc.
160+###########################################################
161+ifeq ($(LOCAL_MODULE_CLASS),)
162+    LOCAL_MODULE_CLASS := STATIC_LIBRARIES
163+endif
164+
165+ifneq ($(strip $(TBLGEN_TABLES)),)
166+
167+intermediates := $(call local-intermediates-dir)
168+
169+ifneq ($(findstring AttrDump.inc,$(TBLGEN_TABLES)),)
170+LOCAL_GENERATED_SOURCES += $(intermediates)/include/clang/AST/AttrDump.inc
171+$(intermediates)/include/clang/AST/AttrDump.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
172+$(intermediates)/include/clang/AST/AttrDump.inc: $(CLANG_ROOT_PATH)/include/clang/Basic/Attr.td | $(CLANG_TBLGEN)
173+	$(call transform-host-clang-td-to-out,clang-attr-dump)
174+endif
175+
176+ifneq ($(findstring AttrImpl.inc,$(TBLGEN_TABLES)),)
177+LOCAL_GENERATED_SOURCES += $(intermediates)/include/clang/AST/AttrImpl.inc
178+$(intermediates)/include/clang/AST/AttrImpl.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
179+$(intermediates)/include/clang/AST/AttrImpl.inc: $(CLANG_ROOT_PATH)/include/clang/Basic/Attr.td | $(CLANG_TBLGEN)
180+	$(call transform-host-clang-td-to-out,clang-attr-impl)
181+endif
182+
183+ifneq ($(findstring AttrHasAttributeImpl.inc,$(TBLGEN_TABLES)),)
184+LOCAL_GENERATED_SOURCES += $(intermediates)/include/clang/Basic/AttrHasAttributeImpl.inc
185+$(intermediates)/include/clang/Basic/AttrHasAttributeImpl.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
186+$(intermediates)/include/clang/Basic/AttrHasAttributeImpl.inc: $(CLANG_ROOT_PATH)/include/clang/Basic/Attr.td | $(CLANG_TBLGEN)
187+	$(call transform-host-clang-td-to-out,clang-attr-has-attribute-impl)
188+endif
189+
190+ifneq ($(findstring AttrList.inc,$(TBLGEN_TABLES)),)
191+LOCAL_GENERATED_SOURCES += $(intermediates)/include/clang/Basic/AttrList.inc
192+$(intermediates)/include/clang/Basic/AttrList.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
193+$(intermediates)/include/clang/Basic/AttrList.inc: $(CLANG_ROOT_PATH)/include/clang/Basic/Attr.td | $(CLANG_TBLGEN)
194+	$(call transform-host-clang-td-to-out,clang-attr-list)
195+endif
196+
197+ifneq ($(findstring AttrSpellingListIndex.inc,$(TBLGEN_TABLES)),)
198+LOCAL_GENERATED_SOURCES += $(intermediates)/include/clang/Sema/AttrSpellingListIndex.inc
199+$(intermediates)/include/clang/Sema/AttrSpellingListIndex.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
200+$(intermediates)/include/clang/Sema/AttrSpellingListIndex.inc: $(CLANG_ROOT_PATH)/include/clang/Basic/Attr.td | $(CLANG_TBLGEN)
201+	$(call transform-host-clang-td-to-out,clang-attr-spelling-index)
202+endif
203+
204+ifneq ($(findstring AttrPCHRead.inc,$(TBLGEN_TABLES)),)
205+LOCAL_GENERATED_SOURCES += $(intermediates)/include/clang/Serialization/AttrPCHRead.inc
206+$(intermediates)/include/clang/Serialization/AttrPCHRead.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
207+$(intermediates)/include/clang/Serialization/AttrPCHRead.inc: $(CLANG_ROOT_PATH)/include/clang/Basic/Attr.td | $(CLANG_TBLGEN)
208+	$(call transform-host-clang-td-to-out,clang-attr-pch-read)
209+endif
210+
211+ifneq ($(findstring AttrPCHWrite.inc,$(TBLGEN_TABLES)),)
212+LOCAL_GENERATED_SOURCES += $(intermediates)/include/clang/Serialization/AttrPCHWrite.inc
213+$(intermediates)/include/clang/Serialization/AttrPCHWrite.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
214+$(intermediates)/include/clang/Serialization/AttrPCHWrite.inc: $(CLANG_ROOT_PATH)/include/clang/Basic/Attr.td | $(CLANG_TBLGEN)
215+	$(call transform-host-clang-td-to-out,clang-attr-pch-write)
216+endif
217+
218+ifneq ($(findstring Attrs.inc,$(TBLGEN_TABLES)),)
219+LOCAL_GENERATED_SOURCES += $(intermediates)/include/clang/AST/Attrs.inc
220+$(intermediates)/include/clang/AST/Attrs.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
221+$(intermediates)/include/clang/AST/Attrs.inc: $(CLANG_ROOT_PATH)/include/clang/Basic/Attr.td | $(CLANG_TBLGEN)
222+	$(call transform-host-clang-td-to-out,clang-attr-classes)
223+endif
224+
225+ifneq ($(findstring AttrParserStringSwitches.inc,$(TBLGEN_TABLES)),)
226+LOCAL_GENERATED_SOURCES += $(intermediates)/include/clang/Parse/AttrParserStringSwitches.inc
227+$(intermediates)/include/clang/Parse/AttrParserStringSwitches.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
228+$(intermediates)/include/clang/Parse/AttrParserStringSwitches.inc: $(CLANG_ROOT_PATH)/include/clang/Basic/Attr.td | $(CLANG_TBLGEN)
229+	$(call transform-host-clang-td-to-out,clang-attr-parser-string-switches)
230+endif
231+
232+ifneq ($(findstring AttrVisitor.inc,$(TBLGEN_TABLES)),)
233+LOCAL_GENERATED_SOURCES += $(intermediates)/include/clang/AST/AttrVisitor.inc
234+$(intermediates)/include/clang/AST/AttrVisitor.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
235+$(intermediates)/include/clang/AST/AttrVisitor.inc: $(CLANG_ROOT_PATH)/include/clang/Basic/Attr.td | $(CLANG_TBLGEN)
236+	$(call transform-host-clang-td-to-out,clang-attr-ast-visitor)
237+endif
238+
239+ifneq ($(findstring AttrParsedAttrKinds.inc,$(TBLGEN_TABLES)),)
240+LOCAL_GENERATED_SOURCES += $(intermediates)/include/clang/Sema/AttrParsedAttrKinds.inc
241+$(intermediates)/include/clang/Sema/AttrParsedAttrKinds.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
242+$(intermediates)/include/clang/Sema/AttrParsedAttrKinds.inc: $(CLANG_ROOT_PATH)/include/clang/Basic/Attr.td | $(CLANG_TBLGEN)
243+	$(call transform-host-clang-td-to-out,clang-attr-parsed-attr-kinds)
244+endif
245+
246+ifneq ($(findstring AttrParsedAttrImpl.inc,$(TBLGEN_TABLES)),)
247+LOCAL_GENERATED_SOURCES += $(intermediates)/include/clang/Sema/AttrParsedAttrImpl.inc
248+$(intermediates)/include/clang/Sema/AttrParsedAttrImpl.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
249+$(intermediates)/include/clang/Sema/AttrParsedAttrImpl.inc: $(CLANG_ROOT_PATH)/include/clang/Basic/Attr.td | $(CLANG_TBLGEN)
250+	$(call transform-host-clang-td-to-out,clang-attr-parsed-attr-impl)
251+endif
252+
253+ifneq ($(findstring AttrParsedAttrList.inc,$(TBLGEN_TABLES)),)
254+LOCAL_GENERATED_SOURCES += $(intermediates)/include/clang/Sema/AttrParsedAttrList.inc
255+$(intermediates)/include/clang/Sema/AttrParsedAttrList.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
256+$(intermediates)/include/clang/Sema/AttrParsedAttrList.inc: $(CLANG_ROOT_PATH)/include/clang/Basic/Attr.td | $(CLANG_TBLGEN)
257+	$(call transform-host-clang-td-to-out,clang-attr-parsed-attr-list)
258+endif
259+
260+ifneq ($(findstring AttrTemplateInstantiate.inc,$(TBLGEN_TABLES)),)
261+LOCAL_GENERATED_SOURCES += $(intermediates)/include/clang/Sema/AttrTemplateInstantiate.inc
262+$(intermediates)/include/clang/Sema/AttrTemplateInstantiate.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
263+$(intermediates)/include/clang/Sema/AttrTemplateInstantiate.inc: $(CLANG_ROOT_PATH)/include/clang/Basic/Attr.td | $(CLANG_TBLGEN)
264+	$(call transform-host-clang-td-to-out,clang-attr-template-instantiate)
265+endif
266+
267+ifneq ($(findstring Checkers.inc,$(TBLGEN_TABLES)),)
268+LOCAL_GENERATED_SOURCES += $(intermediates)/Checkers.inc
269+$(intermediates)/Checkers.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
270+$(intermediates)/Checkers.inc: \
271+  $(CLANG_ROOT_PATH)/lib/StaticAnalyzer/Checkers/Checkers.td \
272+  $(CLANG_ROOT_PATH)/include/clang/StaticAnalyzer/Checkers/CheckerBase.td \
273+  | $(CLANG_TBLGEN)
274+	$(call transform-host-clang-td-to-out,clang-sa-checkers)
275+endif
276+
277+ifneq ($(findstring CommentCommandInfo.inc,$(TBLGEN_TABLES)),)
278+LOCAL_GENERATED_SOURCES += $(intermediates)/include/clang/AST/CommentCommandInfo.inc
279+$(intermediates)/include/clang/AST/CommentCommandInfo.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
280+$(intermediates)/include/clang/AST/CommentCommandInfo.inc: \
281+  $(CLANG_ROOT_PATH)/include/clang/AST/CommentCommands.td \
282+  | $(CLANG_TBLGEN)
283+	$(call transform-host-clang-td-to-out,clang-comment-command-info)
284+endif
285+
286+ifneq ($(findstring CommentCommandList.inc,$(TBLGEN_TABLES)),)
287+LOCAL_GENERATED_SOURCES += $(intermediates)/include/clang/AST/CommentCommandList.inc
288+$(intermediates)/include/clang/AST/CommentCommandList.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
289+$(intermediates)/include/clang/AST/CommentCommandList.inc: \
290+  $(CLANG_ROOT_PATH)/include/clang/AST/CommentCommands.td \
291+  | $(CLANG_TBLGEN)
292+	$(call transform-host-clang-td-to-out,clang-comment-command-list)
293+endif
294+
295+ifneq ($(findstring CommentHTMLNamedCharacterReferences.inc,$(TBLGEN_TABLES)),)
296+LOCAL_GENERATED_SOURCES += $(intermediates)/include/clang/AST/CommentHTMLNamedCharacterReferences.inc
297+$(intermediates)/include/clang/AST/CommentHTMLNamedCharacterReferences.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
298+$(intermediates)/include/clang/AST/CommentHTMLNamedCharacterReferences.inc: \
299+  $(CLANG_ROOT_PATH)/include/clang/AST/CommentHTMLNamedCharacterReferences.td \
300+  | $(CLANG_TBLGEN)
301+	$(call transform-host-clang-td-to-out,clang-comment-html-named-character-references)
302+endif
303+
304+ifneq ($(findstring CommentHTMLTagsProperties.inc,$(TBLGEN_TABLES)),)
305+LOCAL_GENERATED_SOURCES += $(intermediates)/include/clang/AST/CommentHTMLTagsProperties.inc
306+$(intermediates)/include/clang/AST/CommentHTMLTagsProperties.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
307+$(intermediates)/include/clang/AST/CommentHTMLTagsProperties.inc: \
308+  $(CLANG_ROOT_PATH)/include/clang/AST/CommentHTMLTags.td \
309+  | $(CLANG_TBLGEN)
310+	$(call transform-host-clang-td-to-out,clang-comment-html-tags-properties)
311+endif
312+
313+ifneq ($(findstring CommentHTMLTags.inc,$(TBLGEN_TABLES)),)
314+LOCAL_GENERATED_SOURCES += $(intermediates)/include/clang/AST/CommentHTMLTags.inc
315+$(intermediates)/include/clang/AST/CommentHTMLTags.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
316+$(intermediates)/include/clang/AST/CommentHTMLTags.inc: \
317+  $(CLANG_ROOT_PATH)/include/clang/AST/CommentHTMLTags.td \
318+  | $(CLANG_TBLGEN)
319+	$(call transform-host-clang-td-to-out,clang-comment-html-tags)
320+endif
321+
322+ifneq ($(findstring CommentNodes.inc,$(TBLGEN_TABLES)),)
323+LOCAL_GENERATED_SOURCES += $(intermediates)/include/clang/AST/CommentNodes.inc
324+$(intermediates)/include/clang/AST/CommentNodes.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
325+$(intermediates)/include/clang/AST/CommentNodes.inc: \
326+  $(CLANG_ROOT_PATH)/include/clang/Basic/CommentNodes.td \
327+  | $(CLANG_TBLGEN)
328+	$(call transform-host-clang-td-to-out,clang-comment-nodes)
329+endif
330+
331+ifneq ($(filter Diagnostic%Kinds.inc,$(TBLGEN_TABLES)),)
332+LOCAL_GENERATED_SOURCES += $(addprefix $(intermediates)/include/clang/Basic/,$(filter Diagnostic%Kinds.inc,$(TBLGEN_TABLES)))
333+$(intermediates)/include/clang/Basic/Diagnostic%Kinds.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
334+$(intermediates)/include/clang/Basic/Diagnostic%Kinds.inc: \
335+  $(CLANG_ROOT_PATH)/include/clang/Basic/Diagnostic.td \
336+  $(CLANG_ROOT_PATH)/include/clang/Basic/Diagnostic%Kinds.td \
337+  | $(CLANG_TBLGEN)
338+	$(call transform-host-clang-td-to-out,clang-diags-defs -clang-component=$(patsubst Diagnostic%Kinds.inc,%,$(@F)))
339+endif
340+
341+ifneq ($(findstring DiagnosticGroups.inc,$(TBLGEN_TABLES)),)
342+LOCAL_GENERATED_SOURCES += $(intermediates)/include/clang/Basic/DiagnosticGroups.inc
343+$(intermediates)/include/clang/Basic/DiagnosticGroups.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
344+$(intermediates)/include/clang/Basic/DiagnosticGroups.inc: $(CLANG_ROOT_PATH)/include/clang/Basic/Diagnostic.td $(CLANG_ROOT_PATH)/include/clang/Basic/DiagnosticGroups.td | $(CLANG_TBLGEN)
345+	$(call transform-host-clang-td-to-out,clang-diag-groups)
346+endif
347+
348+ifneq ($(findstring DiagnosticIndexName.inc,$(TBLGEN_TABLES)),)
349+LOCAL_GENERATED_SOURCES += $(intermediates)/include/clang/Basic/DiagnosticIndexName.inc
350+$(intermediates)/include/clang/Basic/DiagnosticIndexName.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
351+$(intermediates)/include/clang/Basic/DiagnosticIndexName.inc: $(CLANG_ROOT_PATH)/include/clang/Basic/Diagnostic.td | $(CLANG_TBLGEN)
352+	$(call transform-host-clang-td-to-out,clang-diag-groups)
353+endif
354+
355+ifneq ($(findstring DeclNodes.inc,$(TBLGEN_TABLES)),)
356+LOCAL_GENERATED_SOURCES += $(intermediates)/include/clang/AST/DeclNodes.inc
357+$(intermediates)/include/clang/AST/DeclNodes.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
358+$(intermediates)/include/clang/AST/DeclNodes.inc: $(CLANG_ROOT_PATH)/include/clang/Basic/DeclNodes.td | $(CLANG_TBLGEN)
359+	$(call transform-host-clang-td-to-out,clang-decl-nodes)
360+endif
361+
362+ifneq ($(findstring StmtNodes.inc,$(TBLGEN_TABLES)),)
363+LOCAL_GENERATED_SOURCES += $(intermediates)/include/clang/AST/StmtNodes.inc
364+$(intermediates)/include/clang/AST/StmtNodes.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
365+$(intermediates)/include/clang/AST/StmtNodes.inc: $(CLANG_ROOT_PATH)/include/clang/Basic/StmtNodes.td | $(CLANG_TBLGEN)
366+	$(call transform-host-clang-td-to-out,clang-stmt-nodes)
367+endif
368+
369+ifneq ($(findstring arm_neon.inc,$(TBLGEN_TABLES)),)
370+LOCAL_GENERATED_SOURCES += $(intermediates)/include/clang/Basic/arm_neon.inc
371+$(intermediates)/include/clang/Basic/arm_neon.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
372+$(intermediates)/include/clang/Basic/arm_neon.inc: $(CLANG_ROOT_PATH)/include/clang/Basic/arm_neon.td | $(CLANG_TBLGEN)
373+	$(call transform-host-clang-td-to-out,arm-neon-sema)
374+endif
375+
376+ifneq ($(findstring Options.inc,$(TBLGEN_TABLES)),)
377+LOCAL_GENERATED_SOURCES += $(intermediates)/include/clang/Driver/Options.inc
378+$(intermediates)/include/clang/Driver/Options.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
379+$(intermediates)/include/clang/Driver/Options.inc: $(CLANG_ROOT_PATH)/include/clang/Driver/Options.td $(LLVM_ROOT_PATH)/include/llvm/Option/OptParser.td $(CLANG_ROOT_PATH)/include/clang/Driver/CC1Options.td \
380+    | $(CLANG_TBLGEN) $(TBLGEN)
381+	$(call transform-host-td-to-out,opt-parser-defs)
382+endif
383+
384+ifneq ($(findstring CC1AsOptions.inc,$(TBLGEN_TABLES)),)
385+LOCAL_GENERATED_SOURCES += $(intermediates)/include/clang/Driver/CC1AsOptions.inc
386+$(intermediates)/include/clang/Driver/CC1AsOptions.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
387+$(intermediates)/include/clang/Driver/CC1AsOptions.inc: $(CLANG_ROOT_PATH)/include/clang/Driver/CC1AsOptions.td $(LLVM_ROOT_PATH)/include/llvm/Option/OptParser.td \
388+    | $(CLANG_TBLGEN) $(TBLGEN)
389+	$(call transform-host-td-to-out,opt-parser-defs)
390+endif
391+
392+LOCAL_C_INCLUDES += $(intermediates)/include
393+
394+endif
395diff --git a/clang-version-inc.mk b/clang-version-inc.mk
396new file mode 100644
397index 0000000..5a26276
398--- /dev/null
399+++ b/clang-version-inc.mk
400@@ -0,0 +1,36 @@
401+###########################################################
402+## Generate clang/Basic/Version.inc
403+###########################################################
404+ifeq ($(LOCAL_MODULE_CLASS),)
405+    LOCAL_MODULE_CLASS := STATIC_LIBRARIES
406+endif
407+
408+intermediates := $(call local-intermediates-dir)
409+
410+LLVMVersion := $(shell grep PACKAGE_VERSION $(LLVM_ROOT_PATH)/host/include/llvm/Config/config.h | sed -e 's/\#define PACKAGE_VERSION "\(.*\)"/\1/g')
411+
412+# Compute the Clang version from the LLVM version, unless specified explicitly.
413+# (Copy from include/clang/Basic/Makefile)
414+CLANG_VERSION := $(subst svn,,$(LLVMVersion))
415+CLANG_VERSION_COMPONENTS := $(subst ., ,$(CLANG_VERSION))
416+CLANG_VERSION_MAJOR := $(word 1,$(CLANG_VERSION_COMPONENTS))
417+CLANG_VERSION_MINOR := $(word 2,$(CLANG_VERSION_COMPONENTS))
418+CLANG_VERSION_PATCHLEVEL := $(word 3,$(CLANG_VERSION_COMPONENTS))
419+ifeq ($(CLANG_VERSION_PATCHLEVEL),)
420+    CLANG_HAS_VERSION_PATCHLEVEL := 0
421+else
422+    CLANG_HAS_VERSION_PATCHLEVEL := 1
423+endif
424+
425+LOCAL_GENERATED_SOURCES += $(intermediates)/include/clang/Basic/Version.inc
426+$(intermediates)/include/clang/Basic/Version.inc: $(CLANG_ROOT_PATH)/include/clang/Basic/Version.inc.in \
427+  $(LLVM_ROOT_PATH)/host/include/llvm/Config/config.h
428+	@echo "Updating Clang version info."
429+	@mkdir -p $(dir $@)
430+	$(hide) sed -e "s#@CLANG_VERSION@#$(CLANG_VERSION)#g" \
431+	-e "s#@CLANG_VERSION_MAJOR@#$(CLANG_VERSION_MAJOR)#g" \
432+	-e "s#@CLANG_VERSION_MINOR@#$(CLANG_VERSION_MINOR)#g" \
433+	-e "s#@CLANG_VERSION_PATCHLEVEL@#$(CLANG_VERSION_PATCHLEVEL)#g" \
434+	-e "s#@CLANG_HAS_VERSION_PATCHLEVEL@#$(CLANG_HAS_VERSION_PATCHLEVEL)#g" \
435+	$< > $@
436+
437diff --git a/clang.mk b/clang.mk
438new file mode 100644
439index 0000000..587a510
440--- /dev/null
441+++ b/clang.mk
442@@ -0,0 +1,7 @@
443+ifeq ($(CLANG_ROOT_PATH),)
444+$(error Must set variable CLANG_ROOT_PATH before including this! $(LOCAL_PATH))
445+endif
446+
447+CLANG_HOST_BUILD_MK := $(CLANG_ROOT_PATH)/clang-host-build.mk
448+CLANG_TBLGEN_RULES_MK := $(CLANG_ROOT_PATH)/clang-tblgen-rules.mk
449+CLANG_VERSION_INC_MK := $(CLANG_ROOT_PATH)/clang-version-inc.mk
450diff --git a/host_shared_clang.mk b/host_shared_clang.mk
451new file mode 100644
452index 0000000..f9e4181
453--- /dev/null
454+++ b/host_shared_clang.mk
455@@ -0,0 +1,41 @@
456+# Don't build the library unless forced to.
457+ifeq (true,$(FORCE_BUILD_LLVM_COMPONENTS))
458+# Don't build the library in unbundled branches.
459+ifeq (,$(TARGET_BUILD_APPS))
460+
461+LOCAL_PATH:= $(call my-dir)
462+
463+LOCAL_IS_HOST_MODULE := true
464+
465+LOCAL_MODULE:= libclang
466+
467+LOCAL_MODULE_TAGS := optional
468+
469+LOCAL_WHOLE_STATIC_LIBRARIES := \
470+	libclangDriver \
471+	libclangParse \
472+	libclangSema \
473+	libclangAnalysis \
474+	libclangCodeGen \
475+	libclangAST \
476+	libclangEdit \
477+	libclangLex \
478+	libclangFrontend \
479+	libclangBasic \
480+	libclangRewriteFrontend \
481+	libclangRewriteCore \
482+	libclangSerialization
483+
484+LOCAL_SHARED_LIBRARIES := libLLVM
485+
486+ifeq ($(HOST_OS),windows)
487+  LOCAL_LDLIBS := -limagehlp -lpsapi
488+else
489+  LOCAL_LDLIBS := -ldl -lpthread
490+endif
491+
492+include $(CLANG_HOST_BUILD_MK)
493+include $(BUILD_HOST_SHARED_LIBRARY)
494+
495+endif # don't build in unbundled branches
496+endif # don't build unless forced to
497diff --git a/include/clang/Config/config.h b/include/clang/Config/config.h
498new file mode 100644
499index 0000000..51ef9f9
500--- /dev/null
501+++ b/include/clang/Config/config.h
502@@ -0,0 +1,25 @@
503+/* tools/clang/include/clang/Config/config.h.  Generated from config.h.in by configure.  */
504+/* include/clang/Config/config.h.in. */
505+
506+#ifndef ANDROID_CONFIG_H
507+#define ANDROID_CONFIG_H
508+
509+/* Bug report URL. */
510+#define BUG_REPORT_URL "http://llvm.org/bugs/"
511+
512+/* Relative directory for resource files */
513+#define CLANG_RESOURCE_DIR ""
514+
515+/* Directories clang will search for headers */
516+#define C_INCLUDE_DIRS ""
517+
518+/* Linker version detected at compile time. */
519+#define HOST_LINK_VERSION "2.22"
520+
521+/* Default <path> to all compiler invocations for --sysroot=<path>. */
522+#define DEFAULT_SYSROOT ""
523+
524+/* Directory where gcc is installed. */
525+#define GCC_INSTALL_PREFIX ""
526+
527+#endif
528diff --git a/lib/ARCMigrate/Android.mk b/lib/ARCMigrate/Android.mk
529new file mode 100644
530index 0000000..834f573
531--- /dev/null
532+++ b/lib/ARCMigrate/Android.mk
533@@ -0,0 +1,51 @@
534+LOCAL_PATH := $(call my-dir)
535+
536+# For the host only
537+# =====================================================
538+include $(CLEAR_VARS)
539+include $(CLEAR_TBLGEN_VARS)
540+
541+TBLGEN_TABLES := \
542+  Attrs.inc \
543+  AttrList.inc \
544+  AttrParsedAttrList.inc    \
545+  AttrVisitor.inc \
546+  CommentCommandList.inc \
547+  CommentNodes.inc \
548+  DeclNodes.inc \
549+  DiagnosticCommonKinds.inc \
550+  DiagnosticGroups.inc \
551+  DiagnosticSemaKinds.inc \
552+  StmtNodes.inc
553+
554+clang_arc_migrate_SRC_FILES := \
555+  ARCMT.cpp \
556+  ARCMTActions.cpp \
557+  FileRemapper.cpp \
558+  ObjCMT.cpp \
559+  PlistReporter.cpp \
560+  TransAPIUses.cpp \
561+  TransARCAssign.cpp \
562+  TransAutoreleasePool.cpp \
563+  TransBlockObjCVariable.cpp \
564+  TransEmptyStatementsAndDealloc.cpp \
565+  TransformActions.cpp \
566+  Transforms.cpp \
567+  TransGCAttrs.cpp \
568+  TransGCCalls.cpp \
569+  TransProperties.cpp \
570+  TransProtectedScope.cpp \
571+  TransRetainReleaseDealloc.cpp \
572+  TransUnbridgedCasts.cpp \
573+  TransUnusedInitDelegate.cpp \
574+  TransZeroOutPropsInDealloc.cpp
575+
576+LOCAL_SRC_FILES := $(clang_arc_migrate_SRC_FILES)
577+
578+LOCAL_MODULE := libclangARCMigrate
579+LOCAL_MODULE_TAGS := optional
580+
581+include $(CLANG_HOST_BUILD_MK)
582+include $(CLANG_VERSION_INC_MK)
583+include $(CLANG_TBLGEN_RULES_MK)
584+include $(BUILD_HOST_STATIC_LIBRARY)
585diff --git a/lib/AST/Android.mk b/lib/AST/Android.mk
586new file mode 100644
587index 0000000..9d0c005
588--- /dev/null
589+++ b/lib/AST/Android.mk
590@@ -0,0 +1,94 @@
591+LOCAL_PATH:= $(call my-dir)
592+
593+# For the host only
594+# =====================================================
595+include $(CLEAR_VARS)
596+include $(CLEAR_TBLGEN_VARS)
597+
598+TBLGEN_TABLES :=    \
599+	AttrDump.inc	\
600+	AttrImpl.inc	\
601+	AttrList.inc	\
602+	Attrs.inc	\
603+        AttrVisitor.inc \
604+	CommentCommandInfo.inc \
605+	CommentCommandList.inc \
606+	CommentHTMLNamedCharacterReferences.inc \
607+	CommentHTMLTags.inc \
608+	CommentHTMLTagsProperties.inc \
609+	CommentNodes.inc \
610+	DeclNodes.inc	\
611+	DiagnosticASTKinds.inc	\
612+	DiagnosticCommentKinds.inc \
613+	DiagnosticCommonKinds.inc	\
614+	DiagnosticSemaKinds.inc	\
615+	StmtNodes.inc
616+
617+clang_ast_SRC_FILES :=	\
618+	APValue.cpp	\
619+	ASTConsumer.cpp	\
620+	ASTContext.cpp	\
621+	ASTDiagnostic.cpp	\
622+	ASTDumper.cpp	\
623+	ASTImporter.cpp	\
624+	ASTTypeTraits.cpp \
625+	AttrImpl.cpp	\
626+	Comment.cpp \
627+	CommentBriefParser.cpp \
628+	CommentCommandTraits.cpp \
629+	CommentLexer.cpp \
630+	CommentParser.cpp \
631+	CommentSema.cpp \
632+	CXXInheritance.cpp	\
633+	Decl.cpp	\
634+	DeclarationName.cpp	\
635+	DeclBase.cpp	\
636+	DeclCXX.cpp	\
637+	DeclFriend.cpp	\
638+	DeclGroup.cpp	\
639+	DeclObjC.cpp	\
640+	DeclOpenMP.cpp	\
641+	DeclPrinter.cpp	\
642+	DeclTemplate.cpp	\
643+	Expr.cpp	\
644+	ExprClassification.cpp	\
645+	ExprConstant.cpp	\
646+	ExprCXX.cpp	\
647+	ExternalASTSource.cpp	\
648+	InheritViz.cpp	\
649+	ItaniumCXXABI.cpp	\
650+	ItaniumMangle.cpp	\
651+	Mangle.cpp	\
652+	MangleNumberingContext.cpp \
653+	MicrosoftCXXABI.cpp	\
654+	MicrosoftMangle.cpp	\
655+	NestedNameSpecifier.cpp	\
656+        NSAPI.cpp       \
657+	ParentMap.cpp	\
658+	RecordLayout.cpp	\
659+	RecordLayoutBuilder.cpp	\
660+	RawCommentList.cpp \
661+	SelectorLocationsKind.cpp \
662+	Stmt.cpp	\
663+	StmtIterator.cpp	\
664+	StmtPrinter.cpp	\
665+	StmtProfile.cpp	\
666+	StmtViz.cpp	\
667+	TemplateBase.cpp	\
668+	TemplateName.cpp	\
669+	Type.cpp	\
670+	TypeLoc.cpp	\
671+	TypePrinter.cpp \
672+	VTTBuilder.cpp \
673+	VTableBuilder.cpp
674+
675+LOCAL_SRC_FILES := $(clang_ast_SRC_FILES)
676+
677+LOCAL_MODULE:= libclangAST
678+LOCAL_MODULE_TAGS := optional
679+
680+LOCAL_MODULE_TAGS := optional
681+
682+include $(CLANG_HOST_BUILD_MK)
683+include $(CLANG_TBLGEN_RULES_MK)
684+include $(BUILD_HOST_STATIC_LIBRARY)
685diff --git a/lib/Analysis/Android.mk b/lib/Analysis/Android.mk
686new file mode 100644
687index 0000000..8ccbf3e
688--- /dev/null
689+++ b/lib/Analysis/Android.mk
690@@ -0,0 +1,51 @@
691+LOCAL_PATH:= $(call my-dir)
692+
693+# For the host only
694+# =====================================================
695+include $(CLEAR_VARS)
696+include $(CLEAR_TBLGEN_VARS)
697+
698+TBLGEN_TABLES := \
699+  AttrList.inc \
700+  Attrs.inc \
701+  AttrVisitor.inc \
702+  CommentCommandList.inc \
703+  CommentNodes.inc \
704+  DeclNodes.inc \
705+  DiagnosticCommonKinds.inc \
706+  DiagnosticAnalysisKinds.inc \
707+  StmtNodes.inc
708+
709+clang_analysis_SRC_FILES := \
710+  AnalysisDeclContext.cpp \
711+  BodyFarm.cpp \
712+  CallGraph.cpp \
713+  CFG.cpp \
714+  CFGReachabilityAnalysis.cpp \
715+  CFGStmtMap.cpp \
716+  CocoaConventions.cpp \
717+  Consumed.cpp \
718+  Dominators.cpp \
719+  FormatString.cpp \
720+  LiveVariables.cpp \
721+  ObjCNoReturn.cpp \
722+  PostOrderCFGView.cpp \
723+  PrintfFormatString.cpp \
724+  ProgramPoint.cpp \
725+  PseudoConstantAnalysis.cpp \
726+  ReachableCode.cpp \
727+  ScanfFormatString.cpp \
728+  ThreadSafety.cpp \
729+  UninitializedValues.cpp
730+
731+
732+LOCAL_SRC_FILES := $(clang_analysis_SRC_FILES)
733+
734+LOCAL_MODULE:= libclangAnalysis
735+LOCAL_MODULE_TAGS := optional
736+
737+LOCAL_MODULE_TAGS := optional
738+
739+include $(CLANG_HOST_BUILD_MK)
740+include $(CLANG_TBLGEN_RULES_MK)
741+include $(BUILD_HOST_STATIC_LIBRARY)
742diff --git a/lib/Basic/Android.mk b/lib/Basic/Android.mk
743new file mode 100644
744index 0000000..54e61c2
745--- /dev/null
746+++ b/lib/Basic/Android.mk
747@@ -0,0 +1,57 @@
748+LOCAL_PATH:= $(call my-dir)
749+
750+# For the host only
751+# =====================================================
752+include $(CLEAR_VARS)
753+include $(CLEAR_TBLGEN_VARS)
754+
755+TBLGEN_TABLES := \
756+  AttrHasAttributeImpl.inc \
757+  DiagnosticASTKinds.inc \
758+  DiagnosticAnalysisKinds.inc \
759+  DiagnosticCommentKinds.inc \
760+  DiagnosticCommonKinds.inc \
761+  DiagnosticDriverKinds.inc \
762+  DiagnosticFrontendKinds.inc \
763+  DiagnosticGroups.inc \
764+  DiagnosticIndexName.inc \
765+  DiagnosticLexKinds.inc \
766+  DiagnosticParseKinds.inc \
767+  DiagnosticSemaKinds.inc \
768+  DiagnosticSerializationKinds.inc \
769+  arm_neon.inc
770+
771+clang_basic_SRC_FILES := \
772+  Attributes.cpp \
773+  Builtins.cpp \
774+  CharInfo.cpp \
775+  Diagnostic.cpp \
776+  DiagnosticIDs.cpp \
777+  FileManager.cpp \
778+  FileSystemStatCache.cpp \
779+  IdentifierTable.cpp \
780+  LangOptions.cpp \
781+  Module.cpp \
782+  ObjCRuntime.cpp \
783+  OpenMPKinds.cpp \
784+  OperatorPrecedence.cpp \
785+  SourceLocation.cpp \
786+  SourceManager.cpp \
787+  TargetInfo.cpp \
788+  Targets.cpp \
789+  TokenKinds.cpp \
790+  Version.cpp \
791+  VersionTuple.cpp \
792+  VirtualFileSystem.cpp
793+
794+LOCAL_SRC_FILES := $(clang_basic_SRC_FILES)
795+
796+LOCAL_MODULE:= libclangBasic
797+LOCAL_MODULE_TAGS := optional
798+
799+LOCAL_MODULE_TAGS := optional
800+
801+include $(CLANG_HOST_BUILD_MK)
802+include $(CLANG_VERSION_INC_MK)
803+include $(CLANG_TBLGEN_RULES_MK)
804+include $(BUILD_HOST_STATIC_LIBRARY)
805diff --git a/lib/CodeGen/Android.mk b/lib/CodeGen/Android.mk
806new file mode 100644
807index 0000000..1c4a0b7
808--- /dev/null
809+++ b/lib/CodeGen/Android.mk
810@@ -0,0 +1,75 @@
811+LOCAL_PATH:= $(call my-dir)
812+
813+clang_codegen_TBLGEN_TABLES := \
814+  AttrList.inc \
815+  Attrs.inc \
816+  AttrVisitor.inc \
817+  CommentCommandList.inc \
818+  CommentNodes.inc \
819+  DeclNodes.inc \
820+  DiagnosticCommonKinds.inc \
821+  DiagnosticFrontendKinds.inc \
822+  DiagnosticSemaKinds.inc \
823+  StmtNodes.inc \
824+  arm_neon.inc
825+
826+clang_codegen_SRC_FILES := \
827+  BackendUtil.cpp \
828+  CGAtomic.cpp \
829+  CGBlocks.cpp \
830+  CGBuiltin.cpp \
831+  CGCUDANV.cpp \
832+  CGCUDARuntime.cpp \
833+  CGCXX.cpp \
834+  CGCXXABI.cpp \
835+  CGCall.cpp \
836+  CGClass.cpp \
837+  CGCleanup.cpp \
838+  CGDebugInfo.cpp \
839+  CGDecl.cpp \
840+  CGDeclCXX.cpp \
841+  CGException.cpp \
842+  CGExpr.cpp \
843+  CGExprAgg.cpp \
844+  CGExprCXX.cpp \
845+  CGExprComplex.cpp \
846+  CGExprConstant.cpp \
847+  CGExprScalar.cpp \
848+  CGObjC.cpp \
849+  CGObjCGNU.cpp \
850+  CGObjCMac.cpp \
851+  CGObjCRuntime.cpp \
852+  CGOpenCLRuntime.cpp \
853+  CGRTTI.cpp \
854+  CGRecordLayoutBuilder.cpp \
855+  CGStmt.cpp \
856+  CGVTT.cpp \
857+  CGVTables.cpp \
858+  CodeGenABITypes.cpp \
859+  CodeGenAction.cpp \
860+  CodeGenFunction.cpp \
861+  CodeGenModule.cpp \
862+  CodeGenPGO.cpp \
863+  CodeGenTBAA.cpp \
864+  CodeGenTypes.cpp \
865+  ItaniumCXXABI.cpp \
866+  MicrosoftCXXABI.cpp \
867+  ModuleBuilder.cpp \
868+  TargetInfo.cpp
869+
870+# For the host only
871+# =====================================================
872+include $(CLEAR_VARS)
873+include $(CLEAR_TBLGEN_VARS)
874+
875+LOCAL_MODULE:= libclangCodeGen
876+LOCAL_MODULE_TAGS := optional
877+
878+LOCAL_SRC_FILES := $(clang_codegen_SRC_FILES)
879+TBLGEN_TABLES := $(clang_codegen_TBLGEN_TABLES)
880+
881+include $(CLANG_HOST_BUILD_MK)
882+include $(CLANG_VERSION_INC_MK)
883+include $(CLANG_TBLGEN_RULES_MK)
884+include $(LLVM_GEN_INTRINSICS_MK)
885+include $(BUILD_HOST_STATIC_LIBRARY)
886diff --git a/lib/Driver/Android.mk b/lib/Driver/Android.mk
887new file mode 100644
888index 0000000..559ca83
889--- /dev/null
890+++ b/lib/Driver/Android.mk
891@@ -0,0 +1,44 @@
892+LOCAL_PATH:= $(call my-dir)
893+
894+# For the host only
895+# =====================================================
896+include $(CLEAR_VARS)
897+include $(CLEAR_TBLGEN_VARS)
898+
899+TBLGEN_TABLES := \
900+  AttrVisitor.inc \
901+  DiagnosticCommonKinds.inc \
902+  DiagnosticDriverKinds.inc \
903+  DiagnosticSemaKinds.inc \
904+  Options.inc \
905+  CC1Options.inc \
906+  CC1AsOptions.inc
907+
908+clang_driver_SRC_FILES := \
909+  Action.cpp \
910+  CC1AsOptions.cpp \
911+  Compilation.cpp \
912+  Driver.cpp \
913+  DriverOptions.cpp \
914+  Job.cpp \
915+  Multilib.cpp \
916+  Phases.cpp \
917+  SanitizerArgs.cpp \
918+  Tool.cpp \
919+  ToolChain.cpp \
920+  ToolChains.cpp \
921+  Tools.cpp \
922+  Types.cpp \
923+  WindowsToolChain.cpp
924+
925+LOCAL_SRC_FILES := $(clang_driver_SRC_FILES)
926+
927+LOCAL_MODULE := libclangDriver
928+LOCAL_MODULE_TAGS := optional
929+
930+LOCAL_MODULE_TAGS := optional
931+
932+include $(CLANG_HOST_BUILD_MK)
933+include $(CLANG_TBLGEN_RULES_MK)
934+include $(CLANG_VERSION_INC_MK)
935+include $(BUILD_HOST_STATIC_LIBRARY)
936diff --git a/lib/Edit/Android.mk b/lib/Edit/Android.mk
937new file mode 100644
938index 0000000..87f4e25
939--- /dev/null
940+++ b/lib/Edit/Android.mk
941@@ -0,0 +1,32 @@
942+LOCAL_PATH:= $(call my-dir)
943+
944+clang_edit_SRC_FILES := \
945+  Commit.cpp \
946+  EditedSource.cpp \
947+  RewriteObjCFoundationAPI.cpp
948+
949+
950+# For the host only
951+# =====================================================
952+include $(CLEAR_VARS)
953+include $(CLEAR_TBLGEN_VARS)
954+
955+TBLGEN_TABLES := \
956+  Attrs.inc \
957+  AttrList.inc \
958+  CommentCommandList.inc \
959+  CommentNodes.inc \
960+  DeclNodes.inc \
961+  DiagnosticCommonKinds.inc \
962+  StmtNodes.inc
963+
964+LOCAL_SRC_FILES := $(clang_edit_SRC_FILES)
965+
966+LOCAL_MODULE:= libclangEdit
967+
968+LOCAL_MODULE_TAGS := optional
969+
970+include $(CLANG_HOST_BUILD_MK)
971+include $(CLANG_VERSION_INC_MK)
972+include $(CLANG_TBLGEN_RULES_MK)
973+include $(BUILD_HOST_STATIC_LIBRARY)
974diff --git a/lib/Format/Android.mk b/lib/Format/Android.mk
975new file mode 100644
976index 0000000..302f28f
977--- /dev/null
978+++ b/lib/Format/Android.mk
979@@ -0,0 +1,43 @@
980+LOCAL_PATH:= $(call my-dir)
981+
982+# For the host only
983+# =====================================================
984+include $(CLEAR_VARS)
985+include $(CLEAR_TBLGEN_VARS)
986+
987+TBLGEN_TABLES := \
988+  AttrHasAttributeImpl.inc \
989+  DiagnosticASTKinds.inc \
990+  DiagnosticAnalysisKinds.inc \
991+  DiagnosticCommentKinds.inc \
992+  DiagnosticCommonKinds.inc \
993+  DiagnosticDriverKinds.inc \
994+  DiagnosticFrontendKinds.inc \
995+  DiagnosticGroups.inc \
996+  DiagnosticIndexName.inc \
997+  DiagnosticLexKinds.inc \
998+  DiagnosticParseKinds.inc \
999+  DiagnosticSemaKinds.inc \
1000+  DiagnosticSerializationKinds.inc \
1001+  arm_neon.inc
1002+
1003+clang_format_SRC_FILES := \
1004+  BreakableToken.cpp \
1005+  ContinuationIndenter.cpp \
1006+  Format.cpp \
1007+  FormatToken.cpp \
1008+  TokenAnnotator.cpp \
1009+  UnwrappedLineParser.cpp \
1010+  WhitespaceManager.cpp
1011+
1012+LOCAL_SRC_FILES := $(clang_format_SRC_FILES)
1013+
1014+LOCAL_MODULE:= libclangFormat
1015+LOCAL_MODULE_TAGS := optional
1016+
1017+LOCAL_MODULE_TAGS := optional
1018+
1019+include $(CLANG_HOST_BUILD_MK)
1020+include $(CLANG_VERSION_INC_MK)
1021+include $(CLANG_TBLGEN_RULES_MK)
1022+include $(BUILD_HOST_STATIC_LIBRARY)
1023diff --git a/lib/Frontend/Android.mk b/lib/Frontend/Android.mk
1024new file mode 100644
1025index 0000000..c3c42c3
1026--- /dev/null
1027+++ b/lib/Frontend/Android.mk
1028@@ -0,0 +1,66 @@
1029+LOCAL_PATH:= $(call my-dir)
1030+
1031+# For the host only
1032+# =====================================================
1033+include $(CLEAR_VARS)
1034+include $(CLEAR_TBLGEN_VARS)
1035+
1036+TBLGEN_TABLES := \
1037+  AttrList.inc \
1038+  Attrs.inc \
1039+  AttrParsedAttrList.inc \
1040+  AttrVisitor.inc \
1041+  CC1Options.inc \
1042+  CommentCommandList.inc \
1043+  CommentNodes.inc \
1044+  DiagnosticASTKinds.inc \
1045+  DiagnosticCommonKinds.inc \
1046+  DiagnosticDriverKinds.inc \
1047+  DiagnosticFrontendKinds.inc \
1048+  DiagnosticLexKinds.inc \
1049+  DiagnosticSemaKinds.inc \
1050+  DeclNodes.inc \
1051+  StmtNodes.inc
1052+
1053+clang_frontend_SRC_FILES := \
1054+  ASTConsumers.cpp \
1055+  ASTMerge.cpp \
1056+  ASTUnit.cpp \
1057+  CacheTokens.cpp \
1058+  ChainedDiagnosticConsumer.cpp \
1059+  ChainedIncludesSource.cpp \
1060+  CompilerInstance.cpp \
1061+  CompilerInvocation.cpp \
1062+  CreateInvocationFromCommandLine.cpp \
1063+  DependencyFile.cpp \
1064+  DependencyGraph.cpp \
1065+  DiagnosticRenderer.cpp \
1066+  FrontendAction.cpp \
1067+  FrontendActions.cpp \
1068+  FrontendOptions.cpp \
1069+  HeaderIncludeGen.cpp \
1070+  InitHeaderSearch.cpp \
1071+  InitPreprocessor.cpp \
1072+  LangStandards.cpp \
1073+  LayoutOverrideSource.cpp \
1074+  LogDiagnosticPrinter.cpp \
1075+  MultiplexConsumer.cpp \
1076+  PrintPreprocessedOutput.cpp \
1077+  SerializedDiagnosticPrinter.cpp \
1078+  TextDiagnostic.cpp \
1079+  TextDiagnosticBuffer.cpp \
1080+  TextDiagnosticPrinter.cpp \
1081+  Warnings.cpp \
1082+  VerifyDiagnosticConsumer.cpp
1083+
1084+LOCAL_SRC_FILES := $(clang_frontend_SRC_FILES)
1085+
1086+LOCAL_MODULE:= libclangFrontend
1087+LOCAL_MODULE_TAGS:= optional
1088+
1089+LOCAL_MODULE_TAGS := optional
1090+
1091+include $(CLANG_HOST_BUILD_MK)
1092+include $(CLANG_TBLGEN_RULES_MK)
1093+include $(CLANG_VERSION_INC_MK)
1094+include $(BUILD_HOST_STATIC_LIBRARY)
1095diff --git a/lib/FrontendTool/Android.mk b/lib/FrontendTool/Android.mk
1096new file mode 100644
1097index 0000000..2496f6b
1098--- /dev/null
1099+++ b/lib/FrontendTool/Android.mk
1100@@ -0,0 +1,24 @@
1101+LOCAL_PATH:= $(call my-dir)
1102+
1103+# For the host only
1104+# =====================================================
1105+include $(CLEAR_VARS)
1106+include $(CLEAR_TBLGEN_VARS)
1107+
1108+LOCAL_MODULE:= libclangFrontendTool
1109+
1110+LOCAL_MODULE_TAGS := optional
1111+
1112+TBLGEN_TABLES := \
1113+  DiagnosticCommonKinds.inc \
1114+  DiagnosticFrontendKinds.inc \
1115+  CC1Options.inc
1116+
1117+clang_frontend_tool_SRC_FILES := \
1118+  ExecuteCompilerInvocation.cpp
1119+
1120+LOCAL_SRC_FILES := $(clang_frontend_tool_SRC_FILES)
1121+
1122+include $(CLANG_HOST_BUILD_MK)
1123+include $(CLANG_TBLGEN_RULES_MK)
1124+include $(BUILD_HOST_STATIC_LIBRARY)
1125diff --git a/lib/Headers/Android.mk b/lib/Headers/Android.mk
1126new file mode 100644
1127index 0000000..117129e
1128--- /dev/null
1129+++ b/lib/Headers/Android.mk
1130@@ -0,0 +1,11 @@
1131+LOCAL_PATH:= $(call my-dir)
1132+
1133+include $(CLEAR_VARS)
1134+
1135+$(TARGET_OUT_HEADERS)/clang/arm_neon.h: TBLGEN_LOCAL_MODULE := arm_neon.h
1136+$(TARGET_OUT_HEADERS)/clang/arm_neon.h: $(CLANG_ROOT_PATH)/include/clang/Basic/arm_neon.td \
1137+    | $(CLANG_TBLGEN)
1138+	$(call transform-host-clang-td-to-out,arm-neon)
1139+
1140+# Make sure when clang is used, arm_neon.h does exist.
1141+$(CLANG): | $(TARGET_OUT_HEADERS)/clang/arm_neon.h
1142diff --git a/lib/Lex/Android.mk b/lib/Lex/Android.mk
1143new file mode 100644
1144index 0000000..a5e9661
1145--- /dev/null
1146+++ b/lib/Lex/Android.mk
1147@@ -0,0 +1,45 @@
1148+LOCAL_PATH:= $(call my-dir)
1149+
1150+# For the host only
1151+# =====================================================
1152+include $(CLEAR_VARS)
1153+include $(CLEAR_TBLGEN_VARS)
1154+
1155+TBLGEN_TABLES := \
1156+  DiagnosticLexKinds.inc \
1157+  DiagnosticCommonKinds.inc
1158+
1159+clang_lex_SRC_FILES := \
1160+  HeaderMap.cpp \
1161+  HeaderSearch.cpp \
1162+  Lexer.cpp \
1163+  LiteralSupport.cpp \
1164+  MacroArgs.cpp \
1165+  MacroInfo.cpp \
1166+  ModuleMap.cpp \
1167+  PPCaching.cpp \
1168+  PPCallbacks.cpp \
1169+  PPConditionalDirectiveRecord.cpp \
1170+  PPDirectives.cpp \
1171+  PPExpressions.cpp \
1172+  PPLexerChange.cpp \
1173+  PPMacroExpansion.cpp \
1174+  PTHLexer.cpp \
1175+  Pragma.cpp \
1176+  PreprocessingRecord.cpp \
1177+  Preprocessor.cpp \
1178+  PreprocessorLexer.cpp \
1179+  ScratchBuffer.cpp \
1180+  TokenConcatenation.cpp \
1181+  TokenLexer.cpp
1182+
1183+LOCAL_SRC_FILES := $(clang_lex_SRC_FILES)
1184+
1185+LOCAL_MODULE:= libclangLex
1186+LOCAL_MODULE_TAGS := optional
1187+
1188+LOCAL_MODULE_TAGS := optional
1189+
1190+include $(CLANG_HOST_BUILD_MK)
1191+include $(CLANG_TBLGEN_RULES_MK)
1192+include $(BUILD_HOST_STATIC_LIBRARY)
1193diff --git a/lib/Parse/Android.mk b/lib/Parse/Android.mk
1194new file mode 100644
1195index 0000000..5bc2200
1196--- /dev/null
1197+++ b/lib/Parse/Android.mk
1198@@ -0,0 +1,47 @@
1199+LOCAL_PATH:= $(call my-dir)
1200+
1201+# For the host only
1202+# =====================================================
1203+include $(CLEAR_VARS)
1204+include $(CLEAR_TBLGEN_VARS)
1205+
1206+TBLGEN_TABLES :=  \
1207+	AttrList.inc  \
1208+	AttrParsedAttrList.inc  \
1209+	Attrs.inc  \
1210+        AttrVisitor.inc \
1211+        AttrParserStringSwitches.inc \
1212+	CommentCommandList.inc \
1213+	CommentNodes.inc \
1214+	DeclNodes.inc  \
1215+	DiagnosticParseKinds.inc  \
1216+        DiagnosticCommonKinds.inc  \
1217+	DiagnosticSemaKinds.inc	\
1218+	StmtNodes.inc
1219+
1220+clang_parse_SRC_FILES :=  \
1221+	ParseAST.cpp  \
1222+	ParseCXXInlineMethods.cpp  \
1223+	ParseDecl.cpp  \
1224+	ParseDeclCXX.cpp  \
1225+	ParseExpr.cpp  \
1226+	ParseExprCXX.cpp  \
1227+	ParseInit.cpp  \
1228+	ParseObjc.cpp  \
1229+	ParseOpenMP.cpp  \
1230+	ParsePragma.cpp  \
1231+	ParseStmt.cpp  \
1232+	ParseTemplate.cpp  \
1233+	ParseTentative.cpp  \
1234+	Parser.cpp
1235+
1236+LOCAL_SRC_FILES := $(clang_parse_SRC_FILES)
1237+
1238+LOCAL_MODULE:= libclangParse
1239+LOCAL_MODULE_TAGS := optional
1240+
1241+LOCAL_MODULE_TAGS := optional
1242+
1243+include $(CLANG_HOST_BUILD_MK)
1244+include $(CLANG_TBLGEN_RULES_MK)
1245+include $(BUILD_HOST_STATIC_LIBRARY)
1246diff --git a/lib/Rewrite/Core/Android.mk b/lib/Rewrite/Core/Android.mk
1247new file mode 100644
1248index 0000000..546fc04
1249--- /dev/null
1250+++ b/lib/Rewrite/Core/Android.mk
1251@@ -0,0 +1,34 @@
1252+LOCAL_PATH:= $(call my-dir)
1253+
1254+# For the host only
1255+# =====================================================
1256+include $(CLEAR_VARS)
1257+include $(CLEAR_TBLGEN_VARS)
1258+
1259+LOCAL_MODULE:= libclangRewriteCore
1260+
1261+LOCAL_MODULE_TAGS := optional
1262+
1263+TBLGEN_TABLES := \
1264+  AttrList.inc \
1265+  Attrs.inc \
1266+  AttrParsedAttrList.inc \
1267+  CommentNodes.inc \
1268+  DeclNodes.inc \
1269+  DiagnosticCommonKinds.inc \
1270+  DiagnosticFrontendKinds.inc \
1271+  StmtNodes.inc
1272+
1273+clang_rewrite_core_SRC_FILES := \
1274+  DeltaTree.cpp \
1275+  HTMLRewrite.cpp \
1276+  RewriteRope.cpp \
1277+  Rewriter.cpp \
1278+  TokenRewriter.cpp
1279+
1280+LOCAL_SRC_FILES := $(clang_rewrite_core_SRC_FILES)
1281+
1282+
1283+include $(CLANG_HOST_BUILD_MK)
1284+include $(CLANG_TBLGEN_RULES_MK)
1285+include $(BUILD_HOST_STATIC_LIBRARY)
1286diff --git a/lib/Rewrite/Frontend/Android.mk b/lib/Rewrite/Frontend/Android.mk
1287new file mode 100644
1288index 0000000..2bbf311
1289--- /dev/null
1290+++ b/lib/Rewrite/Frontend/Android.mk
1291@@ -0,0 +1,38 @@
1292+LOCAL_PATH:= $(call my-dir)
1293+
1294+# For the host only
1295+# =====================================================
1296+include $(CLEAR_VARS)
1297+include $(CLEAR_TBLGEN_VARS)
1298+
1299+LOCAL_MODULE:= libclangRewriteFrontend
1300+
1301+LOCAL_MODULE_TAGS := optional
1302+
1303+TBLGEN_TABLES := \
1304+  AttrList.inc \
1305+  Attrs.inc \
1306+  AttrParsedAttrList.inc \
1307+  CommentCommandList.inc \
1308+  CommentNodes.inc \
1309+  DeclNodes.inc \
1310+  DiagnosticCommonKinds.inc \
1311+  DiagnosticFrontendKinds.inc \
1312+  StmtNodes.inc
1313+
1314+clang_rewrite_frontend_SRC_FILES := \
1315+  FixItRewriter.cpp \
1316+  FrontendActions.cpp \
1317+  HTMLPrint.cpp \
1318+  InclusionRewriter.cpp \
1319+  RewriteMacros.cpp \
1320+  RewriteModernObjC.cpp \
1321+  RewriteObjC.cpp \
1322+  RewriteTest.cpp
1323+
1324+LOCAL_SRC_FILES := $(clang_rewrite_frontend_SRC_FILES)
1325+
1326+
1327+include $(CLANG_HOST_BUILD_MK)
1328+include $(CLANG_TBLGEN_RULES_MK)
1329+include $(BUILD_HOST_STATIC_LIBRARY)
1330diff --git a/lib/Sema/Android.mk b/lib/Sema/Android.mk
1331new file mode 100644
1332index 0000000..77a2e93
1333--- /dev/null
1334+++ b/lib/Sema/Android.mk
1335@@ -0,0 +1,84 @@
1336+LOCAL_PATH:= $(call my-dir)
1337+
1338+# For the host only
1339+# =====================================================
1340+include $(CLEAR_VARS)
1341+include $(CLEAR_TBLGEN_VARS)
1342+
1343+TBLGEN_TABLES :=    \
1344+	AttrList.inc	\
1345+	Attrs.inc	\
1346+	AttrParsedAttrKinds.inc    \
1347+	AttrParsedAttrImpl.inc    \
1348+	AttrParsedAttrList.inc    \
1349+	AttrSpellingListIndex.inc \
1350+	AttrTemplateInstantiate.inc	\
1351+        AttrVisitor.inc \
1352+	CommentCommandList.inc \
1353+	CommentNodes.inc \
1354+	DeclNodes.inc	\
1355+	DiagnosticASTKinds.inc	\
1356+	DiagnosticSemaKinds.inc	\
1357+	DiagnosticParseKinds.inc	\
1358+	DiagnosticCommentKinds.inc \
1359+	DiagnosticCommonKinds.inc	\
1360+	StmtNodes.inc	\
1361+	arm_neon.inc
1362+
1363+clang_sema_SRC_FILES :=	\
1364+	AnalysisBasedWarnings.cpp	\
1365+	AttributeList.cpp	\
1366+	CodeCompleteConsumer.cpp	\
1367+	DeclSpec.cpp	\
1368+	IdentifierResolver.cpp	\
1369+	DelayedDiagnostic.cpp \
1370+	JumpDiagnostics.cpp	\
1371+	MultiplexExternalSemaSource.cpp \
1372+	Scope.cpp \
1373+	ScopeInfo.cpp \
1374+	Sema.cpp	\
1375+	SemaAccess.cpp	\
1376+	SemaAttr.cpp	\
1377+	SemaCXXScopeSpec.cpp	\
1378+	SemaCast.cpp \
1379+	SemaChecking.cpp	\
1380+	SemaCodeComplete.cpp	\
1381+	SemaConsumer.cpp	\
1382+	SemaDecl.cpp	\
1383+	SemaDeclAttr.cpp	\
1384+	SemaDeclCXX.cpp	\
1385+	SemaDeclObjC.cpp	\
1386+	SemaExceptionSpec.cpp	\
1387+	SemaExpr.cpp	\
1388+	SemaExprCXX.cpp	\
1389+	SemaExprMember.cpp \
1390+	SemaExprObjC.cpp	\
1391+	SemaFixItUtils.cpp \
1392+	SemaInit.cpp	\
1393+	SemaLambda.cpp	\
1394+	SemaLookup.cpp	\
1395+	SemaObjCProperty.cpp	\
1396+	SemaOpenMP.cpp	\
1397+	SemaOverload.cpp	\
1398+	SemaPseudoObject.cpp	\
1399+	SemaStmt.cpp	\
1400+        SemaStmtAsm.cpp \
1401+        SemaStmtAttr.cpp \
1402+	SemaTemplate.cpp	\
1403+	SemaTemplateDeduction.cpp	\
1404+	SemaTemplateInstantiate.cpp	\
1405+	SemaTemplateInstantiateDecl.cpp	\
1406+	SemaTemplateVariadic.cpp	\
1407+	SemaType.cpp	\
1408+	TypeLocBuilder.cpp
1409+
1410+LOCAL_SRC_FILES := $(clang_sema_SRC_FILES)
1411+
1412+LOCAL_MODULE:= libclangSema
1413+LOCAL_MODULE_TAGS := optional
1414+
1415+LOCAL_MODULE_TAGS := optional
1416+
1417+include $(CLANG_HOST_BUILD_MK)
1418+include $(CLANG_TBLGEN_RULES_MK)
1419+include $(BUILD_HOST_STATIC_LIBRARY)
1420diff --git a/lib/Serialization/Android.mk b/lib/Serialization/Android.mk
1421new file mode 100644
1422index 0000000..751e306
1423--- /dev/null
1424+++ b/lib/Serialization/Android.mk
1425@@ -0,0 +1,46 @@
1426+LOCAL_PATH:= $(call my-dir)
1427+
1428+# For the host only
1429+# =====================================================
1430+include $(CLEAR_VARS)
1431+include $(CLEAR_TBLGEN_VARS)
1432+
1433+LOCAL_MODULE:= libclangSerialization
1434+
1435+LOCAL_MODULE_TAGS := optional
1436+
1437+TBLGEN_TABLES := \
1438+  AttrList.inc \
1439+  AttrParsedAttrList.inc \
1440+  AttrPCHRead.inc \
1441+  AttrPCHWrite.inc \
1442+  Attrs.inc \
1443+  CommentCommandList.inc \
1444+  CommentNodes.inc \
1445+  DeclNodes.inc \
1446+  DiagnosticCommonKinds.inc \
1447+  DiagnosticFrontendKinds.inc \
1448+  DiagnosticSemaKinds.inc \
1449+  DiagnosticSerializationKinds.inc \
1450+  StmtNodes.inc
1451+
1452+clang_serialization_SRC_FILES :=\
1453+  ASTCommon.cpp \
1454+  ASTReader.cpp \
1455+  ASTReaderDecl.cpp \
1456+  ASTReaderStmt.cpp \
1457+  ASTWriter.cpp \
1458+  ASTWriterDecl.cpp \
1459+  ASTWriterStmt.cpp \
1460+  GeneratePCH.cpp \
1461+  GlobalModuleIndex.cpp \
1462+  Module.cpp \
1463+  ModuleManager.cpp
1464+
1465+LOCAL_SRC_FILES := $(clang_serialization_SRC_FILES)
1466+
1467+
1468+include $(CLANG_HOST_BUILD_MK)
1469+include $(CLANG_TBLGEN_RULES_MK)
1470+include $(CLANG_VERSION_INC_MK)
1471+include $(BUILD_HOST_STATIC_LIBRARY)
1472diff --git a/lib/StaticAnalyzer/Checkers/Android.mk b/lib/StaticAnalyzer/Checkers/Android.mk
1473new file mode 100644
1474index 0000000..bb2a539
1475--- /dev/null
1476+++ b/lib/StaticAnalyzer/Checkers/Android.mk
1477@@ -0,0 +1,100 @@
1478+LOCAL_PATH:= $(call my-dir)
1479+
1480+clang_static_analyzer_checkers_TBLGEN_TABLES := \
1481+  AttrKinds.inc \
1482+  AttrList.inc \
1483+  AttrParsedAttrList.inc \
1484+  Attrs.inc \
1485+  AttrVisitor.inc \
1486+  Checkers.inc \
1487+  CommentCommandList.inc \
1488+  CommentNodes.inc \
1489+  DeclNodes.inc \
1490+  DiagnosticCommonKinds.inc \
1491+  StmtNodes.inc
1492+
1493+clang_static_analyzer_checkers_SRC_FILES := \
1494+  AllocationDiagnostics.cpp \
1495+  AnalyzerStatsChecker.cpp \
1496+  ArrayBoundChecker.cpp \
1497+  ArrayBoundCheckerV2.cpp \
1498+  BasicObjCFoundationChecks.cpp \
1499+  BoolAssignmentChecker.cpp \
1500+  BuiltinFunctionChecker.cpp \
1501+  CStringChecker.cpp \
1502+  CStringSyntaxChecker.cpp \
1503+  CallAndMessageChecker.cpp \
1504+  CastSizeChecker.cpp \
1505+  CastToStructChecker.cpp \
1506+  CheckObjCDealloc.cpp \
1507+  CheckObjCInstMethSignature.cpp \
1508+  CheckSecuritySyntaxOnly.cpp \
1509+  CheckSizeofPointer.cpp \
1510+  CheckerDocumentation.cpp \
1511+  ChrootChecker.cpp \
1512+  ClangCheckers.cpp \
1513+  DeadStoresChecker.cpp \
1514+  DebugCheckers.cpp \
1515+  DereferenceChecker.cpp \
1516+  DirectIvarAssignment.cpp \
1517+  DivZeroChecker.cpp \
1518+  DynamicTypePropagation.cpp \
1519+  ExprInspectionChecker.cpp \
1520+  FixedAddressChecker.cpp \
1521+  GenericTaintChecker.cpp \
1522+  IdenticalExprChecker.cpp \
1523+  IvarInvalidationChecker.cpp \
1524+  LLVMConventionsChecker.cpp \
1525+  MacOSKeychainAPIChecker.cpp \
1526+  MacOSXAPIChecker.cpp \
1527+  MallocChecker.cpp \
1528+  MallocOverflowSecurityChecker.cpp \
1529+  MallocSizeofChecker.cpp \
1530+  NSAutoreleasePoolChecker.cpp \
1531+  NSErrorChecker.cpp \
1532+  NoReturnFunctionChecker.cpp \
1533+  NonNullParamChecker.cpp \
1534+  ObjCAtSyncChecker.cpp \
1535+  ObjCContainersASTChecker.cpp \
1536+  ObjCContainersChecker.cpp \
1537+  ObjCMissingSuperCallChecker.cpp \
1538+  ObjCSelfInitChecker.cpp \
1539+  ObjCUnusedIVarsChecker.cpp \
1540+  PointerArithChecker.cpp \
1541+  PointerSubChecker.cpp \
1542+  PthreadLockChecker.cpp \
1543+  RetainCountChecker.cpp \
1544+  ReturnPointerRangeChecker.cpp \
1545+  ReturnUndefChecker.cpp \
1546+  SimpleStreamChecker.cpp \
1547+  StackAddrEscapeChecker.cpp \
1548+  StreamChecker.cpp \
1549+  TaintTesterChecker.cpp \
1550+  TraversalChecker.cpp \
1551+  UndefBranchChecker.cpp \
1552+  UndefCapturedBlockVarChecker.cpp \
1553+  UndefResultChecker.cpp \
1554+  UndefinedArraySubscriptChecker.cpp \
1555+  UndefinedAssignmentChecker.cpp \
1556+  UnixAPIChecker.cpp \
1557+  UnreachableCodeChecker.cpp \
1558+  VirtualCallChecker.cpp \
1559+  VLASizeChecker.cpp
1560+
1561+# For the host only
1562+# =====================================================
1563+include $(CLEAR_VARS)
1564+include $(CLEAR_TBLGEN_VARS)
1565+
1566+TBLGEN_TABLES := $(clang_static_analyzer_checkers_TBLGEN_TABLES)
1567+
1568+LOCAL_SRC_FILES := $(clang_static_analyzer_checkers_SRC_FILES)
1569+
1570+LOCAL_MODULE:= libclangStaticAnalyzerCheckers
1571+
1572+LOCAL_MODULE_TAGS := optional
1573+
1574+include $(CLANG_HOST_BUILD_MK)
1575+include $(CLANG_TBLGEN_RULES_MK)
1576+include $(CLANG_VERSION_INC_MK)
1577+include $(BUILD_HOST_STATIC_LIBRARY)
1578diff --git a/lib/StaticAnalyzer/Core/Android.mk b/lib/StaticAnalyzer/Core/Android.mk
1579new file mode 100644
1580index 0000000..68d2c36
1581--- /dev/null
1582+++ b/lib/StaticAnalyzer/Core/Android.mk
1583@@ -0,0 +1,68 @@
1584+LOCAL_PATH:= $(call my-dir)
1585+
1586+clang_static_analyzer_core_TBLGEN_TABLES := \
1587+  AttrList.inc \
1588+  Attrs.inc \
1589+  CommentCommandList.inc \
1590+  CommentNodes.inc \
1591+  DeclNodes.inc \
1592+  DiagnosticCommonKinds.inc \
1593+  StmtNodes.inc
1594+
1595+clang_static_analyzer_core_SRC_FILES := \
1596+  AnalysisManager.cpp \
1597+  AnalyzerOptions.cpp \
1598+  APSIntType.cpp \
1599+  BasicValueFactory.cpp \
1600+  BlockCounter.cpp \
1601+  BugReporter.cpp \
1602+  BugReporterVisitors.cpp \
1603+  CallEvent.cpp \
1604+  Checker.cpp \
1605+  CheckerContext.cpp \
1606+  CheckerHelpers.cpp \
1607+  CheckerManager.cpp \
1608+  CheckerRegistry.cpp \
1609+  CommonBugCategories.cpp \
1610+  ConstraintManager.cpp \
1611+  CoreEngine.cpp \
1612+  Environment.cpp \
1613+  ExplodedGraph.cpp \
1614+  ExprEngine.cpp \
1615+  ExprEngineC.cpp \
1616+  ExprEngineCXX.cpp \
1617+  ExprEngineCallAndReturn.cpp \
1618+  ExprEngineObjC.cpp \
1619+  FunctionSummary.cpp \
1620+  HTMLDiagnostics.cpp \
1621+  MemRegion.cpp \
1622+  PathDiagnostic.cpp \
1623+  PlistDiagnostics.cpp \
1624+  ProgramState.cpp \
1625+  RangeConstraintManager.cpp \
1626+  RegionStore.cpp \
1627+  SValBuilder.cpp \
1628+  SVals.cpp \
1629+  SimpleConstraintManager.cpp \
1630+  SimpleSValBuilder.cpp \
1631+  Store.cpp \
1632+  SubEngine.cpp \
1633+  SymbolManager.cpp
1634+
1635+# For the host only
1636+# =====================================================
1637+include $(CLEAR_VARS)
1638+include $(CLEAR_TBLGEN_VARS)
1639+
1640+TBLGEN_TABLES := $(clang_static_analyzer_core_TBLGEN_TABLES)
1641+
1642+LOCAL_SRC_FILES := $(clang_static_analyzer_core_SRC_FILES)
1643+
1644+LOCAL_MODULE:= libclangStaticAnalyzerCore
1645+
1646+LOCAL_MODULE_TAGS := optional
1647+
1648+include $(CLANG_HOST_BUILD_MK)
1649+include $(CLANG_TBLGEN_RULES_MK)
1650+include $(CLANG_VERSION_INC_MK)
1651+include $(BUILD_HOST_STATIC_LIBRARY)
1652diff --git a/lib/StaticAnalyzer/Frontend/Android.mk b/lib/StaticAnalyzer/Frontend/Android.mk
1653new file mode 100644
1654index 0000000..ccffdad
1655--- /dev/null
1656+++ b/lib/StaticAnalyzer/Frontend/Android.mk
1657@@ -0,0 +1,40 @@
1658+LOCAL_PATH:= $(call my-dir)
1659+
1660+clang_static_analyzer_frontend_C_INCLUDES := \
1661+  $(CLANG_ROOT_PATH)/lib/StaticAnalyzer/Checkers
1662+
1663+clang_static_analyzer_frontend_TBLGEN_TABLES := \
1664+  AttrList.inc \
1665+  Attrs.inc \
1666+  AttrVisitor.inc \
1667+  CommentCommandList.inc \
1668+  CommentNodes.inc \
1669+  DeclNodes.inc \
1670+  DiagnosticCommonKinds.inc \
1671+  DiagnosticFrontendKinds.inc \
1672+  StmtNodes.inc
1673+
1674+clang_static_analyzer_frontend_SRC_FILES := \
1675+  AnalysisConsumer.cpp \
1676+  CheckerRegistration.cpp \
1677+  FrontendActions.cpp
1678+
1679+# For the host only
1680+# =====================================================
1681+include $(CLEAR_VARS)
1682+include $(CLEAR_TBLGEN_VARS)
1683+
1684+TBLGEN_TABLES := $(clang_static_analyzer_frontend_TBLGEN_TABLES)
1685+
1686+LOCAL_SRC_FILES := $(clang_static_analyzer_frontend_SRC_FILES)
1687+
1688+LOCAL_C_INCLUDES := $(clang_static_analyzer_frontend_C_INCLUDES)
1689+
1690+LOCAL_MODULE:= libclangStaticAnalyzerFrontend
1691+
1692+LOCAL_MODULE_TAGS := optional
1693+
1694+include $(CLANG_HOST_BUILD_MK)
1695+include $(CLANG_TBLGEN_RULES_MK)
1696+include $(CLANG_VERSION_INC_MK)
1697+include $(BUILD_HOST_STATIC_LIBRARY)
1698diff --git a/tools/driver/Android.mk b/tools/driver/Android.mk
1699new file mode 100644
1700index 0000000..e7af560
1701--- /dev/null
1702+++ b/tools/driver/Android.mk
1703@@ -0,0 +1,119 @@
1704+LOCAL_PATH:= $(call my-dir)
1705+
1706+# For the host only
1707+# =====================================================
1708+include $(CLEAR_VARS)
1709+include $(CLEAR_TBLGEN_VARS)
1710+
1711+LOCAL_MODULE := clang
1712+
1713+LOCAL_MODULE_CLASS := EXECUTABLES
1714+
1715+TBLGEN_TABLES := \
1716+  DiagnosticCommonKinds.inc \
1717+  DiagnosticDriverKinds.inc \
1718+  DiagnosticFrontendKinds.inc \
1719+  CC1Options.inc \
1720+  CC1AsOptions.inc
1721+
1722+clang_SRC_FILES := \
1723+  cc1_main.cpp \
1724+  cc1as_main.cpp \
1725+  driver.cpp
1726+
1727+LOCAL_SRC_FILES := $(clang_SRC_FILES)
1728+
1729+LOCAL_STATIC_LIBRARIES := \
1730+  libclangFrontendTool \
1731+  libclangFrontend \
1732+  libclangARCMigrate \
1733+  libclangDriver \
1734+  libclangSerialization \
1735+  libclangCodeGen \
1736+  libclangRewriteFrontend \
1737+  libclangRewriteCore \
1738+  libclangParse \
1739+  libclangSema \
1740+  libclangStaticAnalyzerFrontend \
1741+  libclangStaticAnalyzerCheckers \
1742+  libclangStaticAnalyzerCore \
1743+  libclangAnalysis \
1744+  libclangEdit \
1745+  libclangAST \
1746+  libclangLex \
1747+  libclangBasic \
1748+  libLLVMARMAsmParser \
1749+  libLLVMARMCodeGen \
1750+  libLLVMARMAsmPrinter \
1751+  libLLVMARMDisassembler \
1752+  libLLVMARMDesc \
1753+  libLLVMARMInfo \
1754+  libLLVMMipsAsmParser \
1755+  libLLVMMipsCodeGen \
1756+  libLLVMMipsDisassembler \
1757+  libLLVMMipsAsmPrinter \
1758+  libLLVMMipsDesc \
1759+  libLLVMMipsInfo \
1760+  libLLVMX86Info \
1761+  libLLVMX86AsmParser \
1762+  libLLVMX86CodeGen \
1763+  libLLVMX86Disassembler \
1764+  libLLVMX86Desc \
1765+  libLLVMX86AsmPrinter \
1766+  libLLVMX86Utils \
1767+  libLLVMARM64Info \
1768+  libLLVMARM64AsmParser \
1769+  libLLVMARM64CodeGen \
1770+  libLLVMARM64Disassembler \
1771+  libLLVMARM64Desc \
1772+  libLLVMARM64AsmPrinter \
1773+  libLLVMARM64Utils \
1774+  libLLVMIRReader \
1775+  libLLVMAsmParser \
1776+  libLLVMAsmPrinter \
1777+  libLLVMBitReader \
1778+  libLLVMBitWriter \
1779+  libLLVMSelectionDAG \
1780+  libLLVMipo \
1781+  libLLVMipa \
1782+  libLLVMInstCombine \
1783+  libLLVMInstrumentation \
1784+  libLLVMCodeGen \
1785+  libLLVMObject \
1786+  libLLVMLinker \
1787+  libLLVMMC \
1788+  libLLVMMCParser \
1789+  libLLVMScalarOpts \
1790+  libLLVMTransformObjCARC \
1791+  libLLVMTransformUtils \
1792+  libLLVMVectorize \
1793+  libLLVMAnalysis \
1794+  libLLVMCore \
1795+  libLLVMOption \
1796+  libLLVMSupport \
1797+  libLLVMTarget
1798+
1799+LOCAL_LDLIBS += -lm
1800+ifdef USE_MINGW
1801+LOCAL_LDLIBS += -limagehlp
1802+else
1803+LOCAL_LDLIBS += -lpthread -ldl
1804+endif
1805+
1806+include $(CLANG_HOST_BUILD_MK)
1807+include $(CLANG_TBLGEN_RULES_MK)
1808+include $(BUILD_HOST_EXECUTABLE)
1809+
1810+ifeq (true,$(FORCE_BUILD_LLVM_COMPONENTS))
1811+# Make sure if clang (i.e. $(LOCAL_MODULE)) get installed,
1812+# clang++ will get installed as well.
1813+ALL_MODULES.$(LOCAL_MODULE).INSTALLED := \
1814+    $(ALL_MODULES.$(LOCAL_MODULE).INSTALLED) $(CLANG_CXX)
1815+# the additional dependency is needed when you run mm/mmm.
1816+$(LOCAL_MODULE) : $(CLANG_CXX)
1817+
1818+# Symlink for clang++
1819+$(CLANG_CXX) : $(LOCAL_INSTALLED_MODULE)
1820+	@echo "Symlink $@ -> $<"
1821+	$(hide) ln -sf $(notdir $<) $@
1822+endif
1823diff --git a/utils/TableGen/Android.mk b/utils/TableGen/Android.mk
1824new file mode 100644
1825index 0000000..4a40dc8
1826--- /dev/null
1827+++ b/utils/TableGen/Android.mk
1828@@ -0,0 +1,35 @@
1829+LOCAL_PATH:= $(call my-dir)
1830+
1831+clang_tablegen_SRC_FILES := \
1832+  ClangASTNodesEmitter.cpp \
1833+  ClangAttrEmitter.cpp \
1834+  ClangCommentCommandInfoEmitter.cpp \
1835+  ClangCommentHTMLNamedCharacterReferenceEmitter.cpp \
1836+  ClangCommentHTMLTagsEmitter.cpp \
1837+  ClangDiagnosticsEmitter.cpp \
1838+  ClangSACheckersEmitter.cpp \
1839+  NeonEmitter.cpp \
1840+  TableGen.cpp
1841+
1842+include $(CLEAR_VARS)
1843+
1844+LOCAL_MODULE := clang-tblgen
1845+LOCAL_MODULE_TAGS := optional
1846+LOCAL_SRC_FILES := $(clang_tablegen_SRC_FILES)
1847+
1848+REQUIRES_EH := 1
1849+REQUIRES_RTTI := 1
1850+
1851+LOCAL_STATIC_LIBRARIES := \
1852+  libLLVMTableGen \
1853+  libLLVMSupport
1854+
1855+LOCAL_LDLIBS += -lm
1856+ifeq ($(HOST_OS),windows)
1857+  LOCAL_LDLIBS += -limagehlp -lpsapi
1858+else
1859+  LOCAL_LDLIBS += -lpthread -ldl
1860+endif
1861+
1862+include $(LLVM_HOST_BUILD_MK)
1863+include $(BUILD_HOST_EXECUTABLE)
1864-- 
18651.9.1.423.g4596e3a
1866
1867