Home | History | Annotate | Download | only in patches
      1 From ca95c159402c89aff7dab5a29f3ea3b54c5a77a4 Mon Sep 17 00:00:00 2001
      2 From: Tim Murray <timmurray (a] google.com>
      3 Date: Thu, 27 Mar 2014 15:10:30 -0700
      4 Subject: [PATCH 4/5] Add Android makefiles for LLVM.
      5 
      6 Change-Id: I4f561d517605569e11af40bb191d056d7e7196de
      7 ---
      8  Android.mk                                 |  90 +++++++++++++
      9  CleanSpec.mk                               |  54 ++++++++
     10  clear_tblgen_vars.mk                       |   2 +
     11  lib/Analysis/Android.mk                    |  80 +++++++++++
     12  lib/Analysis/IPA/Android.mk                |  40 ++++++
     13  lib/AsmParser/Android.mk                   |  34 +++++
     14  lib/Bitcode/Reader/Android.mk              |  36 +++++
     15  lib/Bitcode/Writer/Android.mk              |  37 +++++
     16  lib/CodeGen/Android.mk                     | 143 ++++++++++++++++++++
     17  lib/CodeGen/AsmPrinter/Android.mk          |  62 +++++++++
     18  lib/CodeGen/SelectionDAG/Android.mk        |  56 ++++++++
     19  lib/ExecutionEngine/Android.mk             |  18 +++
     20  lib/ExecutionEngine/JIT/Android.mk         |  17 +++
     21  lib/ExecutionEngine/MCJIT/Android.mk       |  16 +++
     22  lib/ExecutionEngine/RuntimeDyld/Android.mk |  18 +++
     23  lib/IR/Android.mk                          |  79 +++++++++++
     24  lib/IRReader/Android.mk                    |  38 ++++++
     25  lib/Linker/Android.mk                      |  32 +++++
     26  lib/MC/Android.mk                          |  78 +++++++++++
     27  lib/MC/MCDisassembler/Android.mk           |  15 +++
     28  lib/MC/MCParser/Android.mk                 |  40 ++++++
     29  lib/Object/Android.mk                      |  45 +++++++
     30  lib/Option/Android.mk                      |  42 ++++++
     31  lib/Support/Android.mk                     | 120 +++++++++++++++++
     32  lib/TableGen/Android.mk                    |  39 ++++++
     33  lib/Target/AArch64/Android.mk              |  67 ++++++++++
     34  lib/Target/AArch64/AsmParser/Android.mk    |  63 +++++++++
     35  lib/Target/AArch64/Disassembler/Android.mk |  55 ++++++++
     36  lib/Target/AArch64/InstPrinter/Android.mk  |  57 ++++++++
     37  lib/Target/AArch64/MCTargetDesc/Android.mk |  57 ++++++++
     38  lib/Target/AArch64/TargetInfo/Android.mk   |  55 ++++++++
     39  lib/Target/AArch64/Utils/Android.mk        |  36 +++++
     40  lib/Target/ARM/Android.mk                  |  87 ++++++++++++
     41  lib/Target/ARM/AsmParser/Android.mk        |  63 +++++++++
     42  lib/Target/ARM/Disassembler/Android.mk     |  55 ++++++++
     43  lib/Target/ARM/InstPrinter/Android.mk      |  57 ++++++++
     44  lib/Target/ARM/MCTargetDesc/Android.mk     |  61 +++++++++
     45  lib/Target/ARM/TargetInfo/Android.mk       |  55 ++++++++
     46  lib/Target/Android.mk                      |  39 ++++++
     47  lib/Target/Mips/Android.mk                 |  85 ++++++++++++
     48  lib/Target/Mips/AsmParser/Android.mk       |  56 ++++++++
     49  lib/Target/Mips/Disassembler/Android.mk    |  48 +++++++
     50  lib/Target/Mips/InstPrinter/Android.mk     |  48 +++++++
     51  lib/Target/Mips/MCTargetDesc/Android.mk    |  58 ++++++++
     52  lib/Target/Mips/TargetInfo/Android.mk      |  47 +++++++
     53  lib/Target/X86/Android.mk                  |  72 ++++++++++
     54  lib/Target/X86/AsmParser/Android.mk        |  59 ++++++++
     55  lib/Target/X86/Disassembler/Android.mk     |  56 ++++++++
     56  lib/Target/X86/InstPrinter/Android.mk      |  57 ++++++++
     57  lib/Target/X86/MCTargetDesc/Android.mk     |  56 ++++++++
     58  lib/Target/X86/TargetInfo/Android.mk       |  55 ++++++++
     59  lib/Target/X86/Utils/Android.mk            |  36 +++++
     60  lib/Transforms/IPO/Android.mk              |  52 ++++++++
     61  lib/Transforms/InstCombine/Android.mk      |  44 ++++++
     62  lib/Transforms/Instrumentation/Android.mk  |  37 +++++
     63  lib/Transforms/ObjCARC/Android.mk          |  40 ++++++
     64  lib/Transforms/Scalar/Android.mk           |  73 ++++++++++
     65  lib/Transforms/Utils/Android.mk            |  66 +++++++++
     66  lib/Transforms/Vectorize/Android.mk        |  35 +++++
     67  llvm-device-build.mk                       |  79 +++++++++++
     68  llvm-gen-intrinsics.mk                     |  19 +++
     69  llvm-host-build.mk                         |  64 +++++++++
     70  llvm-tblgen-rules.mk                       | 208 +++++++++++++++++++++++++++++
     71  llvm.mk                                    |  11 ++
     72  shared_llvm.mk                             | 137 +++++++++++++++++++
     73  tools/llc/Android.mk                       | 136 +++++++++++++++++++
     74  tools/llvm-as/Android.mk                   |  28 ++++
     75  tools/llvm-dis/Android.mk                  |  25 ++++
     76  tools/llvm-link/Android.mk                 |  50 +++++++
     77  tools/opt/Android.mk                       |  81 +++++++++++
     78  utils/FileCheck/Android.mk                 |  23 ++++
     79  utils/TableGen/Android.mk                  |  58 ++++++++
     80  72 files changed, 4037 insertions(+)
     81  create mode 100644 Android.mk
     82  create mode 100644 CleanSpec.mk
     83  create mode 100644 clear_tblgen_vars.mk
     84  create mode 100644 lib/Analysis/Android.mk
     85  create mode 100644 lib/Analysis/IPA/Android.mk
     86  create mode 100644 lib/AsmParser/Android.mk
     87  create mode 100644 lib/Bitcode/Reader/Android.mk
     88  create mode 100644 lib/Bitcode/Writer/Android.mk
     89  create mode 100644 lib/CodeGen/Android.mk
     90  create mode 100644 lib/CodeGen/AsmPrinter/Android.mk
     91  create mode 100644 lib/CodeGen/SelectionDAG/Android.mk
     92  create mode 100644 lib/ExecutionEngine/Android.mk
     93  create mode 100644 lib/ExecutionEngine/JIT/Android.mk
     94  create mode 100644 lib/ExecutionEngine/MCJIT/Android.mk
     95  create mode 100644 lib/ExecutionEngine/RuntimeDyld/Android.mk
     96  create mode 100644 lib/IR/Android.mk
     97  create mode 100644 lib/IRReader/Android.mk
     98  create mode 100644 lib/Linker/Android.mk
     99  create mode 100644 lib/MC/Android.mk
    100  create mode 100644 lib/MC/MCDisassembler/Android.mk
    101  create mode 100644 lib/MC/MCParser/Android.mk
    102  create mode 100644 lib/Object/Android.mk
    103  create mode 100644 lib/Option/Android.mk
    104  create mode 100644 lib/Support/Android.mk
    105  create mode 100644 lib/TableGen/Android.mk
    106  create mode 100644 lib/Target/AArch64/Android.mk
    107  create mode 100644 lib/Target/AArch64/AsmParser/Android.mk
    108  create mode 100644 lib/Target/AArch64/Disassembler/Android.mk
    109  create mode 100644 lib/Target/AArch64/InstPrinter/Android.mk
    110  create mode 100644 lib/Target/AArch64/MCTargetDesc/Android.mk
    111  create mode 100644 lib/Target/AArch64/TargetInfo/Android.mk
    112  create mode 100644 lib/Target/AArch64/Utils/Android.mk
    113  create mode 100644 lib/Target/ARM/Android.mk
    114  create mode 100644 lib/Target/ARM/AsmParser/Android.mk
    115  create mode 100644 lib/Target/ARM/Disassembler/Android.mk
    116  create mode 100644 lib/Target/ARM/InstPrinter/Android.mk
    117  create mode 100644 lib/Target/ARM/MCTargetDesc/Android.mk
    118  create mode 100644 lib/Target/ARM/TargetInfo/Android.mk
    119  create mode 100644 lib/Target/Android.mk
    120  create mode 100644 lib/Target/Mips/Android.mk
    121  create mode 100644 lib/Target/Mips/AsmParser/Android.mk
    122  create mode 100644 lib/Target/Mips/Disassembler/Android.mk
    123  create mode 100644 lib/Target/Mips/InstPrinter/Android.mk
    124  create mode 100644 lib/Target/Mips/MCTargetDesc/Android.mk
    125  create mode 100644 lib/Target/Mips/TargetInfo/Android.mk
    126  create mode 100644 lib/Target/X86/Android.mk
    127  create mode 100644 lib/Target/X86/AsmParser/Android.mk
    128  create mode 100644 lib/Target/X86/Disassembler/Android.mk
    129  create mode 100644 lib/Target/X86/InstPrinter/Android.mk
    130  create mode 100644 lib/Target/X86/MCTargetDesc/Android.mk
    131  create mode 100644 lib/Target/X86/TargetInfo/Android.mk
    132  create mode 100644 lib/Target/X86/Utils/Android.mk
    133  create mode 100644 lib/Transforms/IPO/Android.mk
    134  create mode 100644 lib/Transforms/InstCombine/Android.mk
    135  create mode 100644 lib/Transforms/Instrumentation/Android.mk
    136  create mode 100644 lib/Transforms/ObjCARC/Android.mk
    137  create mode 100644 lib/Transforms/Scalar/Android.mk
    138  create mode 100644 lib/Transforms/Utils/Android.mk
    139  create mode 100644 lib/Transforms/Vectorize/Android.mk
    140  create mode 100644 llvm-device-build.mk
    141  create mode 100644 llvm-gen-intrinsics.mk
    142  create mode 100644 llvm-host-build.mk
    143  create mode 100644 llvm-tblgen-rules.mk
    144  create mode 100644 llvm.mk
    145  create mode 100644 shared_llvm.mk
    146  create mode 100644 tools/llc/Android.mk
    147  create mode 100644 tools/llvm-as/Android.mk
    148  create mode 100644 tools/llvm-dis/Android.mk
    149  create mode 100644 tools/llvm-link/Android.mk
    150  create mode 100644 tools/opt/Android.mk
    151  create mode 100644 utils/FileCheck/Android.mk
    152  create mode 100644 utils/TableGen/Android.mk
    153 
    154 diff --git a/Android.mk b/Android.mk
    155 new file mode 100644
    156 index 0000000..9f6e8a5
    157 --- /dev/null
    158 +++ b/Android.mk
    159 @@ -0,0 +1,90 @@
    160 +LOCAL_PATH := $(call my-dir)
    161 +LLVM_ROOT_PATH := $(LOCAL_PATH)
    162 +LLVM_ENABLE_ASSERTION := false
    163 +
    164 +include $(CLEAR_VARS)
    165 +
    166 +# LLVM Libraries
    167 +subdirs := \
    168 +  lib/Analysis \
    169 +  lib/Analysis/IPA \
    170 +  lib/AsmParser \
    171 +  lib/Bitcode/Reader \
    172 +  lib/Bitcode/Writer \
    173 +  lib/ExecutionEngine \
    174 +  lib/ExecutionEngine/RuntimeDyld \
    175 +  lib/ExecutionEngine/JIT \
    176 +  lib/ExecutionEngine/MCJIT \
    177 +  lib/CodeGen \
    178 +  lib/CodeGen/AsmPrinter \
    179 +  lib/CodeGen/SelectionDAG \
    180 +  lib/IR \
    181 +  lib/IRReader \
    182 +  lib/Linker \
    183 +  lib/MC \
    184 +  lib/MC/MCDisassembler \
    185 +  lib/MC/MCParser \
    186 +  lib/Object \
    187 +  lib/Option \
    188 +  lib/Support \
    189 +  lib/TableGen \
    190 +  lib/Target \
    191 +  lib/Transforms/IPO \
    192 +  lib/Transforms/InstCombine \
    193 +  lib/Transforms/Instrumentation \
    194 +  lib/Transforms/ObjCARC \
    195 +  lib/Transforms/Scalar \
    196 +  lib/Transforms/Utils \
    197 +  lib/Transforms/Vectorize \
    198 +  utils/FileCheck \
    199 +  utils/TableGen
    200 +
    201 +# ARM Code Generation Libraries
    202 +subdirs += \
    203 +  lib/Target/ARM \
    204 +  lib/Target/ARM/AsmParser \
    205 +  lib/Target/ARM/InstPrinter \
    206 +  lib/Target/ARM/Disassembler \
    207 +  lib/Target/ARM/MCTargetDesc \
    208 +  lib/Target/ARM/TargetInfo
    209 +
    210 +# ARM64 Code Generation Libraries
    211 +subdirs += \
    212 +  lib/Target/AArch64  \
    213 +  lib/Target/AArch64/AsmParser \
    214 +  lib/Target/AArch64/InstPrinter \
    215 +  lib/Target/AArch64/Disassembler \
    216 +  lib/Target/AArch64/MCTargetDesc \
    217 +  lib/Target/AArch64/TargetInfo \
    218 +  lib/Target/AArch64/Utils
    219 +
    220 +# MIPS Code Generation Libraries
    221 +subdirs += \
    222 +  lib/Target/Mips \
    223 +  lib/Target/Mips/AsmParser \
    224 +  lib/Target/Mips/InstPrinter \
    225 +  lib/Target/Mips/Disassembler \
    226 +  lib/Target/Mips/MCTargetDesc \
    227 +  lib/Target/Mips/TargetInfo
    228 +
    229 +# X86 Code Generation Libraries
    230 +subdirs += \
    231 +  lib/Target/X86 \
    232 +  lib/Target/X86/AsmParser \
    233 +  lib/Target/X86/InstPrinter \
    234 +  lib/Target/X86/Disassembler \
    235 +  lib/Target/X86/MCTargetDesc \
    236 +  lib/Target/X86/TargetInfo \
    237 +  lib/Target/X86/Utils
    238 +
    239 +# LLVM Command Line Tools
    240 +subdirs += tools/llc
    241 +subdirs += tools/llvm-as
    242 +subdirs += tools/llvm-dis
    243 +subdirs += tools/llvm-link
    244 +#subdirs += tools/opt
    245 +
    246 +include $(LOCAL_PATH)/llvm.mk
    247 +include $(LOCAL_PATH)/shared_llvm.mk
    248 +
    249 +include $(addprefix $(LOCAL_PATH)/,$(addsuffix /Android.mk, $(subdirs)))
    250 diff --git a/CleanSpec.mk b/CleanSpec.mk
    251 new file mode 100644
    252 index 0000000..f756f04
    253 --- /dev/null
    254 +++ b/CleanSpec.mk
    255 @@ -0,0 +1,54 @@
    256 +# Copyright (C) 2007 The Android Open Source Project
    257 +#
    258 +# Licensed under the Apache License, Version 2.0 (the "License");
    259 +# you may not use this file except in compliance with the License.
    260 +# You may obtain a copy of the License at
    261 +#
    262 +#      http://www.apache.org/licenses/LICENSE-2.0
    263 +#
    264 +# Unless required by applicable law or agreed to in writing, software
    265 +# distributed under the License is distributed on an "AS IS" BASIS,
    266 +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    267 +# See the License for the specific language governing permissions and
    268 +# limitations under the License.
    269 +#
    270 +
    271 +# If you don't need to do a full clean build but would like to touch
    272 +# a file or delete some intermediate files, add a clean step to the end
    273 +# of the list.  These steps will only be run once, if they haven't been
    274 +# run before.
    275 +#
    276 +# E.g.:
    277 +#     $(call add-clean-step, touch -c external/sqlite/sqlite3.h)
    278 +#     $(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/STATIC_LIBRARIES/libz_intermediates)
    279 +#
    280 +# Always use "touch -c" and "rm -f" or "rm -rf" to gracefully deal with
    281 +# files that are missing or have been moved.
    282 +#
    283 +# Use $(PRODUCT_OUT) to get to the "out/target/product/blah/" directory.
    284 +# Use $(OUT_DIR) to refer to the "out" directory.
    285 +#
    286 +# If you need to re-do something that's already mentioned, just copy
    287 +# the command and add it to the bottom of the list.  E.g., if a change
    288 +# that you made last week required touching a file and a change you
    289 +# made today requires touching the same file, just copy the old
    290 +# touch step and add it to the end of the list.
    291 +#
    292 +# ************************************************
    293 +# NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST
    294 +# ************************************************
    295 +
    296 +# For example:
    297 +#$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/APPS/AndroidTests_intermediates)
    298 +#$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/JAVA_LIBRARIES/core_intermediates)
    299 +#$(call add-clean-step, find $(OUT_DIR) -type f -name "IGTalkSession*" -print0 | xargs -0 rm -f)
    300 +#$(call add-clean-step, rm -rf $(PRODUCT_OUT)/data/*)
    301 +
    302 +# ************************************************
    303 +# NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST
    304 +# ************************************************
    305 +$(call add-clean-step, rm -rf $(OUT_DIR)/target/product/stingray/obj/STATIC_LIBRARIES/libLLVM*)
    306 +$(call add-clean-step, rm -rf $(OUT_DIR)/target/product/stingray/obj/STATIC_LIBRARIES/libLLVMARMCodeGen_intermediates*)
    307 +$(call add-clean-step, rm -rf $(OUT_DIR)/host/$(HOST_PREBUILT_TAG)/obj/STATIC_LIBRARIES/libLLVMARM*)
    308 +$(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/STATIC_LIBRARIES/libLLVMARM*)
    309 +$(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/EXECUTABLES/app_process__asan_intermediates*)
    310 diff --git a/clear_tblgen_vars.mk b/clear_tblgen_vars.mk
    311 new file mode 100644
    312 index 0000000..6c9623e
    313 --- /dev/null
    314 +++ b/clear_tblgen_vars.mk
    315 @@ -0,0 +1,2 @@
    316 +TBLGEN_TABLES :=
    317 +TBLGEN_TD_DIR :=
    318 diff --git a/lib/Analysis/Android.mk b/lib/Analysis/Android.mk
    319 new file mode 100644
    320 index 0000000..76eee74
    321 --- /dev/null
    322 +++ b/lib/Analysis/Android.mk
    323 @@ -0,0 +1,80 @@
    324 +LOCAL_PATH:= $(call my-dir)
    325 +
    326 +analysis_SRC_FILES := \
    327 +  AliasAnalysis.cpp \
    328 +  AliasAnalysisCounter.cpp \
    329 +  AliasAnalysisEvaluator.cpp \
    330 +  AliasDebugger.cpp \
    331 +  AliasSetTracker.cpp \
    332 +  Analysis.cpp \
    333 +  BasicAliasAnalysis.cpp \
    334 +  BlockFrequencyInfo.cpp \
    335 +  BranchProbabilityInfo.cpp \
    336 +  CFG.cpp \
    337 +  CFGPrinter.cpp \
    338 +  CaptureTracking.cpp \
    339 +  CodeMetrics.cpp \
    340 +  ConstantFolding.cpp \
    341 +  CostModel.cpp \
    342 +  Delinearization.cpp \
    343 +  DependenceAnalysis.cpp \
    344 +  DomPrinter.cpp \
    345 +  DominanceFrontier.cpp \
    346 +  IVUsers.cpp \
    347 +  InstCount.cpp \
    348 +  InstructionSimplify.cpp \
    349 +  Interval.cpp \
    350 +  IntervalPartition.cpp \
    351 +  LazyValueInfo.cpp \
    352 +  LibCallAliasAnalysis.cpp \
    353 +  LibCallSemantics.cpp \
    354 +  Lint.cpp \
    355 +  Loads.cpp \
    356 +  LoopInfo.cpp \
    357 +  LoopPass.cpp \
    358 +  MemDepPrinter.cpp \
    359 +  MemoryBuiltins.cpp \
    360 +  MemoryDependenceAnalysis.cpp \
    361 +  ModuleDebugInfoPrinter.cpp \
    362 +  NoAliasAnalysis.cpp \
    363 +  PHITransAddr.cpp \
    364 +  PostDominators.cpp \
    365 +  PtrUseVisitor.cpp \
    366 +  RegionInfo.cpp \
    367 +  RegionPass.cpp \
    368 +  RegionPrinter.cpp \
    369 +  ScalarEvolution.cpp \
    370 +  ScalarEvolutionAliasAnalysis.cpp \
    371 +  ScalarEvolutionExpander.cpp \
    372 +  ScalarEvolutionNormalization.cpp \
    373 +  SparsePropagation.cpp \
    374 +  TargetTransformInfo.cpp \
    375 +  Trace.cpp \
    376 +  TypeBasedAliasAnalysis.cpp \
    377 +  ValueTracking.cpp
    378 +
    379 +# For the host
    380 +# =====================================================
    381 +include $(CLEAR_VARS)
    382 +
    383 +LOCAL_MODULE:= libLLVMAnalysis
    384 +LOCAL_MODULE_TAGS := optional
    385 +LOCAL_SRC_FILES := $(analysis_SRC_FILES)
    386 +
    387 +include $(LLVM_HOST_BUILD_MK)
    388 +include $(LLVM_GEN_INTRINSICS_MK)
    389 +include $(BUILD_HOST_STATIC_LIBRARY)
    390 +
    391 +# For the device
    392 +# =====================================================
    393 +ifneq (true,$(DISABLE_LLVM_DEVICE_BUILDS))
    394 +include $(CLEAR_VARS)
    395 +
    396 +LOCAL_MODULE:= libLLVMAnalysis
    397 +LOCAL_MODULE_TAGS := optional
    398 +LOCAL_SRC_FILES := $(analysis_SRC_FILES)
    399 +
    400 +include $(LLVM_DEVICE_BUILD_MK)
    401 +include $(LLVM_GEN_INTRINSICS_MK)
    402 +include $(BUILD_STATIC_LIBRARY)
    403 +endif
    404 diff --git a/lib/Analysis/IPA/Android.mk b/lib/Analysis/IPA/Android.mk
    405 new file mode 100644
    406 index 0000000..d56d931
    407 --- /dev/null
    408 +++ b/lib/Analysis/IPA/Android.mk
    409 @@ -0,0 +1,40 @@
    410 +LOCAL_PATH:= $(call my-dir)
    411 +
    412 +analysis_ipa_SRC_FILES := \
    413 +  CallGraph.cpp \
    414 +  CallGraphSCCPass.cpp \
    415 +  CallPrinter.cpp \
    416 +  FindUsedTypes.cpp \
    417 +  GlobalsModRef.cpp \
    418 +  IPA.cpp \
    419 +  InlineCost.cpp
    420 +
    421 +# For the host
    422 +# =====================================================
    423 +include $(CLEAR_VARS)
    424 +
    425 +LOCAL_SRC_FILES := $(analysis_ipa_SRC_FILES)
    426 +
    427 +LOCAL_MODULE:= libLLVMipa
    428 +
    429 +LOCAL_MODULE_TAGS := optional
    430 +
    431 +include $(LLVM_HOST_BUILD_MK)
    432 +include $(LLVM_GEN_INTRINSICS_MK)
    433 +include $(BUILD_HOST_STATIC_LIBRARY)
    434 +
    435 +# For the device
    436 +# =====================================================
    437 +ifneq (true,$(DISABLE_LLVM_DEVICE_BUILDS))
    438 +include $(CLEAR_VARS)
    439 +
    440 +LOCAL_SRC_FILES := $(analysis_ipa_SRC_FILES)
    441 +
    442 +LOCAL_MODULE:= libLLVMipa
    443 +
    444 +LOCAL_MODULE_TAGS := optional
    445 +
    446 +include $(LLVM_DEVICE_BUILD_MK)
    447 +include $(LLVM_GEN_INTRINSICS_MK)
    448 +include $(BUILD_STATIC_LIBRARY)
    449 +endif
    450 diff --git a/lib/AsmParser/Android.mk b/lib/AsmParser/Android.mk
    451 new file mode 100644
    452 index 0000000..7bd29a7
    453 --- /dev/null
    454 +++ b/lib/AsmParser/Android.mk
    455 @@ -0,0 +1,34 @@
    456 +LOCAL_PATH:= $(call my-dir)
    457 +
    458 +asm_parser_SRC_FILES := \
    459 +  LLLexer.cpp \
    460 +  LLParser.cpp \
    461 +  Parser.cpp
    462 +
    463 +# For the host
    464 +# =====================================================
    465 +include $(CLEAR_VARS)
    466 +
    467 +LOCAL_SRC_FILES := $(asm_parser_SRC_FILES)
    468 +
    469 +LOCAL_MODULE:= libLLVMAsmParser
    470 +
    471 +LOCAL_MODULE_TAGS := optional
    472 +
    473 +include $(LOCAL_PATH)/../../llvm-host-build.mk
    474 +include $(BUILD_HOST_STATIC_LIBRARY)
    475 +
    476 +# For the device
    477 +# =====================================================
    478 +ifneq (true,$(DISABLE_LLVM_DEVICE_BUILDS))
    479 +include $(CLEAR_VARS)
    480 +
    481 +LOCAL_SRC_FILES := $(asm_parser_SRC_FILES)
    482 +
    483 +LOCAL_MODULE:= libLLVMAsmParser
    484 +
    485 +LOCAL_MODULE_TAGS := optional
    486 +
    487 +include $(LOCAL_PATH)/../../llvm-device-build.mk
    488 +include $(BUILD_STATIC_LIBRARY)
    489 +endif
    490 \ No newline at end of file
    491 diff --git a/lib/Bitcode/Reader/Android.mk b/lib/Bitcode/Reader/Android.mk
    492 new file mode 100644
    493 index 0000000..3bdcdda
    494 --- /dev/null
    495 +++ b/lib/Bitcode/Reader/Android.mk
    496 @@ -0,0 +1,36 @@
    497 +LOCAL_PATH:= $(call my-dir)
    498 +
    499 +bitcode_reader_SRC_FILES := \
    500 +	BitReader.cpp	\
    501 +	BitcodeReader.cpp \
    502 +	BitstreamReader.cpp
    503 +
    504 +# For the host
    505 +# =====================================================
    506 +include $(CLEAR_VARS)
    507 +
    508 +LOCAL_SRC_FILES := $(bitcode_reader_SRC_FILES)
    509 +
    510 +LOCAL_MODULE:= libLLVMBitReader
    511 +
    512 +LOCAL_MODULE_TAGS := optional
    513 +
    514 +include $(LLVM_HOST_BUILD_MK)
    515 +include $(LLVM_GEN_INTRINSICS_MK)
    516 +include $(BUILD_HOST_STATIC_LIBRARY)
    517 +
    518 +# For the device
    519 +# =====================================================
    520 +include $(CLEAR_VARS)
    521 +ifneq (true,$(DISABLE_LLVM_DEVICE_BUILDS))
    522 +
    523 +LOCAL_SRC_FILES := $(bitcode_reader_SRC_FILES)
    524 +
    525 +LOCAL_MODULE:= libLLVMBitReader
    526 +
    527 +LOCAL_MODULE_TAGS := optional
    528 +
    529 +include $(LLVM_DEVICE_BUILD_MK)
    530 +include $(LLVM_GEN_INTRINSICS_MK)
    531 +include $(BUILD_STATIC_LIBRARY)
    532 +endif
    533 diff --git a/lib/Bitcode/Writer/Android.mk b/lib/Bitcode/Writer/Android.mk
    534 new file mode 100644
    535 index 0000000..6aa208c
    536 --- /dev/null
    537 +++ b/lib/Bitcode/Writer/Android.mk
    538 @@ -0,0 +1,37 @@
    539 +LOCAL_PATH:= $(call my-dir)
    540 +
    541 +bitcode_writer_SRC_FILES := \
    542 +	BitWriter.cpp	\
    543 +	BitcodeWriter.cpp	\
    544 +	BitcodeWriterPass.cpp	\
    545 +	ValueEnumerator.cpp
    546 +
    547 +# For the host
    548 +# =====================================================
    549 +include $(CLEAR_VARS)
    550 +
    551 +LOCAL_SRC_FILES := $(bitcode_writer_SRC_FILES)
    552 +
    553 +LOCAL_MODULE:= libLLVMBitWriter
    554 +
    555 +LOCAL_MODULE_TAGS := optional
    556 +
    557 +include $(LLVM_HOST_BUILD_MK)
    558 +include $(LLVM_GEN_INTRINSICS_MK)
    559 +include $(BUILD_HOST_STATIC_LIBRARY)
    560 +
    561 +# For the device
    562 +# =====================================================
    563 +include $(CLEAR_VARS)
    564 +ifneq (true,$(DISABLE_LLVM_DEVICE_BUILDS))
    565 +
    566 +LOCAL_SRC_FILES := $(bitcode_writer_SRC_FILES)
    567 +
    568 +LOCAL_MODULE:= libLLVMBitWriter
    569 +
    570 +LOCAL_MODULE_TAGS := optional
    571 +
    572 +include $(LLVM_DEVICE_BUILD_MK)
    573 +include $(LLVM_GEN_INTRINSICS_MK)
    574 +include $(BUILD_STATIC_LIBRARY)
    575 +endif
    576 diff --git a/lib/CodeGen/Android.mk b/lib/CodeGen/Android.mk
    577 new file mode 100644
    578 index 0000000..26f04d0
    579 --- /dev/null
    580 +++ b/lib/CodeGen/Android.mk
    581 @@ -0,0 +1,143 @@
    582 +LOCAL_PATH:= $(call my-dir)
    583 +
    584 +codegen_SRC_FILES := \
    585 +  AggressiveAntiDepBreaker.cpp \
    586 +  AllocationOrder.cpp \
    587 +  Analysis.cpp \
    588 +  BasicTargetTransformInfo.cpp \
    589 +  BranchFolding.cpp \
    590 +  CalcSpillWeights.cpp \
    591 +  CallingConvLower.cpp \
    592 +  CodeGen.cpp \
    593 +  CodeGenPrepare.cpp \
    594 +  CriticalAntiDepBreaker.cpp \
    595 +  DeadMachineInstructionElim.cpp \
    596 +  DFAPacketizer.cpp \
    597 +  DwarfEHPrepare.cpp \
    598 +  EarlyIfConversion.cpp \
    599 +  EdgeBundles.cpp \
    600 +  ErlangGC.cpp \
    601 +  ExecutionDepsFix.cpp \
    602 +  ExpandISelPseudos.cpp \
    603 +  ExpandPostRAPseudos.cpp \
    604 +  GCMetadata.cpp \
    605 +  GCMetadataPrinter.cpp \
    606 +  GCStrategy.cpp \
    607 +  IfConversion.cpp \
    608 +  InlineSpiller.cpp \
    609 +  InterferenceCache.cpp \
    610 +  IntrinsicLowering.cpp \
    611 +  JITCodeEmitter.cpp \
    612 +  LatencyPriorityQueue.cpp \
    613 +  LexicalScopes.cpp \
    614 +  LiveDebugVariables.cpp \
    615 +  LiveIntervalAnalysis.cpp \
    616 +  LiveInterval.cpp \
    617 +  LiveIntervalUnion.cpp \
    618 +  LivePhysRegs.cpp \
    619 +  LiveRangeCalc.cpp \
    620 +  LiveRangeEdit.cpp \
    621 +  LiveRegMatrix.cpp \
    622 +  LiveStackAnalysis.cpp \
    623 +  LiveVariables.cpp \
    624 +  LLVMTargetMachine.cpp \
    625 +  LocalStackSlotAllocation.cpp \
    626 +  MachineBasicBlock.cpp \
    627 +  MachineBlockFrequencyInfo.cpp \
    628 +  MachineBlockPlacement.cpp \
    629 +  MachineBranchProbabilityInfo.cpp \
    630 +  MachineCodeEmitter.cpp \
    631 +  MachineCopyPropagation.cpp \
    632 +  MachineCSE.cpp \
    633 +  MachineDominators.cpp \
    634 +  MachineFunctionAnalysis.cpp \
    635 +  MachineFunction.cpp \
    636 +  MachineFunctionPass.cpp \
    637 +  MachineFunctionPrinterPass.cpp \
    638 +  MachineInstrBundle.cpp \
    639 +  MachineInstr.cpp \
    640 +  MachineLICM.cpp \
    641 +  MachineLoopInfo.cpp \
    642 +  MachineModuleInfo.cpp \
    643 +  MachineModuleInfoImpls.cpp \
    644 +  MachinePassRegistry.cpp \
    645 +  MachinePostDominators.cpp \
    646 +  MachineRegisterInfo.cpp \
    647 +  MachineScheduler.cpp \
    648 +  MachineSink.cpp \
    649 +  MachineSSAUpdater.cpp \
    650 +  MachineTraceMetrics.cpp \
    651 +  MachineVerifier.cpp \
    652 +  OcamlGC.cpp \
    653 +  OptimizePHIs.cpp \
    654 +  Passes.cpp \
    655 +  PeepholeOptimizer.cpp \
    656 +  PHIElimination.cpp \
    657 +  PHIEliminationUtils.cpp \
    658 +  PostRASchedulerList.cpp \
    659 +  ProcessImplicitDefs.cpp \
    660 +  PrologEpilogInserter.cpp \
    661 +  PseudoSourceValue.cpp \
    662 +  RegAllocBase.cpp \
    663 +  RegAllocBasic.cpp \
    664 +  RegAllocFast.cpp \
    665 +  RegAllocGreedy.cpp \
    666 +  RegAllocPBQP.cpp \
    667 +  RegisterClassInfo.cpp \
    668 +  RegisterCoalescer.cpp \
    669 +  RegisterPressure.cpp \
    670 +  RegisterScavenging.cpp \
    671 +  ScheduleDAG.cpp \
    672 +  ScheduleDAGInstrs.cpp \
    673 +  ScheduleDAGPrinter.cpp \
    674 +  ScoreboardHazardRecognizer.cpp \
    675 +  ShadowStackGC.cpp \
    676 +  SjLjEHPrepare.cpp \
    677 +  SlotIndexes.cpp \
    678 +  Spiller.cpp \
    679 +  SpillPlacement.cpp \
    680 +  SplitKit.cpp \
    681 +  StackColoring.cpp \
    682 +  StackMapLivenessAnalysis.cpp \
    683 +  StackMaps.cpp \
    684 +  StackProtector.cpp \
    685 +  StackSlotColoring.cpp \
    686 +  TailDuplication.cpp \
    687 +  TargetFrameLoweringImpl.cpp \
    688 +  TargetInstrInfo.cpp \
    689 +  TargetLoweringBase.cpp \
    690 +  TargetLoweringObjectFileImpl.cpp \
    691 +  TargetOptionsImpl.cpp \
    692 +  TargetRegisterInfo.cpp \
    693 +  TargetSchedule.cpp \
    694 +  TwoAddressInstructionPass.cpp \
    695 +  UnreachableBlockElim.cpp \
    696 +  VirtRegMap.cpp
    697 +
    698 +# For the host
    699 +# =====================================================
    700 +include $(CLEAR_VARS)
    701 +
    702 +LOCAL_SRC_FILES := $(codegen_SRC_FILES)
    703 +LOCAL_MODULE:= libLLVMCodeGen
    704 +
    705 +LOCAL_MODULE_TAGS := optional
    706 +
    707 +include $(LLVM_HOST_BUILD_MK)
    708 +include $(LLVM_GEN_INTRINSICS_MK)
    709 +include $(BUILD_HOST_STATIC_LIBRARY)
    710 +
    711 +# For the device
    712 +# =====================================================
    713 +ifneq (true,$(DISABLE_LLVM_DEVICE_BUILDS))
    714 +include $(CLEAR_VARS)
    715 +
    716 +LOCAL_SRC_FILES := $(codegen_SRC_FILES)
    717 +LOCAL_MODULE:= libLLVMCodeGen
    718 +
    719 +LOCAL_MODULE_TAGS := optional
    720 +
    721 +include $(LLVM_DEVICE_BUILD_MK)
    722 +include $(LLVM_GEN_INTRINSICS_MK)
    723 +include $(BUILD_STATIC_LIBRARY)
    724 +endif
    725 diff --git a/lib/CodeGen/AsmPrinter/Android.mk b/lib/CodeGen/AsmPrinter/Android.mk
    726 new file mode 100644
    727 index 0000000..1e403ee
    728 --- /dev/null
    729 +++ b/lib/CodeGen/AsmPrinter/Android.mk
    730 @@ -0,0 +1,62 @@
    731 +LOCAL_PATH := $(call my-dir)
    732 +
    733 +codegen_asmprinter_SRC_FILES := \
    734 +  AsmPrinter.cpp
    735 +
    736 +# For the host
    737 +# =====================================================
    738 +include $(CLEAR_VARS)
    739 +
    740 +LOCAL_SRC_FILES :=	\
    741 +	AsmPrinter.cpp	\
    742 +	AsmPrinterDwarf.cpp	\
    743 +	AsmPrinterInlineAsm.cpp	\
    744 +	ARMException.cpp	\
    745 +	DIE.cpp	\
    746 +	DIEHash.cpp \
    747 +	DwarfAccelTable.cpp \
    748 +	DwarfCFIException.cpp \
    749 +	DwarfDebug.cpp	\
    750 +	DwarfException.cpp	\
    751 +	DwarfUnit.cpp \
    752 +	ErlangGCPrinter.cpp \
    753 +	OcamlGCPrinter.cpp \
    754 +	Win64Exception.cpp \
    755 +	WinCodeViewLineTables.cpp
    756 +
    757 +LOCAL_MODULE:= libLLVMAsmPrinter
    758 +
    759 +LOCAL_MODULE_TAGS := optional
    760 +
    761 +include $(LLVM_HOST_BUILD_MK)
    762 +include $(LLVM_GEN_INTRINSICS_MK)
    763 +include $(BUILD_HOST_STATIC_LIBRARY)
    764 +
    765 +# For the device
    766 +# =====================================================
    767 +ifneq (true,$(DISABLE_LLVM_DEVICE_BUILDS))
    768 +include $(CLEAR_VARS)
    769 +
    770 +LOCAL_SRC_FILES :=	\
    771 +	AsmPrinter.cpp \
    772 +	AsmPrinterDwarf.cpp \
    773 +	AsmPrinterInlineAsm.cpp \
    774 +	ARMException.cpp        \
    775 +	DIE.cpp \
    776 +	DIEHash.cpp \
    777 +	DwarfAccelTable.cpp \
    778 +	DwarfCFIException.cpp \
    779 +	DwarfDebug.cpp  \
    780 +	DwarfException.cpp      \
    781 +	ErlangGCPrinter.cpp \
    782 +	Win64Exception.cpp \
    783 +	$(LOCAL_SRC_FILES)
    784 +
    785 +LOCAL_MODULE:= libLLVMAsmPrinter
    786 +
    787 +LOCAL_MODULE_TAGS := optional
    788 +
    789 +include $(LLVM_DEVICE_BUILD_MK)
    790 +include $(LLVM_GEN_INTRINSICS_MK)
    791 +include $(BUILD_STATIC_LIBRARY)
    792 +endif
    793 diff --git a/lib/CodeGen/SelectionDAG/Android.mk b/lib/CodeGen/SelectionDAG/Android.mk
    794 new file mode 100644
    795 index 0000000..0e52ee3
    796 --- /dev/null
    797 +++ b/lib/CodeGen/SelectionDAG/Android.mk
    798 @@ -0,0 +1,56 @@
    799 +LOCAL_PATH:= $(call my-dir)
    800 +
    801 +codegen_selectiondag_SRC_FILES := \
    802 +  DAGCombiner.cpp \
    803 +  FastISel.cpp \
    804 +  FunctionLoweringInfo.cpp \
    805 +  InstrEmitter.cpp \
    806 +  LegalizeDAG.cpp \
    807 +  LegalizeFloatTypes.cpp \
    808 +  LegalizeIntegerTypes.cpp \
    809 +  LegalizeTypes.cpp \
    810 +  LegalizeTypesGeneric.cpp \
    811 +  LegalizeVectorOps.cpp \
    812 +  LegalizeVectorTypes.cpp \
    813 +  ResourcePriorityQueue.cpp \
    814 +  ScheduleDAGFast.cpp \
    815 +  ScheduleDAGRRList.cpp \
    816 +  ScheduleDAGSDNodes.cpp \
    817 +  ScheduleDAGVLIW.cpp \
    818 +  SelectionDAG.cpp \
    819 +  SelectionDAGBuilder.cpp \
    820 +  SelectionDAGDumper.cpp \
    821 +  SelectionDAGISel.cpp \
    822 +  SelectionDAGPrinter.cpp \
    823 +  TargetLowering.cpp \
    824 +  TargetSelectionDAGInfo.cpp
    825 +
    826 +# For the host
    827 +# =====================================================
    828 +include $(CLEAR_VARS)
    829 +
    830 +LOCAL_SRC_FILES := $(codegen_selectiondag_SRC_FILES)
    831 +
    832 +LOCAL_MODULE:= libLLVMSelectionDAG
    833 +
    834 +LOCAL_MODULE_TAGS := optional
    835 +
    836 +include $(LLVM_HOST_BUILD_MK)
    837 +include $(LLVM_GEN_INTRINSICS_MK)
    838 +include $(BUILD_HOST_STATIC_LIBRARY)
    839 +
    840 +# For the device
    841 +# =====================================================
    842 +ifneq (true,$(DISABLE_LLVM_DEVICE_BUILDS))
    843 +include $(CLEAR_VARS)
    844 +
    845 +LOCAL_SRC_FILES := $(codegen_selectiondag_SRC_FILES)
    846 +
    847 +LOCAL_MODULE:= libLLVMSelectionDAG
    848 +
    849 +LOCAL_MODULE_TAGS := optional
    850 +
    851 +include $(LLVM_DEVICE_BUILD_MK)
    852 +include $(LLVM_GEN_INTRINSICS_MK)
    853 +include $(BUILD_STATIC_LIBRARY)
    854 +endif
    855 diff --git a/lib/ExecutionEngine/Android.mk b/lib/ExecutionEngine/Android.mk
    856 new file mode 100644
    857 index 0000000..9f1befd
    858 --- /dev/null
    859 +++ b/lib/ExecutionEngine/Android.mk
    860 @@ -0,0 +1,18 @@
    861 +LOCAL_PATH:= $(call my-dir)
    862 +
    863 +# For the host
    864 +# =====================================================
    865 +include $(CLEAR_VARS)
    866 +
    867 +LOCAL_SRC_FILES := \
    868 +	ExecutionEngineBindings.cpp \
    869 +	ExecutionEngine.cpp \
    870 +	RTDyldMemoryManager.cpp \
    871 +	TargetSelect.cpp
    872 +
    873 +LOCAL_MODULE:= libLLVMExecutionEngine
    874 +
    875 +LOCAL_MODULE_TAGS := optional
    876 +
    877 +include $(LLVM_HOST_BUILD_MK)
    878 +include $(BUILD_HOST_STATIC_LIBRARY)
    879 diff --git a/lib/ExecutionEngine/JIT/Android.mk b/lib/ExecutionEngine/JIT/Android.mk
    880 new file mode 100644
    881 index 0000000..0466ba0
    882 --- /dev/null
    883 +++ b/lib/ExecutionEngine/JIT/Android.mk
    884 @@ -0,0 +1,17 @@
    885 +LOCAL_PATH:= $(call my-dir)
    886 +
    887 +# For the host
    888 +# =====================================================
    889 +include $(CLEAR_VARS)
    890 +
    891 +LOCAL_SRC_FILES :=	\
    892 +	JIT.cpp	\
    893 +	JITEmitter.cpp	\
    894 +	JITMemoryManager.cpp
    895 +
    896 +LOCAL_MODULE:= libLLVMJIT
    897 +
    898 +LOCAL_MODULE_TAGS := optional
    899 +
    900 +include $(LLVM_HOST_BUILD_MK)
    901 +include $(BUILD_HOST_STATIC_LIBRARY)
    902 diff --git a/lib/ExecutionEngine/MCJIT/Android.mk b/lib/ExecutionEngine/MCJIT/Android.mk
    903 new file mode 100644
    904 index 0000000..0314958
    905 --- /dev/null
    906 +++ b/lib/ExecutionEngine/MCJIT/Android.mk
    907 @@ -0,0 +1,16 @@
    908 +LOCAL_PATH:= $(call my-dir)
    909 +
    910 +# For the host
    911 +# =====================================================
    912 +include $(CLEAR_VARS)
    913 +
    914 +LOCAL_SRC_FILES :=	\
    915 +	MCJIT.cpp \
    916 +	SectionMemoryManager.cpp
    917 +
    918 +LOCAL_MODULE:= libLLVMMCJIT
    919 +
    920 +LOCAL_MODULE_TAGS := optional
    921 +
    922 +include $(LLVM_HOST_BUILD_MK)
    923 +include $(BUILD_HOST_STATIC_LIBRARY)
    924 diff --git a/lib/ExecutionEngine/RuntimeDyld/Android.mk b/lib/ExecutionEngine/RuntimeDyld/Android.mk
    925 new file mode 100644
    926 index 0000000..e98e80a
    927 --- /dev/null
    928 +++ b/lib/ExecutionEngine/RuntimeDyld/Android.mk
    929 @@ -0,0 +1,18 @@
    930 +LOCAL_PATH:= $(call my-dir)
    931 +
    932 +# For the host
    933 +# =====================================================
    934 +include $(CLEAR_VARS)
    935 +
    936 +LOCAL_SRC_FILES :=	\
    937 +	GDBRegistrar.cpp \
    938 +	RuntimeDyld.cpp \
    939 +	RuntimeDyldELF.cpp \
    940 +	RuntimeDyldMachO.cpp
    941 +
    942 +LOCAL_MODULE:= libLLVMRuntimeDyld
    943 +
    944 +LOCAL_MODULE_TAGS := optional
    945 +
    946 +include $(LLVM_HOST_BUILD_MK)
    947 +include $(BUILD_HOST_STATIC_LIBRARY)
    948 diff --git a/lib/IR/Android.mk b/lib/IR/Android.mk
    949 new file mode 100644
    950 index 0000000..071bb04
    951 --- /dev/null
    952 +++ b/lib/IR/Android.mk
    953 @@ -0,0 +1,79 @@
    954 +LOCAL_PATH:= $(call my-dir)
    955 +
    956 +vmcore_SRC_FILES := \
    957 +  AsmWriter.cpp \
    958 +  Attributes.cpp \
    959 +  AutoUpgrade.cpp \
    960 +  BasicBlock.cpp \
    961 +  ConstantFold.cpp \
    962 +  ConstantRange.cpp \
    963 +  Constants.cpp \
    964 +  Core.cpp \
    965 +  DataLayout.cpp \
    966 +  DebugInfo.cpp \
    967 +  DebugLoc.cpp \
    968 +  DiagnosticInfo.cpp \
    969 +  DiagnosticPrinter.cpp \
    970 +  DIBuilder.cpp \
    971 +  Dominators.cpp \
    972 +  Function.cpp \
    973 +  GVMaterializer.cpp \
    974 +  Globals.cpp \
    975 +  IRBuilder.cpp \
    976 +  IRPrintingPasses.cpp \
    977 +  InlineAsm.cpp \
    978 +  Instruction.cpp \
    979 +  Instructions.cpp \
    980 +  IntrinsicInst.cpp \
    981 +  LLVMContext.cpp \
    982 +  LLVMContextImpl.cpp \
    983 +  LeakDetector.cpp \
    984 +  LegacyPassManager.cpp \
    985 +  Mangler.cpp \
    986 +  Metadata.cpp \
    987 +  Module.cpp \
    988 +  Pass.cpp \
    989 +  PassManager.cpp \
    990 +  PassRegistry.cpp \
    991 +  Type.cpp \
    992 +  TypeFinder.cpp \
    993 +  Use.cpp \
    994 +  User.cpp \
    995 +  Value.cpp \
    996 +  ValueSymbolTable.cpp \
    997 +  ValueTypes.cpp \
    998 +  Verifier.cpp
    999 +
   1000 +# For the host
   1001 +# =====================================================
   1002 +include $(CLEAR_VARS)
   1003 +
   1004 +REQUIRES_RTTI := 1
   1005 +
   1006 +LOCAL_SRC_FILES := $(vmcore_SRC_FILES)
   1007 +
   1008 +LOCAL_MODULE:= libLLVMCore
   1009 +
   1010 +LOCAL_MODULE_TAGS := optional
   1011 +
   1012 +include $(LLVM_HOST_BUILD_MK)
   1013 +include $(LLVM_GEN_INTRINSICS_MK)
   1014 +include $(BUILD_HOST_STATIC_LIBRARY)
   1015 +
   1016 +# For the device
   1017 +# =====================================================
   1018 +include $(CLEAR_VARS)
   1019 +ifneq (true,$(DISABLE_LLVM_DEVICE_BUILDS))
   1020 +
   1021 +REQUIRES_RTTI := 1
   1022 +
   1023 +LOCAL_SRC_FILES := $(vmcore_SRC_FILES)
   1024 +
   1025 +LOCAL_MODULE:= libLLVMCore
   1026 +
   1027 +LOCAL_MODULE_TAGS := optional
   1028 +
   1029 +include $(LLVM_DEVICE_BUILD_MK)
   1030 +include $(LLVM_GEN_INTRINSICS_MK)
   1031 +include $(BUILD_STATIC_LIBRARY)
   1032 +endif
   1033 diff --git a/lib/IRReader/Android.mk b/lib/IRReader/Android.mk
   1034 new file mode 100644
   1035 index 0000000..d620521
   1036 --- /dev/null
   1037 +++ b/lib/IRReader/Android.mk
   1038 @@ -0,0 +1,38 @@
   1039 +LOCAL_PATH:= $(call my-dir)
   1040 +
   1041 +irreader_SRC_FILES := \
   1042 +  IRReader.cpp
   1043 +
   1044 +# For the host
   1045 +# =====================================================
   1046 +include $(CLEAR_VARS)
   1047 +
   1048 +REQUIRES_RTTI := 1
   1049 +
   1050 +LOCAL_SRC_FILES := $(irreader_SRC_FILES)
   1051 +
   1052 +LOCAL_MODULE:= libLLVMIRReader
   1053 +
   1054 +LOCAL_MODULE_TAGS := optional
   1055 +
   1056 +include $(LLVM_HOST_BUILD_MK)
   1057 +include $(LLVM_GEN_INTRINSICS_MK)
   1058 +include $(BUILD_HOST_STATIC_LIBRARY)
   1059 +
   1060 +# For the device
   1061 +# =====================================================
   1062 +ifneq (true,$(DISABLE_LLVM_DEVICE_BUILDS))
   1063 +include $(CLEAR_VARS)
   1064 +
   1065 +REQUIRES_RTTI := 1
   1066 +
   1067 +LOCAL_SRC_FILES := $(irreader_SRC_FILES)
   1068 +
   1069 +LOCAL_MODULE:= libLLVMIRReader
   1070 +
   1071 +LOCAL_MODULE_TAGS := optional
   1072 +
   1073 +include $(LLVM_DEVICE_BUILD_MK)
   1074 +include $(LLVM_GEN_INTRINSICS_MK)
   1075 +include $(BUILD_STATIC_LIBRARY)
   1076 +endif
   1077 \ No newline at end of file
   1078 diff --git a/lib/Linker/Android.mk b/lib/Linker/Android.mk
   1079 new file mode 100644
   1080 index 0000000..161b2ae
   1081 --- /dev/null
   1082 +++ b/lib/Linker/Android.mk
   1083 @@ -0,0 +1,32 @@
   1084 +LOCAL_PATH:= $(call my-dir)
   1085 +
   1086 +linker_SRC_FILES := \
   1087 +  LinkModules.cpp
   1088 +
   1089 +# For the host
   1090 +# =====================================================
   1091 +include $(CLEAR_VARS)
   1092 +include $(CLEAR_TBLGEN_VARS)
   1093 +
   1094 +LOCAL_SRC_FILES := $(linker_SRC_FILES)
   1095 +
   1096 +LOCAL_MODULE:= libLLVMLinker
   1097 +LOCAL_MODULE_TAGS := optional
   1098 +
   1099 +include $(LLVM_HOST_BUILD_MK)
   1100 +include $(BUILD_HOST_STATIC_LIBRARY)
   1101 +
   1102 +# For the device
   1103 +# =====================================================
   1104 +ifneq (true,$(DISABLE_LLVM_DEVICE_BUILDS))
   1105 +include $(CLEAR_VARS)
   1106 +
   1107 +LOCAL_SRC_FILES := $(linker_SRC_FILES)
   1108 +
   1109 +LOCAL_MODULE:= libLLVMLinker
   1110 +LOCAL_MODULE_TAGS := optional
   1111 +
   1112 +include $(LLVM_DEVICE_BUILD_MK)
   1113 +include $(LLVM_GEN_INTRINSICS_MK)
   1114 +include $(BUILD_STATIC_LIBRARY)
   1115 +endif
   1116 diff --git a/lib/MC/Android.mk b/lib/MC/Android.mk
   1117 new file mode 100644
   1118 index 0000000..abf346b
   1119 --- /dev/null
   1120 +++ b/lib/MC/Android.mk
   1121 @@ -0,0 +1,78 @@
   1122 +LOCAL_PATH:= $(call my-dir)
   1123 +
   1124 +mc_SRC_FILES := \
   1125 +  ELFObjectWriter.cpp \
   1126 +  MachObjectWriter.cpp \
   1127 +  MCAsmBackend.cpp \
   1128 +  MCAsmInfo.cpp \
   1129 +  MCAsmInfoCOFF.cpp \
   1130 +  MCAsmInfoDarwin.cpp \
   1131 +  MCAsmInfoELF.cpp \
   1132 +  MCAsmStreamer.cpp \
   1133 +  MCAssembler.cpp \
   1134 +  MCCodeEmitter.cpp \
   1135 +  MCCodeGenInfo.cpp \
   1136 +  MCContext.cpp \
   1137 +  MCDisassembler.cpp \
   1138 +  MCDwarf.cpp \
   1139 +  MCELF.cpp \
   1140 +  MCELFObjectTargetWriter.cpp \
   1141 +  MCELFStreamer.cpp \
   1142 +  MCExpr.cpp \
   1143 +  MCExternalSymbolizer.cpp \
   1144 +  MCFixup.cpp \
   1145 +  MCInst.cpp \
   1146 +  MCInstPrinter.cpp \
   1147 +  MCInstrAnalysis.cpp \
   1148 +  MCLabel.cpp \
   1149 +  MCLinkerOptimizationHint.cpp \
   1150 +  MCMachObjectTargetWriter.cpp \
   1151 +  MCMachOStreamer.cpp \
   1152 +  MCNullStreamer.cpp \
   1153 +  MCObjectFileInfo.cpp \
   1154 +  MCObjectStreamer.cpp \
   1155 +  MCObjectWriter.cpp \
   1156 +  MCRegisterInfo.cpp \
   1157 +  MCRelocationInfo.cpp \
   1158 +  MCSection.cpp \
   1159 +  MCSectionCOFF.cpp	\
   1160 +  MCSectionELF.cpp \
   1161 +  MCSectionMachO.cpp \
   1162 +  MCStreamer.cpp \
   1163 +  MCSubtargetInfo.cpp \
   1164 +  MCSymbol.cpp \
   1165 +  MCSymbolizer.cpp \
   1166 +  MCValue.cpp \
   1167 +  MCWin64EH.cpp \
   1168 +  WinCOFFObjectWriter.cpp \
   1169 +  WinCOFFStreamer.cpp \
   1170 +  SubtargetFeature.cpp
   1171 +
   1172 +# For the host
   1173 +# =====================================================
   1174 +include $(CLEAR_VARS)
   1175 +
   1176 +LOCAL_SRC_FILES := $(mc_SRC_FILES)
   1177 +
   1178 +LOCAL_MODULE:= libLLVMMC
   1179 +
   1180 +LOCAL_MODULE_TAGS := optional
   1181 +
   1182 +
   1183 +include $(LLVM_HOST_BUILD_MK)
   1184 +include $(BUILD_HOST_STATIC_LIBRARY)
   1185 +
   1186 +# For the device
   1187 +# =====================================================
   1188 +include $(CLEAR_VARS)
   1189 +ifneq (true,$(DISABLE_LLVM_DEVICE_BUILDS))
   1190 +
   1191 +LOCAL_SRC_FILES := $(mc_SRC_FILES)
   1192 +
   1193 +LOCAL_MODULE:= libLLVMMC
   1194 +
   1195 +LOCAL_MODULE_TAGS := optional
   1196 +
   1197 +include $(LLVM_DEVICE_BUILD_MK)
   1198 +include $(BUILD_STATIC_LIBRARY)
   1199 +endif
   1200 diff --git a/lib/MC/MCDisassembler/Android.mk b/lib/MC/MCDisassembler/Android.mk
   1201 new file mode 100644
   1202 index 0000000..7f73df3
   1203 --- /dev/null
   1204 +++ b/lib/MC/MCDisassembler/Android.mk
   1205 @@ -0,0 +1,15 @@
   1206 +LOCAL_PATH:= $(call my-dir)
   1207 +
   1208 +# For the host
   1209 +# =====================================================
   1210 +include $(CLEAR_VARS)
   1211 +
   1212 +LOCAL_SRC_FILES :=	\
   1213 +	Disassembler.cpp
   1214 +
   1215 +LOCAL_MODULE:= libLLVMMCDisassembler
   1216 +
   1217 +LOCAL_MODULE_TAGS := optional
   1218 +
   1219 +include $(LLVM_HOST_BUILD_MK)
   1220 +include $(BUILD_HOST_STATIC_LIBRARY)
   1221 diff --git a/lib/MC/MCParser/Android.mk b/lib/MC/MCParser/Android.mk
   1222 new file mode 100644
   1223 index 0000000..505a12b
   1224 --- /dev/null
   1225 +++ b/lib/MC/MCParser/Android.mk
   1226 @@ -0,0 +1,40 @@
   1227 +LOCAL_PATH:= $(call my-dir)
   1228 +
   1229 +mc_parser_SRC_FILES := \
   1230 +  AsmLexer.cpp \
   1231 +  AsmParser.cpp \
   1232 +  COFFAsmParser.cpp \
   1233 +  DarwinAsmParser.cpp \
   1234 +  ELFAsmParser.cpp \
   1235 +  MCAsmLexer.cpp \
   1236 +  MCAsmParser.cpp \
   1237 +  MCAsmParserExtension.cpp \
   1238 +  MCTargetAsmParser.cpp
   1239 +
   1240 +# For the host
   1241 +# =====================================================
   1242 +include $(CLEAR_VARS)
   1243 +
   1244 +LOCAL_SRC_FILES := $(mc_parser_SRC_FILES)
   1245 +
   1246 +LOCAL_MODULE:= libLLVMMCParser
   1247 +
   1248 +LOCAL_MODULE_TAGS := optional
   1249 +
   1250 +include $(LLVM_HOST_BUILD_MK)
   1251 +include $(BUILD_HOST_STATIC_LIBRARY)
   1252 +
   1253 +# For the device
   1254 +# =====================================================
   1255 +include $(CLEAR_VARS)
   1256 +ifneq (true,$(DISABLE_LLVM_DEVICE_BUILDS))
   1257 +
   1258 +LOCAL_SRC_FILES := $(mc_parser_SRC_FILES)
   1259 +
   1260 +LOCAL_MODULE:= libLLVMMCParser
   1261 +
   1262 +LOCAL_MODULE_TAGS := optional
   1263 +
   1264 +include $(LLVM_DEVICE_BUILD_MK)
   1265 +include $(BUILD_STATIC_LIBRARY)
   1266 +endif
   1267 diff --git a/lib/Object/Android.mk b/lib/Object/Android.mk
   1268 new file mode 100644
   1269 index 0000000..7dfa44f
   1270 --- /dev/null
   1271 +++ b/lib/Object/Android.mk
   1272 @@ -0,0 +1,45 @@
   1273 +LOCAL_PATH := $(call my-dir)
   1274 +
   1275 +object_SRC_FILES := \
   1276 +  Archive.cpp \
   1277 +  Binary.cpp \
   1278 +  COFFObjectFile.cpp \
   1279 +  ELF.cpp \
   1280 +  ELFObjectFile.cpp \
   1281 +  Error.cpp \
   1282 +  IRObjectFile.cpp \
   1283 +  MachOObjectFile.cpp \
   1284 +  MachOUniversal.cpp \
   1285 +  Object.cpp \
   1286 +  ObjectFile.cpp \
   1287 +  SymbolicFile.cpp
   1288 +
   1289 +
   1290 +# For the host
   1291 +# =====================================================
   1292 +include $(CLEAR_VARS)
   1293 +include $(CLEAR_TBLGEN_VARS)
   1294 +
   1295 +LOCAL_MODULE:= libLLVMObject
   1296 +LOCAL_MODULE_TAGS := optional
   1297 +
   1298 +LOCAL_SRC_FILES := $(object_SRC_FILES)
   1299 +
   1300 +include $(LLVM_HOST_BUILD_MK)
   1301 +include $(LLVM_GEN_INTRINSICS_MK)
   1302 +include $(BUILD_HOST_STATIC_LIBRARY)
   1303 +
   1304 +# For the device only
   1305 +# =====================================================
   1306 +ifneq (true,$(DISABLE_LLVM_DEVICE_BUILDS))
   1307 +include $(CLEAR_VARS)
   1308 +
   1309 +LOCAL_MODULE:= libLLVMObject
   1310 +LOCAL_MODULE_TAGS := optional
   1311 +
   1312 +LOCAL_SRC_FILES := $(object_SRC_FILES)
   1313 +
   1314 +include $(LLVM_DEVICE_BUILD_MK)
   1315 +include $(LLVM_GEN_INTRINSICS_MK)
   1316 +include $(BUILD_STATIC_LIBRARY)
   1317 +endif
   1318 diff --git a/lib/Option/Android.mk b/lib/Option/Android.mk
   1319 new file mode 100644
   1320 index 0000000..8680ce4
   1321 --- /dev/null
   1322 +++ b/lib/Option/Android.mk
   1323 @@ -0,0 +1,42 @@
   1324 +LOCAL_PATH:= $(call my-dir)
   1325 +
   1326 +option_SRC_FILES := \
   1327 +    Arg.cpp \
   1328 +    ArgList.cpp \
   1329 +    Option.cpp \
   1330 +    OptTable.cpp
   1331 +
   1332 +# For the host
   1333 +# =====================================================
   1334 +include $(CLEAR_VARS)
   1335 +
   1336 +# FIXME: This only requires RTTI because tblgen uses it.  Fix that.
   1337 +REQUIRES_RTTI := 1
   1338 +
   1339 +LOCAL_SRC_FILES := $(option_SRC_FILES)
   1340 +
   1341 +LOCAL_MODULE:= libLLVMOption
   1342 +
   1343 +LOCAL_CFLAGS := -D__android__
   1344 +
   1345 +LOCAL_MODULE_TAGS := optional
   1346 +
   1347 +include $(LLVM_HOST_BUILD_MK)
   1348 +include $(BUILD_HOST_STATIC_LIBRARY)
   1349 +
   1350 +# For the device
   1351 +# =====================================================
   1352 +include $(CLEAR_VARS)
   1353 +ifneq (true,$(DISABLE_LLVM_DEVICE_BUILDS))
   1354 +
   1355 +LOCAL_SRC_FILES := $(option_SRC_FILES)
   1356 +
   1357 +LOCAL_MODULE:= libLLVMOption
   1358 +
   1359 +LOCAL_CFLAGS := -D__android__
   1360 +
   1361 +LOCAL_MODULE_TAGS := optional
   1362 +
   1363 +include $(LLVM_DEVICE_BUILD_MK)
   1364 +include $(BUILD_STATIC_LIBRARY)
   1365 +endif
   1366 diff --git a/lib/Support/Android.mk b/lib/Support/Android.mk
   1367 new file mode 100644
   1368 index 0000000..165305e
   1369 --- /dev/null
   1370 +++ b/lib/Support/Android.mk
   1371 @@ -0,0 +1,120 @@
   1372 +LOCAL_PATH:= $(call my-dir)
   1373 +
   1374 +support_SRC_FILES := \
   1375 +  Allocator.cpp \
   1376 +  APFloat.cpp \
   1377 +  APInt.cpp \
   1378 +  APSInt.cpp \
   1379 +  ARMBuildAttrs.cpp \
   1380 +  Atomic.cpp \
   1381 +  BlockFrequency.cpp \
   1382 +  BranchProbability.cpp \
   1383 +  CommandLine.cpp \
   1384 +  Compression.cpp \
   1385 +  ConvertUTF.c \
   1386 +  ConvertUTFWrapper.cpp \
   1387 +  CrashRecoveryContext.cpp \
   1388 +  DAGDeltaAlgorithm.cpp \
   1389 +  DataStream.cpp \
   1390 +  DataExtractor.cpp \
   1391 +  Debug.cpp \
   1392 +  DeltaAlgorithm.cpp \
   1393 +  Dwarf.cpp \
   1394 +  DynamicLibrary.cpp \
   1395 +  Errno.cpp \
   1396 +  ErrorHandling.cpp \
   1397 +  FileUtilities.cpp \
   1398 +  FoldingSet.cpp \
   1399 +  FormattedStream.cpp \
   1400 +  GraphWriter.cpp \
   1401 +  Hashing.cpp \
   1402 +  Host.cpp \
   1403 +  IntervalMap.cpp \
   1404 +  IntEqClasses.cpp \
   1405 +  IntrusiveRefCntPtr.cpp \
   1406 +  IsInf.cpp \
   1407 +  IsNAN.cpp \
   1408 +  LEB128.cpp \
   1409 +  LineIterator.cpp \
   1410 +  Locale.cpp \
   1411 +  LockFileManager.cpp \
   1412 +  MD5.cpp \
   1413 +  ManagedStatic.cpp \
   1414 +  Memory.cpp \
   1415 +  MemoryBuffer.cpp \
   1416 +  MemoryObject.cpp \
   1417 +  Mutex.cpp \
   1418 +  Path.cpp \
   1419 +  PluginLoader.cpp \
   1420 +  PrettyStackTrace.cpp \
   1421 +  Process.cpp \
   1422 +  Program.cpp \
   1423 +  Regex.cpp \
   1424 +  RWMutex.cpp \
   1425 +  SearchForAddressOfSpecialSymbol.cpp \
   1426 +  Signals.cpp \
   1427 +  SmallPtrSet.cpp \
   1428 +  SmallVector.cpp \
   1429 +  SourceMgr.cpp \
   1430 +  Statistic.cpp \
   1431 +  StreamableMemoryObject.cpp \
   1432 +  StringExtras.cpp \
   1433 +  StringMap.cpp \
   1434 +  StringPool.cpp \
   1435 +  StringRef.cpp \
   1436 +  SystemUtils.cpp \
   1437 +  TargetRegistry.cpp \
   1438 +  Threading.cpp \
   1439 +  ThreadLocal.cpp \
   1440 +  Timer.cpp \
   1441 +  TimeValue.cpp \
   1442 +  ToolOutputFile.cpp \
   1443 +  Triple.cpp \
   1444 +  Twine.cpp \
   1445 +  Unicode.cpp \
   1446 +  Valgrind.cpp \
   1447 +  Watchdog.cpp \
   1448 +  circular_raw_ostream.cpp \
   1449 +  raw_os_ostream.cpp \
   1450 +  raw_ostream.cpp \
   1451 +  regcomp.c \
   1452 +  regerror.c \
   1453 +  regexec.c \
   1454 +  regfree.c \
   1455 +  regstrlcpy.c \
   1456 +  system_error.cpp
   1457 +
   1458 +# For the host
   1459 +# =====================================================
   1460 +include $(CLEAR_VARS)
   1461 +
   1462 +# FIXME: This only requires RTTI because tblgen uses it.  Fix that.
   1463 +REQUIRES_RTTI := 1
   1464 +
   1465 +LOCAL_SRC_FILES := $(support_SRC_FILES)
   1466 +
   1467 +LOCAL_MODULE:= libLLVMSupport
   1468 +
   1469 +LOCAL_CFLAGS := -D__android__
   1470 +
   1471 +LOCAL_MODULE_TAGS := optional
   1472 +
   1473 +include $(LLVM_HOST_BUILD_MK)
   1474 +include $(BUILD_HOST_STATIC_LIBRARY)
   1475 +
   1476 +# For the device
   1477 +# =====================================================
   1478 +ifneq (true,$(DISABLE_LLVM_DEVICE_BUILDS))
   1479 +include $(CLEAR_VARS)
   1480 +
   1481 +LOCAL_SRC_FILES := $(support_SRC_FILES)
   1482 +
   1483 +LOCAL_MODULE:= libLLVMSupport
   1484 +
   1485 +LOCAL_CFLAGS := -D__android__
   1486 +
   1487 +LOCAL_MODULE_TAGS := optional
   1488 +
   1489 +include $(LLVM_DEVICE_BUILD_MK)
   1490 +include $(BUILD_STATIC_LIBRARY)
   1491 +endif
   1492 diff --git a/lib/TableGen/Android.mk b/lib/TableGen/Android.mk
   1493 new file mode 100644
   1494 index 0000000..1f01ef7
   1495 --- /dev/null
   1496 +++ b/lib/TableGen/Android.mk
   1497 @@ -0,0 +1,39 @@
   1498 +LOCAL_PATH:= $(call my-dir)
   1499 +
   1500 +libtablegen_SRC_FILES := \
   1501 +  Error.cpp \
   1502 +  Main.cpp \
   1503 +  Record.cpp \
   1504 +  StringMatcher.cpp \
   1505 +  TableGenBackend.cpp \
   1506 +  TGLexer.cpp \
   1507 +  TGParser.cpp
   1508 +
   1509 +# For the host
   1510 +# =====================================================
   1511 +include $(CLEAR_VARS)
   1512 +
   1513 +LOCAL_SRC_FILES := $(libtablegen_SRC_FILES)
   1514 +LOCAL_MODULE:= libLLVMTableGen
   1515 +
   1516 +LOCAL_MODULE_TAGS := optional
   1517 +
   1518 +REQUIRES_EH := 1
   1519 +REQUIRES_RTTI := 1
   1520 +
   1521 +include $(LLVM_HOST_BUILD_MK)
   1522 +include $(BUILD_HOST_STATIC_LIBRARY)
   1523 +
   1524 +## For the device
   1525 +## =====================================================
   1526 +ifneq (true,$(DISABLE_LLVM_DEVICE_BUILDS))
   1527 +#include $(CLEAR_VARS)
   1528 +#
   1529 +#LOCAL_SRC_FILES := $(libtablegen_SRC_FILES)
   1530 +#LOCAL_MODULE:= libLLVMTableGen
   1531 +#
   1532 +#LOCAL_MODULE_TAGS := optional
   1533 +#
   1534 +#include $(LLVM_DEVICE_BUILD_MK)
   1535 +#include $(BUILD_STATIC_LIBRARY)
   1536 +endif
   1537 diff --git a/lib/Target/AArch64/Android.mk b/lib/Target/AArch64/Android.mk
   1538 new file mode 100644
   1539 index 0000000..144c2d3
   1540 --- /dev/null
   1541 +++ b/lib/Target/AArch64/Android.mk
   1542 @@ -0,0 +1,67 @@
   1543 +LOCAL_PATH := $(call my-dir)
   1544 +
   1545 +arm64_codegen_TBLGEN_TABLES := \
   1546 +  AArch64GenRegisterInfo.inc \
   1547 +  AArch64GenInstrInfo.inc \
   1548 +  AArch64GenCodeEmitter.inc \
   1549 +  AArch64GenMCCodeEmitter.inc \
   1550 +  AArch64GenMCPseudoLowering.inc \
   1551 +  AArch64GenAsmWriter.inc \
   1552 +  AArch64GenAsmMatcher.inc \
   1553 +  AArch64GenDAGISel.inc \
   1554 +  AArch64GenFastISel.inc \
   1555 +  AArch64GenCallingConv.inc \
   1556 +  AArch64GenSubtargetInfo.inc \
   1557 +  AArch64GenDisassemblerTables.inc
   1558 +
   1559 +arm64_codegen_SRC_FILES := \
   1560 +  AArch64AsmPrinter.cpp \
   1561 +  AArch64FrameLowering.cpp \
   1562 +  AArch64ISelDAGToDAG.cpp \
   1563 +  AArch64MachineFunctionInfo.cpp \
   1564 +  AArch64RegisterInfo.cpp \
   1565 +  AArch64Subtarget.cpp \
   1566 +  AArch64TargetObjectFile.cpp \
   1567 +  AArch64BranchFixupPass.cpp \
   1568 +  AArch64InstrInfo.cpp \
   1569 +  AArch64ISelLowering.cpp \
   1570 +  AArch64MCInstLower.cpp \
   1571 +  AArch64SelectionDAGInfo.cpp \
   1572 +  AArch64TargetMachine.cpp \
   1573 +  AArch64TargetTransformInfo.cpp
   1574 +
   1575 +# For the host
   1576 +# =====================================================
   1577 +include $(CLEAR_VARS)
   1578 +include $(CLEAR_TBLGEN_VARS)
   1579 +
   1580 +LOCAL_MODULE:= libLLVMARM64CodeGen
   1581 +LOCAL_MODULE_TAGS := optional
   1582 +
   1583 +LOCAL_SRC_FILES := $(arm64_codegen_SRC_FILES)
   1584 +LOCAL_C_INCLUDES := $(LOCAL_PATH)/MCTargetDesc
   1585 +TBLGEN_TABLES := $(arm64_codegen_TBLGEN_TABLES)
   1586 +
   1587 +include $(LLVM_HOST_BUILD_MK)
   1588 +include $(LLVM_TBLGEN_RULES_MK)
   1589 +include $(LLVM_GEN_INTRINSICS_MK)
   1590 +include $(BUILD_HOST_STATIC_LIBRARY)
   1591 +
   1592 +# For the device only
   1593 +# =====================================================
   1594 +ifneq (true,$(DISABLE_LLVM_DEVICE_BUILDS))
   1595 +include $(CLEAR_VARS)
   1596 +include $(CLEAR_TBLGEN_VARS)
   1597 +
   1598 +LOCAL_MODULE:= libLLVMARM64CodeGen
   1599 +LOCAL_MODULE_TAGS := optional
   1600 +
   1601 +LOCAL_SRC_FILES := $(arm64_codegen_SRC_FILES)
   1602 +LOCAL_C_INCLUDES := $(LOCAL_PATH)/MCTargetDesc
   1603 +TBLGEN_TABLES := $(arm64_codegen_TBLGEN_TABLES)
   1604 +
   1605 +include $(LLVM_DEVICE_BUILD_MK)
   1606 +include $(LLVM_TBLGEN_RULES_MK)
   1607 +include $(LLVM_GEN_INTRINSICS_MK)
   1608 +include $(BUILD_STATIC_LIBRARY)
   1609 +endif
   1610 diff --git a/lib/Target/AArch64/AsmParser/Android.mk b/lib/Target/AArch64/AsmParser/Android.mk
   1611 new file mode 100644
   1612 index 0000000..0588511
   1613 --- /dev/null
   1614 +++ b/lib/Target/AArch64/AsmParser/Android.mk
   1615 @@ -0,0 +1,63 @@
   1616 +LOCAL_PATH := $(call my-dir)
   1617 +
   1618 +#===---------------------------------------------------------------===
   1619 +# libARMAsmParser (common)
   1620 +#===---------------------------------------------------------------===
   1621 +
   1622 +arm64_asm_parser_SRC_FILES := \
   1623 +  AArch64AsmParser.cpp
   1624 +
   1625 +arm64_asm_parser_TBLGEN_TABLES := \
   1626 +  AArch64GenInstrInfo.inc \
   1627 +  AArch64GenRegisterInfo.inc \
   1628 +  AArch64GenAsmMatcher.inc \
   1629 +  AArch64GenSubtargetInfo.inc
   1630 +
   1631 +arm64_asm_parser_TBLGEN_TD_DIR := $(LOCAL_PATH)/..
   1632 +
   1633 +arm64_asm_parser_C_INCLUDES := $(LOCAL_PATH)/..
   1634 +
   1635 +
   1636 +#===---------------------------------------------------------------===
   1637 +# libARM64AsmParser (host)
   1638 +#===---------------------------------------------------------------===
   1639 +include $(CLEAR_VARS)
   1640 +include $(CLEAR_TBLGEN_VARS)
   1641 +
   1642 +LOCAL_MODULE:= libLLVMARM64AsmParser
   1643 +LOCAL_MODULE_TAGS := optional
   1644 +LOCAL_SRC_FILES := $(arm64_asm_parser_SRC_FILES)
   1645 +LOCAL_C_INCLUDES += $(arm64_asm_parser_C_INCLUDES)
   1646 +TBLGEN_TABLES := $(arm64_asm_parser_TBLGEN_TABLES)
   1647 +TBLGEN_TD_DIR := $(arm64_asm_parser_TBLGEN_TD_DIR)
   1648 +
   1649 +include $(LLVM_HOST_BUILD_MK)
   1650 +include $(LLVM_TBLGEN_RULES_MK)
   1651 +ifneq (,$(filter windows darwin,$(HOST_OS)))
   1652 +# Override the default optimization level to work around taking forever (~50m)
   1653 +# to compile ARM64AsmParser.cpp on Mac with gcc 4.2,
   1654 +# or on Linux with mingw32msvc-gcc 4.2, which is used to cross-compile
   1655 +# the win_sdk.
   1656 +LOCAL_CFLAGS += -O0
   1657 +endif
   1658 +include $(BUILD_HOST_STATIC_LIBRARY)
   1659 +
   1660 +
   1661 +#===---------------------------------------------------------------===
   1662 +# libARM64AsmParser (target)
   1663 +#===---------------------------------------------------------------===
   1664 +ifneq (true,$(DISABLE_LLVM_DEVICE_BUILDS))
   1665 +include $(CLEAR_VARS)
   1666 +include $(CLEAR_TBLGEN_VARS)
   1667 +
   1668 +LOCAL_MODULE:= libLLVMARM64AsmParser
   1669 +LOCAL_MODULE_TAGS := optional
   1670 +LOCAL_SRC_FILES := $(arm64_asm_parser_SRC_FILES)
   1671 +LOCAL_C_INCLUDES += $(arm64_asm_parser_C_INCLUDES)
   1672 +TBLGEN_TABLES := $(arm64_asm_parser_TBLGEN_TABLES)
   1673 +TBLGEN_TD_DIR := $(arm64_asm_parser_TBLGEN_TD_DIR)
   1674 +
   1675 +include $(LLVM_DEVICE_BUILD_MK)
   1676 +include $(LLVM_TBLGEN_RULES_MK)
   1677 +include $(BUILD_STATIC_LIBRARY)
   1678 +endif
   1679 diff --git a/lib/Target/AArch64/Disassembler/Android.mk b/lib/Target/AArch64/Disassembler/Android.mk
   1680 new file mode 100644
   1681 index 0000000..fcc53ad
   1682 --- /dev/null
   1683 +++ b/lib/Target/AArch64/Disassembler/Android.mk
   1684 @@ -0,0 +1,55 @@
   1685 +LOCAL_PATH := $(call my-dir)
   1686 +
   1687 +arm64_disassembler_TBLGEN_TABLES := \
   1688 +  AArch64GenDisassemblerTables.inc \
   1689 +  AArch64GenInstrInfo.inc \
   1690 +  AArch64GenSubtargetInfo.inc \
   1691 +  AArch64GenRegisterInfo.inc
   1692 +
   1693 +arm64_disassembler_SRC_FILES := \
   1694 +  AArch64Disassembler.cpp
   1695 +
   1696 +# For the device
   1697 +# =====================================================
   1698 +ifneq (true,$(DISABLE_LLVM_DEVICE_BUILDS))
   1699 +include $(CLEAR_VARS)
   1700 +include $(CLEAR_TBLGEN_VARS)
   1701 +
   1702 +TBLGEN_TABLES := $(arm64_disassembler_TBLGEN_TABLES)
   1703 +
   1704 +TBLGEN_TD_DIR := $(LOCAL_PATH)/..
   1705 +
   1706 +LOCAL_SRC_FILES := $(arm64_disassembler_SRC_FILES)
   1707 +
   1708 +LOCAL_C_INCLUDES += $(LOCAL_PATH)/..
   1709 +
   1710 +LOCAL_MODULE:= libLLVMARM64Disassembler
   1711 +
   1712 +LOCAL_MODULE_TAGS := optional
   1713 +
   1714 +include $(LLVM_DEVICE_BUILD_MK)
   1715 +include $(LLVM_TBLGEN_RULES_MK)
   1716 +include $(BUILD_STATIC_LIBRARY)
   1717 +endif
   1718 +
   1719 +# For the host
   1720 +# =====================================================
   1721 +include $(CLEAR_VARS)
   1722 +include $(CLEAR_TBLGEN_VARS)
   1723 +
   1724 +TBLGEN_TABLES := $(arm64_disassembler_TBLGEN_TABLES)
   1725 +
   1726 +TBLGEN_TD_DIR := $(LOCAL_PATH)/..
   1727 +
   1728 +LOCAL_SRC_FILES := $(arm64_disassembler_SRC_FILES)
   1729 +
   1730 +LOCAL_C_INCLUDES += $(LOCAL_PATH)/..
   1731 +
   1732 +LOCAL_MODULE:= libLLVMARM64Disassembler
   1733 +
   1734 +LOCAL_MODULE_TAGS := optional
   1735 +
   1736 +include $(LLVM_HOST_BUILD_MK)
   1737 +include $(LLVM_TBLGEN_RULES_MK)
   1738 +include $(BUILD_HOST_STATIC_LIBRARY)
   1739 +
   1740 diff --git a/lib/Target/AArch64/InstPrinter/Android.mk b/lib/Target/AArch64/InstPrinter/Android.mk
   1741 new file mode 100644
   1742 index 0000000..ac9b0df
   1743 --- /dev/null
   1744 +++ b/lib/Target/AArch64/InstPrinter/Android.mk
   1745 @@ -0,0 +1,57 @@
   1746 +LOCAL_PATH := $(call my-dir)
   1747 +
   1748 +arm64_asm_printer_TBLGEN_TABLES := \
   1749 +  AArch64GenAsmWriter.inc \
   1750 +  AArch64GenRegisterInfo.inc \
   1751 +  AArch64GenSubtargetInfo.inc \
   1752 +  AArch64GenInstrInfo.inc
   1753 +
   1754 +arm64_asm_printer_SRC_FILES := \
   1755 +  AArch64InstPrinter.cpp
   1756 +
   1757 +# For the host
   1758 +# =====================================================
   1759 +include $(CLEAR_VARS)
   1760 +include $(CLEAR_TBLGEN_VARS)
   1761 +
   1762 +TBLGEN_TABLES := $(arm64_asm_printer_TBLGEN_TABLES)
   1763 +
   1764 +TBLGEN_TD_DIR := $(LOCAL_PATH)/..
   1765 +
   1766 +LOCAL_SRC_FILES := $(arm64_asm_printer_SRC_FILES)
   1767 +
   1768 +LOCAL_MODULE:= libLLVMARM64AsmPrinter
   1769 +
   1770 +LOCAL_C_INCLUDES += \
   1771 +    $(LOCAL_PATH)/..
   1772 +
   1773 +LOCAL_MODULE_TAGS := optional
   1774 +
   1775 +include $(LLVM_HOST_BUILD_MK)
   1776 +include $(LLVM_TBLGEN_RULES_MK)
   1777 +include $(BUILD_HOST_STATIC_LIBRARY)
   1778 +
   1779 +# For the device only
   1780 +# =====================================================
   1781 +ifneq (true,$(DISABLE_LLVM_DEVICE_BUILDS))
   1782 +include $(CLEAR_VARS)
   1783 +include $(CLEAR_TBLGEN_VARS)
   1784 +
   1785 +TBLGEN_TABLES := $(arm64_asm_printer_TBLGEN_TABLES)
   1786 +
   1787 +TBLGEN_TD_DIR := $(LOCAL_PATH)/..
   1788 +
   1789 +LOCAL_SRC_FILES := $(arm64_asm_printer_SRC_FILES)
   1790 +
   1791 +LOCAL_C_INCLUDES+= \
   1792 +    $(LOCAL_PATH)/..
   1793 +
   1794 +LOCAL_MODULE:= libLLVMARM64AsmPrinter
   1795 +
   1796 +LOCAL_MODULE_TAGS := optional
   1797 +
   1798 +include $(LLVM_DEVICE_BUILD_MK)
   1799 +include $(LLVM_TBLGEN_RULES_MK)
   1800 +include $(BUILD_STATIC_LIBRARY)
   1801 +endif
   1802 +
   1803 diff --git a/lib/Target/AArch64/MCTargetDesc/Android.mk b/lib/Target/AArch64/MCTargetDesc/Android.mk
   1804 new file mode 100644
   1805 index 0000000..edcf1f2
   1806 --- /dev/null
   1807 +++ b/lib/Target/AArch64/MCTargetDesc/Android.mk
   1808 @@ -0,0 +1,57 @@
   1809 +LOCAL_PATH := $(call my-dir)
   1810 +
   1811 +arm64_mc_desc_TBLGEN_TABLES := \
   1812 +  AArch64GenRegisterInfo.inc \
   1813 +  AArch64GenInstrInfo.inc \
   1814 +  AArch64GenMCCodeEmitter.inc \
   1815 +  AArch64GenSubtargetInfo.inc
   1816 +
   1817 +arm64_mc_desc_SRC_FILES := \
   1818 +  AArch64AsmBackend.cpp \
   1819 +  AArch64ELFObjectWriter.cpp \
   1820 +  AArch64ELFStreamer.cpp \
   1821 +  AArch64MCAsmInfo.cpp \
   1822 +  AArch64MCCodeEmitter.cpp \
   1823 +  AArch64MCExpr.cpp \
   1824 +  AArch64MCTargetDesc.cpp
   1825 +
   1826 +# For the host
   1827 +# =====================================================
   1828 +include $(CLEAR_VARS)
   1829 +include $(CLEAR_TBLGEN_VARS)
   1830 +
   1831 +
   1832 +LOCAL_MODULE:= libLLVMARM64Desc
   1833 +LOCAL_MODULE_TAGS := optional
   1834 +
   1835 +LOCAL_SRC_FILES := $(arm64_mc_desc_SRC_FILES)
   1836 +LOCAL_C_INCLUDES := $(LOCAL_PATH)/..
   1837 +
   1838 +TBLGEN_TD_DIR := $(LOCAL_PATH)/..
   1839 +TBLGEN_TABLES := $(arm64_mc_desc_TBLGEN_TABLES)
   1840 +
   1841 +include $(LLVM_HOST_BUILD_MK)
   1842 +include $(LLVM_TBLGEN_RULES_MK)
   1843 +include $(LLVM_GEN_INTRINSICS_MK)
   1844 +include $(BUILD_HOST_STATIC_LIBRARY)
   1845 +
   1846 +# For the device only
   1847 +# =====================================================
   1848 +ifneq (true,$(DISABLE_LLVM_DEVICE_BUILDS))
   1849 +include $(CLEAR_VARS)
   1850 +include $(CLEAR_TBLGEN_VARS)
   1851 +
   1852 +LOCAL_MODULE:= libLLVMARM64Desc
   1853 +LOCAL_MODULE_TAGS := optional
   1854 +
   1855 +LOCAL_SRC_FILES := $(arm64_mc_desc_SRC_FILES)
   1856 +LOCAL_C_INCLUDES := $(LOCAL_PATH)/..
   1857 +
   1858 +TBLGEN_TD_DIR := $(LOCAL_PATH)/..
   1859 +TBLGEN_TABLES := $(arm64_mc_desc_TBLGEN_TABLES)
   1860 +
   1861 +include $(LLVM_DEVICE_BUILD_MK)
   1862 +include $(LLVM_TBLGEN_RULES_MK)
   1863 +include $(LLVM_GEN_INTRINSICS_MK)
   1864 +include $(BUILD_STATIC_LIBRARY)
   1865 +endif
   1866 diff --git a/lib/Target/AArch64/TargetInfo/Android.mk b/lib/Target/AArch64/TargetInfo/Android.mk
   1867 new file mode 100644
   1868 index 0000000..cc650f6
   1869 --- /dev/null
   1870 +++ b/lib/Target/AArch64/TargetInfo/Android.mk
   1871 @@ -0,0 +1,55 @@
   1872 +LOCAL_PATH := $(call my-dir)
   1873 +
   1874 +arm64_target_info_TBLGEN_TABLES := \
   1875 +  AArch64GenSubtargetInfo.inc \
   1876 +  AArch64GenRegisterInfo.inc \
   1877 +  AArch64GenInstrInfo.inc
   1878 +
   1879 +arm64_target_info_SRC_FILES := \
   1880 +  AArch64TargetInfo.cpp
   1881 +
   1882 +# For the host
   1883 +# =====================================================
   1884 +include $(CLEAR_VARS)
   1885 +include $(CLEAR_TBLGEN_VARS)
   1886 +
   1887 +TBLGEN_TABLES := $(arm64_target_info_TBLGEN_TABLES)
   1888 +
   1889 +TBLGEN_TD_DIR := $(LOCAL_PATH)/..
   1890 +
   1891 +LOCAL_SRC_FILES := $(arm64_target_info_SRC_FILES)
   1892 +
   1893 +LOCAL_C_INCLUDES +=	\
   1894 +	$(LOCAL_PATH)/..
   1895 +
   1896 +LOCAL_MODULE:= libLLVMARM64Info
   1897 +
   1898 +LOCAL_MODULE_TAGS := optional
   1899 +
   1900 +include $(LLVM_HOST_BUILD_MK)
   1901 +include $(LLVM_TBLGEN_RULES_MK)
   1902 +include $(BUILD_HOST_STATIC_LIBRARY)
   1903 +
   1904 +# For the device
   1905 +# =====================================================
   1906 +ifneq (true,$(DISABLE_LLVM_DEVICE_BUILDS))
   1907 +include $(CLEAR_VARS)
   1908 +include $(CLEAR_TBLGEN_VARS)
   1909 +
   1910 +TBLGEN_TABLES := $(arm64_target_info_TBLGEN_TABLES)
   1911 +
   1912 +TBLGEN_TD_DIR := $(LOCAL_PATH)/..
   1913 +
   1914 +LOCAL_SRC_FILES := $(arm64_target_info_SRC_FILES)
   1915 +
   1916 +LOCAL_C_INCLUDES +=	\
   1917 +	$(LOCAL_PATH)/..
   1918 +
   1919 +LOCAL_MODULE:= libLLVMARM64Info
   1920 +
   1921 +LOCAL_MODULE_TAGS := optional
   1922 +
   1923 +include $(LLVM_DEVICE_BUILD_MK)
   1924 +include $(LLVM_TBLGEN_RULES_MK)
   1925 +include $(BUILD_STATIC_LIBRARY)
   1926 +endif
   1927 diff --git a/lib/Target/AArch64/Utils/Android.mk b/lib/Target/AArch64/Utils/Android.mk
   1928 new file mode 100644
   1929 index 0000000..b8bf795
   1930 --- /dev/null
   1931 +++ b/lib/Target/AArch64/Utils/Android.mk
   1932 @@ -0,0 +1,36 @@
   1933 +LOCAL_PATH := $(call my-dir)
   1934 +
   1935 +arm64_utils_SRC_FILES := \
   1936 +  AArch64BaseInfo.cpp
   1937 +
   1938 +# For the device
   1939 +# =====================================================
   1940 +ifneq (true,$(DISABLE_LLVM_DEVICE_BUILDS))
   1941 +include $(CLEAR_VARS)
   1942 +
   1943 +LOCAL_SRC_FILES := $(arm64_utils_SRC_FILES)
   1944 +
   1945 +LOCAL_C_INCLUDES += $(LOCAL_PATH)/..
   1946 +
   1947 +LOCAL_MODULE:= libLLVMARM64Utils
   1948 +
   1949 +LOCAL_MODULE_TAGS := optional
   1950 +
   1951 +include $(LLVM_DEVICE_BUILD_MK)
   1952 +include $(BUILD_STATIC_LIBRARY)
   1953 +endif
   1954 +
   1955 +# For the host
   1956 +# =====================================================
   1957 +include $(CLEAR_VARS)
   1958 +
   1959 +LOCAL_SRC_FILES := $(arm64_utils_SRC_FILES)
   1960 +
   1961 +LOCAL_C_INCLUDES += $(LOCAL_PATH)/..
   1962 +
   1963 +LOCAL_MODULE:= libLLVMARM64Utils
   1964 +
   1965 +LOCAL_MODULE_TAGS := optional
   1966 +
   1967 +include $(LLVM_HOST_BUILD_MK)
   1968 +include $(BUILD_HOST_STATIC_LIBRARY)
   1969 diff --git a/lib/Target/ARM/Android.mk b/lib/Target/ARM/Android.mk
   1970 new file mode 100644
   1971 index 0000000..4be95aa
   1972 --- /dev/null
   1973 +++ b/lib/Target/ARM/Android.mk
   1974 @@ -0,0 +1,87 @@
   1975 +LOCAL_PATH := $(call my-dir)
   1976 +
   1977 +arm_codegen_TBLGEN_TABLES := \
   1978 +  ARMGenRegisterInfo.inc \
   1979 +  ARMGenInstrInfo.inc \
   1980 +  ARMGenCodeEmitter.inc \
   1981 +  ARMGenMCCodeEmitter.inc \
   1982 +  ARMGenMCPseudoLowering.inc \
   1983 +  ARMGenAsmWriter.inc \
   1984 +  ARMGenAsmMatcher.inc \
   1985 +  ARMGenDAGISel.inc \
   1986 +  ARMGenFastISel.inc \
   1987 +  ARMGenCallingConv.inc \
   1988 +  ARMGenSubtargetInfo.inc \
   1989 +  ARMGenDisassemblerTables.inc
   1990 +
   1991 +arm_codegen_SRC_FILES := \
   1992 +  A15SDOptimizer.cpp \
   1993 +  ARMAsmPrinter.cpp \
   1994 +  ARMAtomicExpandPass.cpp \
   1995 +  ARMBaseInstrInfo.cpp \
   1996 +  ARMBaseRegisterInfo.cpp \
   1997 +  ARMCodeEmitter.cpp \
   1998 +  ARMConstantIslandPass.cpp \
   1999 +  ARMConstantPoolValue.cpp \
   2000 +  ARMExpandPseudoInsts.cpp \
   2001 +  ARMFastISel.cpp \
   2002 +  ARMFrameLowering.cpp \
   2003 +  ARMHazardRecognizer.cpp \
   2004 +  ARMISelDAGToDAG.cpp \
   2005 +  ARMISelLowering.cpp \
   2006 +  ARMInstrInfo.cpp \
   2007 +  ARMJITInfo.cpp \
   2008 +  ARMLoadStoreOptimizer.cpp \
   2009 +  ARMMCInstLower.cpp \
   2010 +  ARMMachineFunctionInfo.cpp \
   2011 +  ARMOptimizeBarriersPass.cpp \
   2012 +  ARMRegisterInfo.cpp \
   2013 +  ARMSelectionDAGInfo.cpp \
   2014 +  ARMSubtarget.cpp \
   2015 +  ARMTargetMachine.cpp \
   2016 +  ARMTargetObjectFile.cpp \
   2017 +  ARMTargetTransformInfo.cpp \
   2018 +  MLxExpansionPass.cpp \
   2019 +  Thumb1FrameLowering.cpp \
   2020 +  Thumb1InstrInfo.cpp \
   2021 +  Thumb1RegisterInfo.cpp \
   2022 +  Thumb2ITBlockPass.cpp \
   2023 +  Thumb2InstrInfo.cpp \
   2024 +  Thumb2RegisterInfo.cpp \
   2025 +  Thumb2SizeReduction.cpp
   2026 +
   2027 +# For the host
   2028 +# =====================================================
   2029 +include $(CLEAR_VARS)
   2030 +include $(CLEAR_TBLGEN_VARS)
   2031 +
   2032 +LOCAL_MODULE:= libLLVMARMCodeGen
   2033 +LOCAL_MODULE_TAGS := optional
   2034 +
   2035 +LOCAL_SRC_FILES := $(arm_codegen_SRC_FILES)
   2036 +LOCAL_C_INCLUDES := $(LOCAL_PATH)/MCTargetDesc
   2037 +TBLGEN_TABLES := $(arm_codegen_TBLGEN_TABLES)
   2038 +
   2039 +include $(LLVM_HOST_BUILD_MK)
   2040 +include $(LLVM_TBLGEN_RULES_MK)
   2041 +include $(LLVM_GEN_INTRINSICS_MK)
   2042 +include $(BUILD_HOST_STATIC_LIBRARY)
   2043 +
   2044 +# For the device only
   2045 +# =====================================================
   2046 +ifneq (true,$(DISABLE_LLVM_DEVICE_BUILDS))
   2047 +include $(CLEAR_VARS)
   2048 +include $(CLEAR_TBLGEN_VARS)
   2049 +
   2050 +LOCAL_MODULE:= libLLVMARMCodeGen
   2051 +LOCAL_MODULE_TAGS := optional
   2052 +
   2053 +LOCAL_SRC_FILES := $(arm_codegen_SRC_FILES)
   2054 +LOCAL_C_INCLUDES := $(LOCAL_PATH)/MCTargetDesc
   2055 +TBLGEN_TABLES := $(arm_codegen_TBLGEN_TABLES)
   2056 +
   2057 +include $(LLVM_DEVICE_BUILD_MK)
   2058 +include $(LLVM_TBLGEN_RULES_MK)
   2059 +include $(LLVM_GEN_INTRINSICS_MK)
   2060 +include $(BUILD_STATIC_LIBRARY)
   2061 +endif
   2062 diff --git a/lib/Target/ARM/AsmParser/Android.mk b/lib/Target/ARM/AsmParser/Android.mk
   2063 new file mode 100644
   2064 index 0000000..5f88cc3
   2065 --- /dev/null
   2066 +++ b/lib/Target/ARM/AsmParser/Android.mk
   2067 @@ -0,0 +1,63 @@
   2068 +LOCAL_PATH := $(call my-dir)
   2069 +
   2070 +#===---------------------------------------------------------------===
   2071 +# libARMAsmParser (common)
   2072 +#===---------------------------------------------------------------===
   2073 +
   2074 +arm_asm_parser_SRC_FILES := \
   2075 +  ARMAsmParser.cpp
   2076 +
   2077 +arm_asm_parser_TBLGEN_TABLES := \
   2078 +  ARMGenInstrInfo.inc \
   2079 +  ARMGenRegisterInfo.inc \
   2080 +  ARMGenAsmMatcher.inc \
   2081 +  ARMGenSubtargetInfo.inc
   2082 +
   2083 +arm_asm_parser_TBLGEN_TD_DIR := $(LOCAL_PATH)/..
   2084 +
   2085 +arm_asm_parser_C_INCLUDES := $(LOCAL_PATH)/..
   2086 +
   2087 +
   2088 +#===---------------------------------------------------------------===
   2089 +# libARMAsmParser (host)
   2090 +#===---------------------------------------------------------------===
   2091 +include $(CLEAR_VARS)
   2092 +include $(CLEAR_TBLGEN_VARS)
   2093 +
   2094 +LOCAL_MODULE:= libLLVMARMAsmParser
   2095 +LOCAL_MODULE_TAGS := optional
   2096 +LOCAL_SRC_FILES := $(arm_asm_parser_SRC_FILES)
   2097 +LOCAL_C_INCLUDES += $(arm_asm_parser_C_INCLUDES)
   2098 +TBLGEN_TABLES := $(arm_asm_parser_TBLGEN_TABLES)
   2099 +TBLGEN_TD_DIR := $(arm_asm_parser_TBLGEN_TD_DIR)
   2100 +
   2101 +include $(LLVM_HOST_BUILD_MK)
   2102 +include $(LLVM_TBLGEN_RULES_MK)
   2103 +ifneq (,$(filter windows darwin,$(HOST_OS)))
   2104 +# Override the default optimization level to work around taking forever (~50m)
   2105 +# to compile ARMAsmParser.cpp on Mac with gcc 4.2,
   2106 +# or on Linux with mingw32msvc-gcc 4.2, which is used to cross-compile
   2107 +# the win_sdk.
   2108 +LOCAL_CFLAGS += -O0
   2109 +endif
   2110 +include $(BUILD_HOST_STATIC_LIBRARY)
   2111 +
   2112 +
   2113 +#===---------------------------------------------------------------===
   2114 +# libARMAsmParser (target)
   2115 +#===---------------------------------------------------------------===
   2116 +ifneq (true,$(DISABLE_LLVM_DEVICE_BUILDS))
   2117 +include $(CLEAR_VARS)
   2118 +include $(CLEAR_TBLGEN_VARS)
   2119 +
   2120 +LOCAL_MODULE:= libLLVMARMAsmParser
   2121 +LOCAL_MODULE_TAGS := optional
   2122 +LOCAL_SRC_FILES := $(arm_asm_parser_SRC_FILES)
   2123 +LOCAL_C_INCLUDES += $(arm_asm_parser_C_INCLUDES)
   2124 +TBLGEN_TABLES := $(arm_asm_parser_TBLGEN_TABLES)
   2125 +TBLGEN_TD_DIR := $(arm_asm_parser_TBLGEN_TD_DIR)
   2126 +
   2127 +include $(LLVM_DEVICE_BUILD_MK)
   2128 +include $(LLVM_TBLGEN_RULES_MK)
   2129 +include $(BUILD_STATIC_LIBRARY)
   2130 +endif
   2131 diff --git a/lib/Target/ARM/Disassembler/Android.mk b/lib/Target/ARM/Disassembler/Android.mk
   2132 new file mode 100644
   2133 index 0000000..3db61a5
   2134 --- /dev/null
   2135 +++ b/lib/Target/ARM/Disassembler/Android.mk
   2136 @@ -0,0 +1,55 @@
   2137 +LOCAL_PATH := $(call my-dir)
   2138 +
   2139 +arm_disassembler_TBLGEN_TABLES := \
   2140 +  ARMGenDisassemblerTables.inc \
   2141 +  ARMGenInstrInfo.inc \
   2142 +  ARMGenSubtargetInfo.inc \
   2143 +  ARMGenRegisterInfo.inc
   2144 +
   2145 +arm_disassembler_SRC_FILES := \
   2146 +  ARMDisassembler.cpp
   2147 +
   2148 +# For the device
   2149 +# =====================================================
   2150 +ifneq (true,$(DISABLE_LLVM_DEVICE_BUILDS))
   2151 +include $(CLEAR_VARS)
   2152 +include $(CLEAR_TBLGEN_VARS)
   2153 +
   2154 +TBLGEN_TABLES := $(arm_disassembler_TBLGEN_TABLES)
   2155 +
   2156 +TBLGEN_TD_DIR := $(LOCAL_PATH)/..
   2157 +
   2158 +LOCAL_SRC_FILES := $(arm_disassembler_SRC_FILES)
   2159 +
   2160 +LOCAL_C_INCLUDES += $(LOCAL_PATH)/..
   2161 +
   2162 +LOCAL_MODULE:= libLLVMARMDisassembler
   2163 +
   2164 +LOCAL_MODULE_TAGS := optional
   2165 +
   2166 +include $(LLVM_DEVICE_BUILD_MK)
   2167 +include $(LLVM_TBLGEN_RULES_MK)
   2168 +include $(BUILD_STATIC_LIBRARY)
   2169 +endif
   2170 +
   2171 +# For the host
   2172 +# =====================================================
   2173 +include $(CLEAR_VARS)
   2174 +include $(CLEAR_TBLGEN_VARS)
   2175 +
   2176 +TBLGEN_TABLES := $(arm_disassembler_TBLGEN_TABLES)
   2177 +
   2178 +TBLGEN_TD_DIR := $(LOCAL_PATH)/..
   2179 +
   2180 +LOCAL_SRC_FILES := $(arm_disassembler_SRC_FILES)
   2181 +
   2182 +LOCAL_C_INCLUDES += $(LOCAL_PATH)/..
   2183 +
   2184 +LOCAL_MODULE:= libLLVMARMDisassembler
   2185 +
   2186 +LOCAL_MODULE_TAGS := optional
   2187 +
   2188 +include $(LLVM_HOST_BUILD_MK)
   2189 +include $(LLVM_TBLGEN_RULES_MK)
   2190 +include $(BUILD_HOST_STATIC_LIBRARY)
   2191 +
   2192 diff --git a/lib/Target/ARM/InstPrinter/Android.mk b/lib/Target/ARM/InstPrinter/Android.mk
   2193 new file mode 100644
   2194 index 0000000..cefed76
   2195 --- /dev/null
   2196 +++ b/lib/Target/ARM/InstPrinter/Android.mk
   2197 @@ -0,0 +1,57 @@
   2198 +LOCAL_PATH := $(call my-dir)
   2199 +
   2200 +arm_asm_printer_TBLGEN_TABLES := \
   2201 +  ARMGenAsmWriter.inc \
   2202 +  ARMGenRegisterInfo.inc \
   2203 +  ARMGenSubtargetInfo.inc \
   2204 +  ARMGenInstrInfo.inc
   2205 +
   2206 +arm_asm_printer_SRC_FILES := \
   2207 +  ARMInstPrinter.cpp
   2208 +
   2209 +# For the host
   2210 +# =====================================================
   2211 +include $(CLEAR_VARS)
   2212 +include $(CLEAR_TBLGEN_VARS)
   2213 +
   2214 +TBLGEN_TABLES := $(arm_asm_printer_TBLGEN_TABLES)
   2215 +
   2216 +TBLGEN_TD_DIR := $(LOCAL_PATH)/..
   2217 +
   2218 +LOCAL_SRC_FILES := $(arm_asm_printer_SRC_FILES)
   2219 +
   2220 +LOCAL_MODULE:= libLLVMARMAsmPrinter
   2221 +
   2222 +LOCAL_C_INCLUDES += \
   2223 +    $(LOCAL_PATH)/..
   2224 +
   2225 +LOCAL_MODULE_TAGS := optional
   2226 +
   2227 +include $(LLVM_HOST_BUILD_MK)
   2228 +include $(LLVM_TBLGEN_RULES_MK)
   2229 +include $(BUILD_HOST_STATIC_LIBRARY)
   2230 +
   2231 +# For the device only
   2232 +# =====================================================
   2233 +ifneq (true,$(DISABLE_LLVM_DEVICE_BUILDS))
   2234 +include $(CLEAR_VARS)
   2235 +include $(CLEAR_TBLGEN_VARS)
   2236 +
   2237 +TBLGEN_TABLES := $(arm_asm_printer_TBLGEN_TABLES)
   2238 +
   2239 +TBLGEN_TD_DIR := $(LOCAL_PATH)/..
   2240 +
   2241 +LOCAL_SRC_FILES := $(arm_asm_printer_SRC_FILES)
   2242 +
   2243 +LOCAL_C_INCLUDES+= \
   2244 +    $(LOCAL_PATH)/..
   2245 +
   2246 +LOCAL_MODULE:= libLLVMARMAsmPrinter
   2247 +
   2248 +LOCAL_MODULE_TAGS := optional
   2249 +
   2250 +include $(LLVM_DEVICE_BUILD_MK)
   2251 +include $(LLVM_TBLGEN_RULES_MK)
   2252 +include $(BUILD_STATIC_LIBRARY)
   2253 +endif
   2254 +
   2255 diff --git a/lib/Target/ARM/MCTargetDesc/Android.mk b/lib/Target/ARM/MCTargetDesc/Android.mk
   2256 new file mode 100644
   2257 index 0000000..074d29e
   2258 --- /dev/null
   2259 +++ b/lib/Target/ARM/MCTargetDesc/Android.mk
   2260 @@ -0,0 +1,61 @@
   2261 +LOCAL_PATH := $(call my-dir)
   2262 +
   2263 +arm_mc_desc_TBLGEN_TABLES := \
   2264 +  ARMGenRegisterInfo.inc \
   2265 +  ARMGenInstrInfo.inc \
   2266 +  ARMGenMCCodeEmitter.inc \
   2267 +  ARMGenSubtargetInfo.inc
   2268 +
   2269 +arm_mc_desc_SRC_FILES := \
   2270 +  ARMAsmBackend.cpp \
   2271 +  ARMELFObjectWriter.cpp \
   2272 +  ARMELFStreamer.cpp \
   2273 +  ARMMCAsmInfo.cpp \
   2274 +  ARMMCCodeEmitter.cpp \
   2275 +  ARMMCExpr.cpp \
   2276 +  ARMMCTargetDesc.cpp \
   2277 +  ARMMachObjectWriter.cpp \
   2278 +  ARMMachORelocationInfo.cpp \
   2279 +  ARMTargetStreamer.cpp \
   2280 +  ARMUnwindOpAsm.cpp
   2281 +
   2282 +# For the host
   2283 +# =====================================================
   2284 +include $(CLEAR_VARS)
   2285 +include $(CLEAR_TBLGEN_VARS)
   2286 +
   2287 +
   2288 +LOCAL_MODULE:= libLLVMARMDesc
   2289 +LOCAL_MODULE_TAGS := optional
   2290 +
   2291 +LOCAL_SRC_FILES := $(arm_mc_desc_SRC_FILES)
   2292 +LOCAL_C_INCLUDES := $(LOCAL_PATH)/..
   2293 +
   2294 +TBLGEN_TD_DIR := $(LOCAL_PATH)/..
   2295 +TBLGEN_TABLES := $(arm_mc_desc_TBLGEN_TABLES)
   2296 +
   2297 +include $(LLVM_HOST_BUILD_MK)
   2298 +include $(LLVM_TBLGEN_RULES_MK)
   2299 +include $(LLVM_GEN_INTRINSICS_MK)
   2300 +include $(BUILD_HOST_STATIC_LIBRARY)
   2301 +
   2302 +# For the device only
   2303 +# =====================================================
   2304 +ifneq (true,$(DISABLE_LLVM_DEVICE_BUILDS))
   2305 +include $(CLEAR_VARS)
   2306 +include $(CLEAR_TBLGEN_VARS)
   2307 +
   2308 +LOCAL_MODULE:= libLLVMARMDesc
   2309 +LOCAL_MODULE_TAGS := optional
   2310 +
   2311 +LOCAL_SRC_FILES := $(arm_mc_desc_SRC_FILES)
   2312 +LOCAL_C_INCLUDES := $(LOCAL_PATH)/..
   2313 +
   2314 +TBLGEN_TD_DIR := $(LOCAL_PATH)/..
   2315 +TBLGEN_TABLES := $(arm_mc_desc_TBLGEN_TABLES)
   2316 +
   2317 +include $(LLVM_DEVICE_BUILD_MK)
   2318 +include $(LLVM_TBLGEN_RULES_MK)
   2319 +include $(LLVM_GEN_INTRINSICS_MK)
   2320 +include $(BUILD_STATIC_LIBRARY)
   2321 +endif
   2322 diff --git a/lib/Target/ARM/TargetInfo/Android.mk b/lib/Target/ARM/TargetInfo/Android.mk
   2323 new file mode 100644
   2324 index 0000000..e31c2b8
   2325 --- /dev/null
   2326 +++ b/lib/Target/ARM/TargetInfo/Android.mk
   2327 @@ -0,0 +1,55 @@
   2328 +LOCAL_PATH := $(call my-dir)
   2329 +
   2330 +arm_target_info_TBLGEN_TABLES := \
   2331 +  ARMGenSubtargetInfo.inc \
   2332 +  ARMGenRegisterInfo.inc \
   2333 +  ARMGenInstrInfo.inc
   2334 +
   2335 +arm_target_info_SRC_FILES := \
   2336 +  ARMTargetInfo.cpp
   2337 +
   2338 +# For the host
   2339 +# =====================================================
   2340 +include $(CLEAR_VARS)
   2341 +include $(CLEAR_TBLGEN_VARS)
   2342 +
   2343 +TBLGEN_TABLES := $(arm_target_info_TBLGEN_TABLES)
   2344 +
   2345 +TBLGEN_TD_DIR := $(LOCAL_PATH)/..
   2346 +
   2347 +LOCAL_SRC_FILES := $(arm_target_info_SRC_FILES)
   2348 +
   2349 +LOCAL_C_INCLUDES +=	\
   2350 +	$(LOCAL_PATH)/..
   2351 +
   2352 +LOCAL_MODULE:= libLLVMARMInfo
   2353 +
   2354 +LOCAL_MODULE_TAGS := optional
   2355 +
   2356 +include $(LLVM_HOST_BUILD_MK)
   2357 +include $(LLVM_TBLGEN_RULES_MK)
   2358 +include $(BUILD_HOST_STATIC_LIBRARY)
   2359 +
   2360 +# For the device
   2361 +# =====================================================
   2362 +ifneq (true,$(DISABLE_LLVM_DEVICE_BUILDS))
   2363 +include $(CLEAR_VARS)
   2364 +include $(CLEAR_TBLGEN_VARS)
   2365 +
   2366 +TBLGEN_TABLES := $(arm_target_info_TBLGEN_TABLES)
   2367 +
   2368 +TBLGEN_TD_DIR := $(LOCAL_PATH)/..
   2369 +
   2370 +LOCAL_SRC_FILES := $(arm_target_info_SRC_FILES)
   2371 +
   2372 +LOCAL_C_INCLUDES +=	\
   2373 +	$(LOCAL_PATH)/..
   2374 +
   2375 +LOCAL_MODULE:= libLLVMARMInfo
   2376 +
   2377 +LOCAL_MODULE_TAGS := optional
   2378 +
   2379 +include $(LLVM_DEVICE_BUILD_MK)
   2380 +include $(LLVM_TBLGEN_RULES_MK)
   2381 +include $(BUILD_STATIC_LIBRARY)
   2382 +endif
   2383 diff --git a/lib/Target/Android.mk b/lib/Target/Android.mk
   2384 new file mode 100644
   2385 index 0000000..1b43ce4
   2386 --- /dev/null
   2387 +++ b/lib/Target/Android.mk
   2388 @@ -0,0 +1,39 @@
   2389 +LOCAL_PATH:= $(call my-dir)
   2390 +
   2391 +target_SRC_FILES := \
   2392 +  Target.cpp \
   2393 +  TargetIntrinsicInfo.cpp \
   2394 +  TargetJITInfo.cpp \
   2395 +  TargetLibraryInfo.cpp \
   2396 +  TargetLoweringObjectFile.cpp \
   2397 +  TargetMachineC.cpp \
   2398 +  TargetMachine.cpp \
   2399 +  TargetSubtargetInfo.cpp
   2400 +
   2401 +# For the host
   2402 +# =====================================================
   2403 +include $(CLEAR_VARS)
   2404 +
   2405 +LOCAL_SRC_FILES := $(target_SRC_FILES)
   2406 +
   2407 +LOCAL_MODULE:= libLLVMTarget
   2408 +
   2409 +LOCAL_MODULE_TAGS := optional
   2410 +
   2411 +include $(LLVM_HOST_BUILD_MK)
   2412 +include $(BUILD_HOST_STATIC_LIBRARY)
   2413 +
   2414 +# For the device
   2415 +# =====================================================
   2416 +ifneq (true,$(DISABLE_LLVM_DEVICE_BUILDS))
   2417 +include $(CLEAR_VARS)
   2418 +
   2419 +LOCAL_SRC_FILES := $(target_SRC_FILES)
   2420 +
   2421 +LOCAL_MODULE:= libLLVMTarget
   2422 +
   2423 +LOCAL_MODULE_TAGS := optional
   2424 +
   2425 +include $(LLVM_DEVICE_BUILD_MK)
   2426 +include $(BUILD_STATIC_LIBRARY)
   2427 +endif
   2428 diff --git a/lib/Target/Mips/Android.mk b/lib/Target/Mips/Android.mk
   2429 new file mode 100644
   2430 index 0000000..74b8a3b
   2431 --- /dev/null
   2432 +++ b/lib/Target/Mips/Android.mk
   2433 @@ -0,0 +1,85 @@
   2434 +LOCAL_PATH := $(call my-dir)
   2435 +
   2436 +mips_codegen_TBLGEN_TABLES := \
   2437 +  MipsGenRegisterInfo.inc \
   2438 +  MipsGenInstrInfo.inc \
   2439 +  MipsGenCodeEmitter.inc \
   2440 +  MipsGenMCCodeEmitter.inc \
   2441 +  MipsGenMCPseudoLowering.inc \
   2442 +  MipsGenAsmWriter.inc \
   2443 +  MipsGenDAGISel.inc \
   2444 +  MipsGenCallingConv.inc \
   2445 +  MipsGenSubtargetInfo.inc
   2446 +
   2447 +mips_codegen_SRC_FILES := \
   2448 +  Mips16FrameLowering.cpp \
   2449 +  Mips16HardFloat.cpp \
   2450 +  Mips16HardFloatInfo.cpp \
   2451 +  Mips16ISelDAGToDAG.cpp \
   2452 +  Mips16ISelLowering.cpp \
   2453 +  Mips16InstrInfo.cpp \
   2454 +  Mips16RegisterInfo.cpp \
   2455 +  MipsAnalyzeImmediate.cpp \
   2456 +  MipsAsmPrinter.cpp \
   2457 +  MipsCodeEmitter.cpp \
   2458 +  MipsConstantIslandPass.cpp \
   2459 +  MipsDelaySlotFiller.cpp \
   2460 +  MipsFrameLowering.cpp \
   2461 +  MipsInstrInfo.cpp \
   2462 +  MipsISelDAGToDAG.cpp \
   2463 +  MipsISelLowering.cpp \
   2464 +  MipsJITInfo.cpp \
   2465 +  MipsLongBranch.cpp \
   2466 +  MipsMachineFunction.cpp \
   2467 +  MipsMCInstLower.cpp \
   2468 +  MipsModuleISelDAGToDAG.cpp \
   2469 +  MipsOs16.cpp \
   2470 +  MipsOptimizePICCall.cpp \
   2471 +  MipsRegisterInfo.cpp \
   2472 +  MipsSEFrameLowering.cpp \
   2473 +  MipsSEISelDAGToDAG.cpp \
   2474 +  MipsSEISelLowering.cpp \
   2475 +  MipsSEInstrInfo.cpp \
   2476 +  MipsSERegisterInfo.cpp \
   2477 +  MipsSelectionDAGInfo.cpp \
   2478 +  MipsSubtarget.cpp \
   2479 +  MipsTargetMachine.cpp \
   2480 +  MipsTargetObjectFile.cpp
   2481 +
   2482 +# For the host
   2483 +# =====================================================
   2484 +include $(CLEAR_VARS)
   2485 +include $(CLEAR_TBLGEN_VARS)
   2486 +
   2487 +LOCAL_MODULE:= libLLVMMipsCodeGen
   2488 +LOCAL_MODULE_TAGS := optional
   2489 +
   2490 +LOCAL_SRC_FILES := $(mips_codegen_SRC_FILES)
   2491 +LOCAL_C_INCLUDES := $(LOCAL_PATH)/MCTargetDesc
   2492 +
   2493 +TBLGEN_TABLES := $(mips_codegen_TBLGEN_TABLES)
   2494 +
   2495 +include $(LLVM_HOST_BUILD_MK)
   2496 +include $(LLVM_TBLGEN_RULES_MK)
   2497 +include $(LLVM_GEN_INTRINSICS_MK)
   2498 +include $(BUILD_HOST_STATIC_LIBRARY)
   2499 +
   2500 +# For the device only
   2501 +# =====================================================
   2502 +ifneq (true,$(DISABLE_LLVM_DEVICE_BUILDS))
   2503 +include $(CLEAR_VARS)
   2504 +include $(CLEAR_TBLGEN_VARS)
   2505 +
   2506 +LOCAL_MODULE:= libLLVMMipsCodeGen
   2507 +LOCAL_MODULE_TAGS := optional
   2508 +
   2509 +LOCAL_SRC_FILES := $(mips_codegen_SRC_FILES)
   2510 +LOCAL_C_INCLUDES := $(LOCAL_PATH)/MCTargetDesc
   2511 +
   2512 +TBLGEN_TABLES := $(mips_codegen_TBLGEN_TABLES)
   2513 +
   2514 +include $(LLVM_DEVICE_BUILD_MK)
   2515 +include $(LLVM_TBLGEN_RULES_MK)
   2516 +include $(LLVM_GEN_INTRINSICS_MK)
   2517 +include $(BUILD_STATIC_LIBRARY)
   2518 +endif
   2519 diff --git a/lib/Target/Mips/AsmParser/Android.mk b/lib/Target/Mips/AsmParser/Android.mk
   2520 new file mode 100644
   2521 index 0000000..7d8eec1
   2522 --- /dev/null
   2523 +++ b/lib/Target/Mips/AsmParser/Android.mk
   2524 @@ -0,0 +1,56 @@
   2525 +LOCAL_PATH := $(call my-dir)
   2526 +
   2527 +#===---------------------------------------------------------------===
   2528 +# libLLVMMipsAsmParser (common)
   2529 +#===---------------------------------------------------------------===
   2530 +
   2531 +mips_asm_parser_SRC_FILES := \
   2532 +  MipsAsmParser.cpp
   2533 +
   2534 +mips_asm_parser_C_INCLUDES := $(LOCAL_PATH)/..
   2535 +
   2536 +mips_asm_parser_TBLGEN_TABLES := \
   2537 +  MipsGenAsmMatcher.inc \
   2538 +  MipsGenInstrInfo.inc \
   2539 +  MipsGenRegisterInfo.inc \
   2540 +  MipsGenSubtargetInfo.inc
   2541 +
   2542 +mips_asm_parser_TBLGEN_TD_DIR := $(LOCAL_PATH)/..
   2543 +
   2544 +
   2545 +#===---------------------------------------------------------------===
   2546 +# libLLVMMipsAsmParser (host)
   2547 +#===---------------------------------------------------------------===
   2548 +include $(CLEAR_VARS)
   2549 +include $(CLEAR_TBLGEN_VARS)
   2550 +
   2551 +LOCAL_MODULE:= libLLVMMipsAsmParser
   2552 +LOCAL_MODULE_TAGS := optional
   2553 +LOCAL_SRC_FILES := $(mips_asm_parser_SRC_FILES)
   2554 +LOCAL_C_INCLUDES += $(mips_asm_parser_C_INCLUDES)
   2555 +TBLGEN_TABLES := $(mips_asm_parser_TBLGEN_TABLES)
   2556 +TBLGEN_TD_DIR := $(LOCAL_PATH)/..
   2557 +
   2558 +include $(LLVM_HOST_BUILD_MK)
   2559 +include $(LLVM_TBLGEN_RULES_MK)
   2560 +include $(BUILD_HOST_STATIC_LIBRARY)
   2561 +
   2562 +
   2563 +#===---------------------------------------------------------------===
   2564 +# libLLVMMipsAsmParser (target)
   2565 +#===---------------------------------------------------------------===
   2566 +ifneq (true,$(DISABLE_LLVM_DEVICE_BUILDS))
   2567 +include $(CLEAR_VARS)
   2568 +include $(CLEAR_TBLGEN_VARS)
   2569 +
   2570 +LOCAL_MODULE:= libLLVMMipsAsmParser
   2571 +LOCAL_MODULE_TAGS := optional
   2572 +LOCAL_SRC_FILES := $(mips_asm_parser_SRC_FILES)
   2573 +LOCAL_C_INCLUDES += $(mips_asm_parser_C_INCLUDES)
   2574 +TBLGEN_TABLES := $(mips_asm_parser_TBLGEN_TABLES)
   2575 +TBLGEN_TD_DIR := $(LOCAL_PATH)/..
   2576 +
   2577 +include $(LLVM_DEVICE_BUILD_MK)
   2578 +include $(LLVM_TBLGEN_RULES_MK)
   2579 +include $(BUILD_STATIC_LIBRARY)
   2580 +endif
   2581 diff --git a/lib/Target/Mips/Disassembler/Android.mk b/lib/Target/Mips/Disassembler/Android.mk
   2582 new file mode 100644
   2583 index 0000000..20fd87a
   2584 --- /dev/null
   2585 +++ b/lib/Target/Mips/Disassembler/Android.mk
   2586 @@ -0,0 +1,48 @@
   2587 +LOCAL_PATH := $(call my-dir)
   2588 +
   2589 +mips_disassembler_TBLGEN_TABLES := \
   2590 +  MipsGenDisassemblerTables.inc \
   2591 +  MipsGenInstrInfo.inc \
   2592 +  MipsGenRegisterInfo.inc \
   2593 +  MipsGenSubtargetInfo.inc
   2594 +
   2595 +mips_disassembler_SRC_FILES := \
   2596 +  MipsDisassembler.cpp
   2597 +
   2598 +# For the device
   2599 +# =====================================================
   2600 +ifneq (true,$(DISABLE_LLVM_DEVICE_BUILDS))
   2601 +include $(CLEAR_VARS)
   2602 +include $(CLEAR_TBLGEN_VARS)
   2603 +
   2604 +LOCAL_MODULE:= libLLVMMipsDisassembler
   2605 +LOCAL_MODULE_TAGS := optional
   2606 +
   2607 +LOCAL_SRC_FILES := $(mips_disassembler_SRC_FILES)
   2608 +LOCAL_C_INCLUDES += $(LOCAL_PATH)/..
   2609 +
   2610 +TBLGEN_TABLES := $(mips_disassembler_TBLGEN_TABLES)
   2611 +TBLGEN_TD_DIR := $(LOCAL_PATH)/..
   2612 +
   2613 +include $(LLVM_DEVICE_BUILD_MK)
   2614 +include $(LLVM_TBLGEN_RULES_MK)
   2615 +include $(BUILD_STATIC_LIBRARY)
   2616 +endif
   2617 +
   2618 +# For the host
   2619 +# =====================================================
   2620 +include $(CLEAR_VARS)
   2621 +include $(CLEAR_TBLGEN_VARS)
   2622 +
   2623 +LOCAL_MODULE:= libLLVMMipsDisassembler
   2624 +LOCAL_MODULE_TAGS := optional
   2625 +
   2626 +LOCAL_SRC_FILES := $(mips_disassembler_SRC_FILES)
   2627 +LOCAL_C_INCLUDES += $(LOCAL_PATH)/..
   2628 +
   2629 +TBLGEN_TABLES := $(mips_disassembler_TBLGEN_TABLES)
   2630 +TBLGEN_TD_DIR := $(LOCAL_PATH)/..
   2631 +
   2632 +include $(LLVM_HOST_BUILD_MK)
   2633 +include $(LLVM_TBLGEN_RULES_MK)
   2634 +include $(BUILD_HOST_STATIC_LIBRARY)
   2635 diff --git a/lib/Target/Mips/InstPrinter/Android.mk b/lib/Target/Mips/InstPrinter/Android.mk
   2636 new file mode 100644
   2637 index 0000000..f4f3a4f
   2638 --- /dev/null
   2639 +++ b/lib/Target/Mips/InstPrinter/Android.mk
   2640 @@ -0,0 +1,48 @@
   2641 +LOCAL_PATH := $(call my-dir)
   2642 +
   2643 +mips_asm_printer_TBLGEN_TABLES := \
   2644 +  MipsGenAsmWriter.inc \
   2645 +  MipsGenRegisterInfo.inc \
   2646 +  MipsGenSubtargetInfo.inc \
   2647 +  MipsGenInstrInfo.inc
   2648 +
   2649 +mips_asm_printer_SRC_FILES := \
   2650 +  MipsInstPrinter.cpp
   2651 +
   2652 +# For the host
   2653 +# =====================================================
   2654 +include $(CLEAR_VARS)
   2655 +include $(CLEAR_TBLGEN_VARS)
   2656 +
   2657 +LOCAL_MODULE:= libLLVMMipsAsmPrinter
   2658 +LOCAL_MODULE_TAGS := optional
   2659 +
   2660 +TBLGEN_TABLES := $(mips_asm_printer_TBLGEN_TABLES)
   2661 +TBLGEN_TD_DIR := $(LOCAL_PATH)/..
   2662 +
   2663 +LOCAL_SRC_FILES := $(mips_asm_printer_SRC_FILES)
   2664 +LOCAL_C_INCLUDES += $(LOCAL_PATH)/..
   2665 +
   2666 +include $(LLVM_HOST_BUILD_MK)
   2667 +include $(LLVM_TBLGEN_RULES_MK)
   2668 +include $(BUILD_HOST_STATIC_LIBRARY)
   2669 +
   2670 +# For the device only
   2671 +# =====================================================
   2672 +ifneq (true,$(DISABLE_LLVM_DEVICE_BUILDS))
   2673 +include $(CLEAR_VARS)
   2674 +include $(CLEAR_TBLGEN_VARS)
   2675 +
   2676 +LOCAL_MODULE:= libLLVMMipsAsmPrinter
   2677 +LOCAL_MODULE_TAGS := optional
   2678 +
   2679 +TBLGEN_TABLES := $(mips_asm_printer_TBLGEN_TABLES)
   2680 +TBLGEN_TD_DIR := $(LOCAL_PATH)/..
   2681 +
   2682 +LOCAL_SRC_FILES := $(mips_asm_printer_SRC_FILES)
   2683 +LOCAL_C_INCLUDES += $(LOCAL_PATH)/..
   2684 +
   2685 +include $(LLVM_DEVICE_BUILD_MK)
   2686 +include $(LLVM_TBLGEN_RULES_MK)
   2687 +include $(BUILD_STATIC_LIBRARY)
   2688 +endif
   2689 diff --git a/lib/Target/Mips/MCTargetDesc/Android.mk b/lib/Target/Mips/MCTargetDesc/Android.mk
   2690 new file mode 100644
   2691 index 0000000..7ee11a1
   2692 --- /dev/null
   2693 +++ b/lib/Target/Mips/MCTargetDesc/Android.mk
   2694 @@ -0,0 +1,58 @@
   2695 +LOCAL_PATH := $(call my-dir)
   2696 +
   2697 +mips_mc_desc_TBLGEN_TABLES := \
   2698 +  MipsGenRegisterInfo.inc \
   2699 +  MipsGenInstrInfo.inc \
   2700 +  MipsGenMCCodeEmitter.inc \
   2701 +  MipsGenSubtargetInfo.inc
   2702 +
   2703 +mips_mc_desc_SRC_FILES := \
   2704 +  MipsAsmBackend.cpp \
   2705 +  MipsELFObjectWriter.cpp \
   2706 +  MipsELFStreamer.cpp \
   2707 +  MipsMCAsmInfo.cpp \
   2708 +  MipsMCCodeEmitter.cpp \
   2709 +  MipsMCExpr.cpp \
   2710 +  MipsMCTargetDesc.cpp \
   2711 +  MipsNaClELFStreamer.cpp \
   2712 +  MipsTargetStreamer.cpp
   2713 +
   2714 +# For the host
   2715 +# =====================================================
   2716 +include $(CLEAR_VARS)
   2717 +include $(CLEAR_TBLGEN_VARS)
   2718 +
   2719 +LOCAL_MODULE:= libLLVMMipsDesc
   2720 +LOCAL_MODULE_TAGS := optional
   2721 +
   2722 +LOCAL_SRC_FILES := $(mips_mc_desc_SRC_FILES)
   2723 +LOCAL_C_INCLUDES := $(LOCAL_PATH)/..
   2724 +
   2725 +TBLGEN_TD_DIR := $(LOCAL_PATH)/..
   2726 +TBLGEN_TABLES := $(mips_mc_desc_TBLGEN_TABLES)
   2727 +
   2728 +include $(LLVM_HOST_BUILD_MK)
   2729 +include $(LLVM_TBLGEN_RULES_MK)
   2730 +include $(LLVM_GEN_INTRINSICS_MK)
   2731 +include $(BUILD_HOST_STATIC_LIBRARY)
   2732 +
   2733 +# For the device only
   2734 +# =====================================================
   2735 +ifneq (true,$(DISABLE_LLVM_DEVICE_BUILDS))
   2736 +include $(CLEAR_VARS)
   2737 +include $(CLEAR_TBLGEN_VARS)
   2738 +
   2739 +LOCAL_MODULE:= libLLVMMipsDesc
   2740 +LOCAL_MODULE_TAGS := optional
   2741 +
   2742 +LOCAL_SRC_FILES := $(mips_mc_desc_SRC_FILES)
   2743 +LOCAL_C_INCLUDES := $(LOCAL_PATH)/..
   2744 +
   2745 +TBLGEN_TD_DIR := $(LOCAL_PATH)/..
   2746 +TBLGEN_TABLES := $(mips_mc_desc_TBLGEN_TABLES)
   2747 +
   2748 +include $(LLVM_DEVICE_BUILD_MK)
   2749 +include $(LLVM_TBLGEN_RULES_MK)
   2750 +include $(LLVM_GEN_INTRINSICS_MK)
   2751 +include $(BUILD_STATIC_LIBRARY)
   2752 +endif
   2753 diff --git a/lib/Target/Mips/TargetInfo/Android.mk b/lib/Target/Mips/TargetInfo/Android.mk
   2754 new file mode 100644
   2755 index 0000000..173d05b
   2756 --- /dev/null
   2757 +++ b/lib/Target/Mips/TargetInfo/Android.mk
   2758 @@ -0,0 +1,47 @@
   2759 +LOCAL_PATH := $(call my-dir)
   2760 +
   2761 +mips_target_info_TBLGEN_TABLES := \
   2762 +  MipsGenInstrInfo.inc \
   2763 +  MipsGenRegisterInfo.inc \
   2764 +  MipsGenSubtargetInfo.inc
   2765 +
   2766 +mips_target_info_SRC_FILES := \
   2767 +  MipsTargetInfo.cpp
   2768 +
   2769 +# For the host
   2770 +# =====================================================
   2771 +include $(CLEAR_VARS)
   2772 +include $(CLEAR_TBLGEN_VARS)
   2773 +
   2774 +LOCAL_MODULE:= libLLVMMipsInfo
   2775 +LOCAL_MODULE_TAGS := optional
   2776 +
   2777 +TBLGEN_TABLES := $(mips_target_info_TBLGEN_TABLES)
   2778 +TBLGEN_TD_DIR := $(LOCAL_PATH)/..
   2779 +
   2780 +LOCAL_SRC_FILES := $(mips_target_info_SRC_FILES)
   2781 +LOCAL_C_INCLUDES +=	$(LOCAL_PATH)/..
   2782 +
   2783 +include $(LLVM_HOST_BUILD_MK)
   2784 +include $(LLVM_TBLGEN_RULES_MK)
   2785 +include $(BUILD_HOST_STATIC_LIBRARY)
   2786 +
   2787 +# For the device
   2788 +# =====================================================
   2789 +ifneq (true,$(DISABLE_LLVM_DEVICE_BUILDS))
   2790 +include $(CLEAR_VARS)
   2791 +include $(CLEAR_TBLGEN_VARS)
   2792 +
   2793 +LOCAL_MODULE:= libLLVMMipsInfo
   2794 +LOCAL_MODULE_TAGS := optional
   2795 +
   2796 +TBLGEN_TABLES := $(mips_target_info_TBLGEN_TABLES)
   2797 +TBLGEN_TD_DIR := $(LOCAL_PATH)/..
   2798 +
   2799 +LOCAL_SRC_FILES := $(mips_target_info_SRC_FILES)
   2800 +LOCAL_C_INCLUDES +=	$(LOCAL_PATH)/..
   2801 +
   2802 +include $(LLVM_DEVICE_BUILD_MK)
   2803 +include $(LLVM_TBLGEN_RULES_MK)
   2804 +include $(BUILD_STATIC_LIBRARY)
   2805 +endif
   2806 \ No newline at end of file
   2807 diff --git a/lib/Target/X86/Android.mk b/lib/Target/X86/Android.mk
   2808 new file mode 100644
   2809 index 0000000..73031de
   2810 --- /dev/null
   2811 +++ b/lib/Target/X86/Android.mk
   2812 @@ -0,0 +1,72 @@
   2813 +LOCAL_PATH := $(call my-dir)
   2814 +
   2815 +x86_codegen_TBLGEN_TABLES := \
   2816 +  X86GenAsmWriter.inc \
   2817 +  X86GenAsmWriter1.inc \
   2818 +  X86GenRegisterInfo.inc \
   2819 +  X86GenInstrInfo.inc \
   2820 +  X86GenDAGISel.inc \
   2821 +  X86GenFastISel.inc \
   2822 +  X86GenSubtargetInfo.inc \
   2823 +  X86GenCallingConv.inc
   2824 +
   2825 +x86_codegen_SRC_FILES := \
   2826 +  X86AsmPrinter.cpp \
   2827 +  X86COFFMachineModuleInfo.cpp \
   2828 +  X86CodeEmitter.cpp \
   2829 +  X86FastISel.cpp \
   2830 +  X86FixupLEAs.cpp \
   2831 +  X86FloatingPoint.cpp \
   2832 +  X86FrameLowering.cpp \
   2833 +  X86ISelDAGToDAG.cpp \
   2834 +  X86ISelLowering.cpp \
   2835 +  X86InstrInfo.cpp \
   2836 +  X86JITInfo.cpp \
   2837 +  X86MachineFunctionInfo.cpp \
   2838 +  X86MCInstLower.cpp \
   2839 +  X86PadShortFunction.cpp \
   2840 +  X86RegisterInfo.cpp \
   2841 +  X86SelectionDAGInfo.cpp \
   2842 +  X86Subtarget.cpp \
   2843 +  X86TargetMachine.cpp \
   2844 +  X86TargetObjectFile.cpp \
   2845 +  X86TargetTransformInfo.cpp \
   2846 +  X86VZeroUpper.cpp
   2847 +
   2848 +# For the host
   2849 +# =====================================================
   2850 +include $(CLEAR_VARS)
   2851 +include $(CLEAR_TBLGEN_VARS)
   2852 +
   2853 +TBLGEN_TABLES := $(x86_codegen_TBLGEN_TABLES)
   2854 +
   2855 +LOCAL_SRC_FILES := $(x86_codegen_SRC_FILES)
   2856 +
   2857 +LOCAL_MODULE:= libLLVMX86CodeGen
   2858 +
   2859 +LOCAL_MODULE_TAGS := optional
   2860 +
   2861 +include $(LLVM_HOST_BUILD_MK)
   2862 +include $(LLVM_TBLGEN_RULES_MK)
   2863 +include $(LLVM_GEN_INTRINSICS_MK)
   2864 +include $(BUILD_HOST_STATIC_LIBRARY)
   2865 +
   2866 +# For the device only
   2867 +# =====================================================
   2868 +ifneq (true,$(DISABLE_LLVM_DEVICE_BUILDS))
   2869 +include $(CLEAR_VARS)
   2870 +include $(CLEAR_TBLGEN_VARS)
   2871 +
   2872 +TBLGEN_TABLES := $(x86_codegen_TBLGEN_TABLES)
   2873 +
   2874 +LOCAL_SRC_FILES := $(x86_codegen_SRC_FILES)
   2875 +
   2876 +LOCAL_MODULE:= libLLVMX86CodeGen
   2877 +
   2878 +LOCAL_MODULE_TAGS := optional
   2879 +
   2880 +include $(LLVM_DEVICE_BUILD_MK)
   2881 +include $(LLVM_TBLGEN_RULES_MK)
   2882 +include $(LLVM_GEN_INTRINSICS_MK)
   2883 +include $(BUILD_STATIC_LIBRARY)
   2884 +endif
   2885 diff --git a/lib/Target/X86/AsmParser/Android.mk b/lib/Target/X86/AsmParser/Android.mk
   2886 new file mode 100644
   2887 index 0000000..4235cb1
   2888 --- /dev/null
   2889 +++ b/lib/Target/X86/AsmParser/Android.mk
   2890 @@ -0,0 +1,59 @@
   2891 +LOCAL_PATH := $(call my-dir)
   2892 +
   2893 +# For the device only
   2894 +# =====================================================
   2895 +include $(CLEAR_VARS)
   2896 +include $(CLEAR_TBLGEN_VARS)
   2897 +
   2898 +x86_asm_parser_SRC_FILES :=	\
   2899 +	X86AsmInstrumentation.cpp \
   2900 +	X86AsmParser.cpp
   2901 +
   2902 +x86_asm_parser_TBLGEN_TABLES :=	\
   2903 +	X86GenAsmMatcher.inc	\
   2904 +	X86GenInstrInfo.inc	\
   2905 +	X86GenRegisterInfo.inc \
   2906 +	X86GenSubtargetInfo.inc
   2907 +
   2908 +x86_asm_parser_TBLGEN_TD_DIR := $(LOCAL_PATH)/..
   2909 +
   2910 +x86_asm_parser_C_INCLUDES +=	\
   2911 +	$(LOCAL_PATH)/..
   2912 +
   2913 +
   2914 +#===---------------------------------------------------------------===
   2915 +# libX86AsmParser (host)
   2916 +#===---------------------------------------------------------------===
   2917 +include $(CLEAR_VARS)
   2918 +include $(CLEAR_TBLGEN_VARS)
   2919 +
   2920 +LOCAL_MODULE:= libLLVMX86AsmParser
   2921 +LOCAL_MODULE_TAGS := optional
   2922 +LOCAL_SRC_FILES := $(x86_asm_parser_SRC_FILES)
   2923 +LOCAL_C_INCLUDES += $(x86_asm_parser_C_INCLUDES)
   2924 +TBLGEN_TABLES := $(x86_asm_parser_TBLGEN_TABLES)
   2925 +TBLGEN_TD_DIR := $(x86_asm_parser_TBLGEN_TD_DIR)
   2926 +
   2927 +include $(LLVM_HOST_BUILD_MK)
   2928 +include $(LLVM_TBLGEN_RULES_MK)
   2929 +include $(BUILD_HOST_STATIC_LIBRARY)
   2930 +
   2931 +
   2932 +#===---------------------------------------------------------------===
   2933 +# libX86AsmParser (target)
   2934 +#===---------------------------------------------------------------===
   2935 +ifneq (true,$(DISABLE_LLVM_DEVICE_BUILDS))
   2936 +include $(CLEAR_VARS)
   2937 +include $(CLEAR_TBLGEN_VARS)
   2938 +
   2939 +LOCAL_MODULE:= libLLVMX86AsmParser
   2940 +LOCAL_MODULE_TAGS := optional
   2941 +LOCAL_SRC_FILES := $(x86_asm_parser_SRC_FILES)
   2942 +LOCAL_C_INCLUDES += $(x86_asm_parser_C_INCLUDES)
   2943 +TBLGEN_TABLES := $(x86_asm_parser_TBLGEN_TABLES)
   2944 +TBLGEN_TD_DIR := $(x86_asm_parser_TBLGEN_TD_DIR)
   2945 +
   2946 +include $(LLVM_DEVICE_BUILD_MK)
   2947 +include $(LLVM_TBLGEN_RULES_MK)
   2948 +include $(BUILD_STATIC_LIBRARY)
   2949 +endif
   2950 diff --git a/lib/Target/X86/Disassembler/Android.mk b/lib/Target/X86/Disassembler/Android.mk
   2951 new file mode 100644
   2952 index 0000000..3984266
   2953 --- /dev/null
   2954 +++ b/lib/Target/X86/Disassembler/Android.mk
   2955 @@ -0,0 +1,56 @@
   2956 +LOCAL_PATH := $(call my-dir)
   2957 +
   2958 +x86_disassembler_TBLGEN_TABLES := \
   2959 +  X86GenDisassemblerTables.inc \
   2960 +  X86GenInstrInfo.inc \
   2961 +  X86GenRegisterInfo.inc \
   2962 +  X86GenSubtargetInfo.inc
   2963 +
   2964 +x86_disassembler_SRC_FILES := \
   2965 +  X86Disassembler.cpp \
   2966 +  X86DisassemblerDecoder.c
   2967 +
   2968 +# For the device
   2969 +# =====================================================
   2970 +ifneq (true,$(DISABLE_LLVM_DEVICE_BUILDS))
   2971 +include $(CLEAR_VARS)
   2972 +include $(CLEAR_TBLGEN_VARS)
   2973 +
   2974 +TBLGEN_TABLES := $(x86_disassembler_TBLGEN_TABLES)
   2975 +
   2976 +TBLGEN_TD_DIR := $(LOCAL_PATH)/..
   2977 +
   2978 +LOCAL_SRC_FILES := $(x86_disassembler_SRC_FILES)
   2979 +
   2980 +LOCAL_C_INCLUDES += $(LOCAL_PATH)/..
   2981 +
   2982 +LOCAL_MODULE:= libLLVMX86Disassembler
   2983 +
   2984 +LOCAL_MODULE_TAGS := optional
   2985 +
   2986 +include $(LLVM_DEVICE_BUILD_MK)
   2987 +include $(LLVM_TBLGEN_RULES_MK)
   2988 +include $(BUILD_STATIC_LIBRARY)
   2989 +endif
   2990 +
   2991 +# For the host
   2992 +# =====================================================
   2993 +include $(CLEAR_VARS)
   2994 +include $(CLEAR_TBLGEN_VARS)
   2995 +
   2996 +TBLGEN_TABLES := $(x86_disassembler_TBLGEN_TABLES)
   2997 +
   2998 +TBLGEN_TD_DIR := $(LOCAL_PATH)/..
   2999 +
   3000 +LOCAL_SRC_FILES := $(x86_disassembler_SRC_FILES)
   3001 +
   3002 +LOCAL_C_INCLUDES +=	\
   3003 +	$(LOCAL_PATH)/..
   3004 +
   3005 +LOCAL_MODULE:= libLLVMX86Disassembler
   3006 +
   3007 +LOCAL_MODULE_TAGS := optional
   3008 +
   3009 +include $(LLVM_HOST_BUILD_MK)
   3010 +include $(LLVM_TBLGEN_RULES_MK)
   3011 +include $(BUILD_HOST_STATIC_LIBRARY)
   3012 diff --git a/lib/Target/X86/InstPrinter/Android.mk b/lib/Target/X86/InstPrinter/Android.mk
   3013 new file mode 100644
   3014 index 0000000..9881beb
   3015 --- /dev/null
   3016 +++ b/lib/Target/X86/InstPrinter/Android.mk
   3017 @@ -0,0 +1,57 @@
   3018 +LOCAL_PATH := $(call my-dir)
   3019 +
   3020 +x86_instprinter_TBLGEN_TABLES := \
   3021 +  X86GenAsmWriter.inc \
   3022 +  X86GenAsmWriter1.inc \
   3023 +  X86GenInstrInfo.inc \
   3024 +  X86GenRegisterInfo.inc \
   3025 +  X86GenSubtargetInfo.inc
   3026 +
   3027 +x86_instprinter_SRC_FILES := \
   3028 +  X86ATTInstPrinter.cpp \
   3029 +  X86IntelInstPrinter.cpp \
   3030 +  X86InstComments.cpp
   3031 +
   3032 +# For the device
   3033 +# =====================================================
   3034 +ifneq (true,$(DISABLE_LLVM_DEVICE_BUILDS))
   3035 +include $(CLEAR_VARS)
   3036 +include $(CLEAR_TBLGEN_VARS)
   3037 +
   3038 +TBLGEN_TABLES := $(x86_instprinter_TBLGEN_TABLES)
   3039 +
   3040 +TBLGEN_TD_DIR := $(LOCAL_PATH)/..
   3041 +
   3042 +LOCAL_SRC_FILES := $(x86_instprinter_SRC_FILES)
   3043 +
   3044 +LOCAL_C_INCLUDES += $(LOCAL_PATH)/..
   3045 +
   3046 +LOCAL_MODULE:= libLLVMX86AsmPrinter
   3047 +
   3048 +LOCAL_MODULE_TAGS := optional
   3049 +
   3050 +include $(LLVM_DEVICE_BUILD_MK)
   3051 +include $(LLVM_TBLGEN_RULES_MK)
   3052 +include $(BUILD_STATIC_LIBRARY)
   3053 +endif
   3054 +
   3055 +# For the host
   3056 +# =====================================================
   3057 +include $(CLEAR_VARS)
   3058 +include $(CLEAR_TBLGEN_VARS)
   3059 +
   3060 +TBLGEN_TABLES := $(x86_instprinter_TBLGEN_TABLES)
   3061 +
   3062 +TBLGEN_TD_DIR := $(LOCAL_PATH)/..
   3063 +
   3064 +LOCAL_SRC_FILES := $(x86_instprinter_SRC_FILES)
   3065 +
   3066 +LOCAL_C_INCLUDES += $(LOCAL_PATH)/..
   3067 +
   3068 +LOCAL_MODULE := libLLVMX86AsmPrinter
   3069 +
   3070 +LOCAL_MODULE_TAGS := optional
   3071 +
   3072 +include $(LLVM_HOST_BUILD_MK)
   3073 +include $(LLVM_TBLGEN_RULES_MK)
   3074 +include $(BUILD_HOST_STATIC_LIBRARY)
   3075 diff --git a/lib/Target/X86/MCTargetDesc/Android.mk b/lib/Target/X86/MCTargetDesc/Android.mk
   3076 new file mode 100644
   3077 index 0000000..ee37c27
   3078 --- /dev/null
   3079 +++ b/lib/Target/X86/MCTargetDesc/Android.mk
   3080 @@ -0,0 +1,56 @@
   3081 +LOCAL_PATH := $(call my-dir)
   3082 +
   3083 +x86_mc_desc_TBLGEN_TABLES := \
   3084 +  X86GenRegisterInfo.inc \
   3085 +  X86GenInstrInfo.inc \
   3086 +  X86GenSubtargetInfo.inc
   3087 +
   3088 +x86_mc_desc_SRC_FILES := \
   3089 +  X86AsmBackend.cpp \
   3090 +  X86ELFObjectWriter.cpp \
   3091 +  X86ELFRelocationInfo.cpp \
   3092 +  X86MCTargetDesc.cpp \
   3093 +  X86MCAsmInfo.cpp \
   3094 +  X86MCCodeEmitter.cpp \
   3095 +  X86MachORelocationInfo.cpp \
   3096 +  X86MachObjectWriter.cpp \
   3097 +  X86WinCOFFObjectWriter.cpp
   3098 +
   3099 +# For the host
   3100 +# =====================================================
   3101 +include $(CLEAR_VARS)
   3102 +include $(CLEAR_TBLGEN_VARS)
   3103 +
   3104 +LOCAL_MODULE:= libLLVMX86Desc
   3105 +LOCAL_MODULE_TAGS := optional
   3106 +
   3107 +LOCAL_SRC_FILES := $(x86_mc_desc_SRC_FILES)
   3108 +LOCAL_C_INCLUDES := $(LOCAL_PATH)/..
   3109 +TBLGEN_TABLES := $(x86_mc_desc_TBLGEN_TABLES)
   3110 +TBLGEN_TD_DIR := $(LOCAL_PATH)/..
   3111 +
   3112 +include $(LLVM_HOST_BUILD_MK)
   3113 +include $(LLVM_TBLGEN_RULES_MK)
   3114 +include $(LLVM_GEN_INTRINSICS_MK)
   3115 +include $(BUILD_HOST_STATIC_LIBRARY)
   3116 +
   3117 +# For the device only
   3118 +# =====================================================
   3119 +ifneq (true,$(DISABLE_LLVM_DEVICE_BUILDS))
   3120 +include $(CLEAR_VARS)
   3121 +include $(CLEAR_TBLGEN_VARS)
   3122 +
   3123 +
   3124 +LOCAL_MODULE:= libLLVMX86Desc
   3125 +LOCAL_MODULE_TAGS := optional
   3126 +
   3127 +LOCAL_SRC_FILES := $(x86_mc_desc_SRC_FILES)
   3128 +LOCAL_C_INCLUDES := $(LOCAL_PATH)/..
   3129 +TBLGEN_TABLES := $(x86_mc_desc_TBLGEN_TABLES)
   3130 +TBLGEN_TD_DIR := $(LOCAL_PATH)/..
   3131 +
   3132 +include $(LLVM_DEVICE_BUILD_MK)
   3133 +include $(LLVM_TBLGEN_RULES_MK)
   3134 +include $(LLVM_GEN_INTRINSICS_MK)
   3135 +include $(BUILD_STATIC_LIBRARY)
   3136 +endif
   3137 diff --git a/lib/Target/X86/TargetInfo/Android.mk b/lib/Target/X86/TargetInfo/Android.mk
   3138 new file mode 100644
   3139 index 0000000..1a6c902
   3140 --- /dev/null
   3141 +++ b/lib/Target/X86/TargetInfo/Android.mk
   3142 @@ -0,0 +1,55 @@
   3143 +LOCAL_PATH := $(call my-dir)
   3144 +
   3145 +x86_target_info_TBLGEN_TABLES := \
   3146 +  X86GenRegisterInfo.inc \
   3147 +  X86GenSubtargetInfo.inc \
   3148 +  X86GenInstrInfo.inc
   3149 +
   3150 +x86_target_info_SRC_FILES := \
   3151 +  X86TargetInfo.cpp
   3152 +
   3153 +# For the host
   3154 +# =====================================================
   3155 +include $(CLEAR_VARS)
   3156 +include $(CLEAR_TBLGEN_VARS)
   3157 +
   3158 +TBLGEN_TABLES := $(x86_target_info_TBLGEN_TABLES)
   3159 +
   3160 +TBLGEN_TD_DIR := $(LOCAL_PATH)/..
   3161 +
   3162 +LOCAL_SRC_FILES := $(x86_target_info_SRC_FILES)
   3163 +
   3164 +LOCAL_C_INCLUDES +=	\
   3165 +	$(LOCAL_PATH)/..
   3166 +
   3167 +LOCAL_MODULE:= libLLVMX86Info
   3168 +
   3169 +LOCAL_MODULE_TAGS := optional
   3170 +
   3171 +include $(LLVM_HOST_BUILD_MK)
   3172 +include $(LLVM_TBLGEN_RULES_MK)
   3173 +include $(BUILD_HOST_STATIC_LIBRARY)
   3174 +
   3175 +# For the device
   3176 +# =====================================================
   3177 +ifneq (true,$(DISABLE_LLVM_DEVICE_BUILDS))
   3178 +include $(CLEAR_VARS)
   3179 +include $(CLEAR_TBLGEN_VARS)
   3180 +
   3181 +TBLGEN_TABLES := $(x86_target_info_TBLGEN_TABLES)
   3182 +
   3183 +TBLGEN_TD_DIR := $(LOCAL_PATH)/..
   3184 +
   3185 +LOCAL_SRC_FILES := $(x86_target_info_SRC_FILES)
   3186 +
   3187 +LOCAL_C_INCLUDES +=     \
   3188 +        $(LOCAL_PATH)/..
   3189 +
   3190 +LOCAL_MODULE:= libLLVMX86Info
   3191 +
   3192 +LOCAL_MODULE_TAGS := optional
   3193 +
   3194 +include $(LLVM_DEVICE_BUILD_MK)
   3195 +include $(LLVM_TBLGEN_RULES_MK)
   3196 +include $(BUILD_STATIC_LIBRARY)
   3197 +endif
   3198 diff --git a/lib/Target/X86/Utils/Android.mk b/lib/Target/X86/Utils/Android.mk
   3199 new file mode 100644
   3200 index 0000000..e0c4797
   3201 --- /dev/null
   3202 +++ b/lib/Target/X86/Utils/Android.mk
   3203 @@ -0,0 +1,36 @@
   3204 +LOCAL_PATH := $(call my-dir)
   3205 +
   3206 +x86_utils_SRC_FILES := \
   3207 +  X86ShuffleDecode.cpp
   3208 +
   3209 +# For the device
   3210 +# =====================================================
   3211 +ifneq (true,$(DISABLE_LLVM_DEVICE_BUILDS))
   3212 +include $(CLEAR_VARS)
   3213 +
   3214 +LOCAL_SRC_FILES := $(x86_utils_SRC_FILES)
   3215 +
   3216 +LOCAL_C_INCLUDES += $(LOCAL_PATH)/..
   3217 +
   3218 +LOCAL_MODULE:= libLLVMX86Utils
   3219 +
   3220 +LOCAL_MODULE_TAGS := optional
   3221 +
   3222 +include $(LLVM_DEVICE_BUILD_MK)
   3223 +include $(BUILD_STATIC_LIBRARY)
   3224 +endif
   3225 +
   3226 +# For the host
   3227 +# =====================================================
   3228 +include $(CLEAR_VARS)
   3229 +
   3230 +LOCAL_SRC_FILES := $(x86_utils_SRC_FILES)
   3231 +
   3232 +LOCAL_C_INCLUDES += $(LOCAL_PATH)/..
   3233 +
   3234 +LOCAL_MODULE:= libLLVMX86Utils
   3235 +
   3236 +LOCAL_MODULE_TAGS := optional
   3237 +
   3238 +include $(LLVM_HOST_BUILD_MK)
   3239 +include $(BUILD_HOST_STATIC_LIBRARY)
   3240 diff --git a/lib/Transforms/IPO/Android.mk b/lib/Transforms/IPO/Android.mk
   3241 new file mode 100644
   3242 index 0000000..1fe7d63
   3243 --- /dev/null
   3244 +++ b/lib/Transforms/IPO/Android.mk
   3245 @@ -0,0 +1,52 @@
   3246 +LOCAL_PATH:= $(call my-dir)
   3247 +
   3248 +transforms_ipo_SRC_FILES := \
   3249 +  ArgumentPromotion.cpp \
   3250 +  BarrierNoopPass.cpp \
   3251 +  ConstantMerge.cpp \
   3252 +  DeadArgumentElimination.cpp \
   3253 +  ExtractGV.cpp \
   3254 +  FunctionAttrs.cpp \
   3255 +  GlobalDCE.cpp \
   3256 +  GlobalOpt.cpp \
   3257 +  IPConstantPropagation.cpp \
   3258 +  IPO.cpp \
   3259 +  InlineAlways.cpp \
   3260 +  InlineSimple.cpp \
   3261 +  Inliner.cpp \
   3262 +  Internalize.cpp \
   3263 +  LoopExtractor.cpp \
   3264 +  MergeFunctions.cpp \
   3265 +  PartialInlining.cpp \
   3266 +  PassManagerBuilder.cpp \
   3267 +  PruneEH.cpp \
   3268 +  StripDeadPrototypes.cpp \
   3269 +  StripSymbols.cpp
   3270 +
   3271 +# For the host
   3272 +# =====================================================
   3273 +include $(CLEAR_VARS)
   3274 +
   3275 +LOCAL_SRC_FILES := $(transforms_ipo_SRC_FILES)
   3276 +LOCAL_MODULE:= libLLVMipo
   3277 +
   3278 +LOCAL_MODULE_TAGS := optional
   3279 +
   3280 +include $(LLVM_HOST_BUILD_MK)
   3281 +include $(LLVM_GEN_INTRINSICS_MK)
   3282 +include $(BUILD_HOST_STATIC_LIBRARY)
   3283 +
   3284 +# For the device
   3285 +# =====================================================
   3286 +ifneq (true,$(DISABLE_LLVM_DEVICE_BUILDS))
   3287 +include $(CLEAR_VARS)
   3288 +
   3289 +LOCAL_SRC_FILES := $(transforms_ipo_SRC_FILES)
   3290 +LOCAL_MODULE:= libLLVMipo
   3291 +
   3292 +LOCAL_MODULE_TAGS := optional
   3293 +
   3294 +include $(LLVM_DEVICE_BUILD_MK)
   3295 +include $(LLVM_GEN_INTRINSICS_MK)
   3296 +include $(BUILD_STATIC_LIBRARY)
   3297 +endif
   3298 diff --git a/lib/Transforms/InstCombine/Android.mk b/lib/Transforms/InstCombine/Android.mk
   3299 new file mode 100644
   3300 index 0000000..62dc7d9
   3301 --- /dev/null
   3302 +++ b/lib/Transforms/InstCombine/Android.mk
   3303 @@ -0,0 +1,44 @@
   3304 +LOCAL_PATH:= $(call my-dir)
   3305 +
   3306 +transforms_inst_combine_SRC_FILES := \
   3307 +  InstCombineAddSub.cpp \
   3308 +  InstCombineAndOrXor.cpp \
   3309 +  InstCombineCalls.cpp \
   3310 +  InstCombineCasts.cpp \
   3311 +  InstCombineCompares.cpp \
   3312 +  InstCombineLoadStoreAlloca.cpp \
   3313 +  InstCombineMulDivRem.cpp \
   3314 +  InstCombinePHI.cpp \
   3315 +  InstCombineSelect.cpp \
   3316 +  InstCombineShifts.cpp \
   3317 +  InstCombineSimplifyDemanded.cpp \
   3318 +  InstCombineVectorOps.cpp \
   3319 +  InstructionCombining.cpp
   3320 +
   3321 +# For the host
   3322 +# =====================================================
   3323 +include $(CLEAR_VARS)
   3324 +
   3325 +LOCAL_SRC_FILES := $(transforms_inst_combine_SRC_FILES)
   3326 +LOCAL_MODULE:= libLLVMInstCombine
   3327 +
   3328 +LOCAL_MODULE_TAGS := optional
   3329 +
   3330 +include $(LLVM_HOST_BUILD_MK)
   3331 +include $(LLVM_GEN_INTRINSICS_MK)
   3332 +include $(BUILD_HOST_STATIC_LIBRARY)
   3333 +
   3334 +# For the device
   3335 +# =====================================================
   3336 +ifneq (true,$(DISABLE_LLVM_DEVICE_BUILDS))
   3337 +include $(CLEAR_VARS)
   3338 +
   3339 +LOCAL_SRC_FILES := $(transforms_inst_combine_SRC_FILES)
   3340 +LOCAL_MODULE:= libLLVMInstCombine
   3341 +
   3342 +LOCAL_MODULE_TAGS := optional
   3343 +
   3344 +include $(LLVM_DEVICE_BUILD_MK)
   3345 +include $(LLVM_GEN_INTRINSICS_MK)
   3346 +include $(BUILD_STATIC_LIBRARY)
   3347 +endif
   3348 diff --git a/lib/Transforms/Instrumentation/Android.mk b/lib/Transforms/Instrumentation/Android.mk
   3349 new file mode 100644
   3350 index 0000000..f9a55c7
   3351 --- /dev/null
   3352 +++ b/lib/Transforms/Instrumentation/Android.mk
   3353 @@ -0,0 +1,37 @@
   3354 +LOCAL_PATH:= $(call my-dir)
   3355 +
   3356 +instrumentation_SRC_FILES := \
   3357 +  AddressSanitizer.cpp \
   3358 +  BoundsChecking.cpp \
   3359 +  DataFlowSanitizer.cpp \
   3360 +  DebugIR.cpp \
   3361 +  GCOVProfiling.cpp \
   3362 +  Instrumentation.cpp \
   3363 +  MemorySanitizer.cpp \
   3364 +  ThreadSanitizer.cpp
   3365 +
   3366 +# For the host
   3367 +# =====================================================
   3368 +include $(CLEAR_VARS)
   3369 +
   3370 +LOCAL_MODULE:= libLLVMInstrumentation
   3371 +LOCAL_MODULE_TAGS := optional
   3372 +LOCAL_SRC_FILES := $(instrumentation_SRC_FILES)
   3373 +
   3374 +include $(LLVM_HOST_BUILD_MK)
   3375 +include $(LLVM_GEN_INTRINSICS_MK)
   3376 +include $(BUILD_HOST_STATIC_LIBRARY)
   3377 +
   3378 +# For the target
   3379 +# =====================================================
   3380 +ifneq (true,$(DISABLE_LLVM_DEVICE_BUILDS))
   3381 +include $(CLEAR_VARS)
   3382 +
   3383 +LOCAL_MODULE:= libLLVMInstrumentation
   3384 +LOCAL_MODULE_TAGS := optional
   3385 +LOCAL_SRC_FILES := $(instrumentation_SRC_FILES)
   3386 +
   3387 +include $(LLVM_DEVICE_BUILD_MK)
   3388 +include $(LLVM_GEN_INTRINSICS_MK)
   3389 +include $(BUILD_STATIC_LIBRARY)
   3390 +endif
   3391 diff --git a/lib/Transforms/ObjCARC/Android.mk b/lib/Transforms/ObjCARC/Android.mk
   3392 new file mode 100644
   3393 index 0000000..226e9e1
   3394 --- /dev/null
   3395 +++ b/lib/Transforms/ObjCARC/Android.mk
   3396 @@ -0,0 +1,40 @@
   3397 +LOCAL_PATH:= $(call my-dir)
   3398 +
   3399 +transforms_objcarc_SRC_FILES := \
   3400 +  DependencyAnalysis.cpp \
   3401 +  ObjCARCAliasAnalysis.cpp \
   3402 +  ObjCARCAPElim.cpp \
   3403 +  ObjCARCContract.cpp \
   3404 +  ObjCARC.cpp \
   3405 +  ObjCARCExpand.cpp \
   3406 +  ObjCARCOpts.cpp \
   3407 +  ObjCARCUtil.cpp \
   3408 +  ProvenanceAnalysis.cpp
   3409 +
   3410 +# For the host
   3411 +# =====================================================
   3412 +include $(CLEAR_VARS)
   3413 +
   3414 +LOCAL_SRC_FILES := $(transforms_objcarc_SRC_FILES)
   3415 +LOCAL_MODULE:= libLLVMTransformObjCARC
   3416 +
   3417 +LOCAL_MODULE_TAGS := optional
   3418 +
   3419 +include $(LLVM_HOST_BUILD_MK)
   3420 +include $(LLVM_GEN_INTRINSICS_MK)
   3421 +include $(BUILD_HOST_STATIC_LIBRARY)
   3422 +
   3423 +# For the device
   3424 +# =====================================================
   3425 +ifneq (true,$(DISABLE_LLVM_DEVICE_BUILDS))
   3426 +include $(CLEAR_VARS)
   3427 +
   3428 +LOCAL_SRC_FILES := $(transforms_objcarc_SRC_FILES)
   3429 +LOCAL_MODULE:= libLLVMTransformObjCARC
   3430 +
   3431 +LOCAL_MODULE_TAGS := optional
   3432 +
   3433 +include $(LLVM_DEVICE_BUILD_MK)
   3434 +include $(LLVM_GEN_INTRINSICS_MK)
   3435 +include $(BUILD_STATIC_LIBRARY)
   3436 +endif
   3437 diff --git a/lib/Transforms/Scalar/Android.mk b/lib/Transforms/Scalar/Android.mk
   3438 new file mode 100644
   3439 index 0000000..3894f93
   3440 --- /dev/null
   3441 +++ b/lib/Transforms/Scalar/Android.mk
   3442 @@ -0,0 +1,73 @@
   3443 +LOCAL_PATH:= $(call my-dir)
   3444 +
   3445 +transforms_scalar_SRC_FILES := \
   3446 +  ADCE.cpp \
   3447 +  ConstantProp.cpp \
   3448 +  ConstantHoisting.cpp \
   3449 +  CorrelatedValuePropagation.cpp \
   3450 +  DCE.cpp \
   3451 +  DeadStoreElimination.cpp \
   3452 +  EarlyCSE.cpp \
   3453 +  GlobalMerge.cpp \
   3454 +  GVN.cpp \
   3455 +  IndVarSimplify.cpp \
   3456 +  JumpThreading.cpp \
   3457 +  LICM.cpp \
   3458 +  LoopDeletion.cpp \
   3459 +  LoopIdiomRecognize.cpp \
   3460 +  LoopInstSimplify.cpp \
   3461 +  LoopRerollPass.cpp \
   3462 +  LoopRotation.cpp \
   3463 +  LoopStrengthReduce.cpp \
   3464 +  LoopUnrollPass.cpp \
   3465 +  LoopUnswitch.cpp \
   3466 +  LowerAtomic.cpp \
   3467 +  MemCpyOptimizer.cpp \
   3468 +  PartiallyInlineLibCalls.cpp \
   3469 +  Reassociate.cpp \
   3470 +  Reg2Mem.cpp \
   3471 +  SCCP.cpp \
   3472 +  SROA.cpp \
   3473 +  SampleProfile.cpp \
   3474 +  Scalar.cpp \
   3475 +  Scalarizer.cpp \
   3476 +  ScalarReplAggregates.cpp \
   3477 +  SimplifyCFGPass.cpp \
   3478 +  Sink.cpp \
   3479 +  StructurizeCFG.cpp \
   3480 +  TailRecursionElimination.cpp
   3481 +
   3482 +# For the host
   3483 +# =====================================================
   3484 +include $(CLEAR_VARS)
   3485 +
   3486 +LOCAL_SRC_FILES :=	\
   3487 +	$(transforms_scalar_SRC_FILES)
   3488 +
   3489 +LOCAL_MODULE:= libLLVMScalarOpts
   3490 +
   3491 +LOCAL_MODULE_TAGS := optional
   3492 +
   3493 +include $(LLVM_HOST_BUILD_MK)
   3494 +include $(LLVM_GEN_INTRINSICS_MK)
   3495 +include $(BUILD_HOST_STATIC_LIBRARY)
   3496 +
   3497 +# For the device
   3498 +# =====================================================
   3499 +ifneq (true,$(DISABLE_LLVM_DEVICE_BUILDS))
   3500 +include $(CLEAR_VARS)
   3501 +
   3502 +LOCAL_SRC_FILES := $(transforms_scalar_SRC_FILES)
   3503 +LOCAL_MODULE:= libLLVMScalarOpts
   3504 +
   3505 +# Override the default optimization level to work around a SIGSEGV
   3506 +# on x86 target builds for SROA.cpp.
   3507 +# Bug: 8047767
   3508 +LOCAL_CFLAGS_x86 += -O1
   3509 +
   3510 +LOCAL_MODULE_TAGS := optional
   3511 +
   3512 +include $(LLVM_DEVICE_BUILD_MK)
   3513 +include $(LLVM_GEN_INTRINSICS_MK)
   3514 +include $(BUILD_STATIC_LIBRARY)
   3515 +endif
   3516 diff --git a/lib/Transforms/Utils/Android.mk b/lib/Transforms/Utils/Android.mk
   3517 new file mode 100644
   3518 index 0000000..ab4d8a8
   3519 --- /dev/null
   3520 +++ b/lib/Transforms/Utils/Android.mk
   3521 @@ -0,0 +1,66 @@
   3522 +LOCAL_PATH:= $(call my-dir)
   3523 +
   3524 +transforms_utils_SRC_FILES := \
   3525 +  AddDiscriminators.cpp \
   3526 +  ASanStackFrameLayout.cpp \
   3527 +  BasicBlockUtils.cpp \
   3528 +  BreakCriticalEdges.cpp \
   3529 +  BuildLibCalls.cpp \
   3530 +  BypassSlowDivision.cpp \
   3531 +  CloneFunction.cpp \
   3532 +  CloneModule.cpp \
   3533 +  CmpInstAnalysis.cpp \
   3534 +  CodeExtractor.cpp \
   3535 +  DemoteRegToStack.cpp \
   3536 +  GlobalStatus.cpp \
   3537 +  InlineFunction.cpp \
   3538 +  InstructionNamer.cpp \
   3539 +  LCSSA.cpp \
   3540 +  Local.cpp \
   3541 +  LoopSimplify.cpp \
   3542 +  LoopUnroll.cpp \
   3543 +  LoopUnrollRuntime.cpp \
   3544 +  LowerExpectIntrinsic.cpp \
   3545 +  LowerInvoke.cpp \
   3546 +  LowerSwitch.cpp \
   3547 +  Mem2Reg.cpp \
   3548 +  MetaRenamer.cpp \
   3549 +  ModuleUtils.cpp \
   3550 +  PromoteMemoryToRegister.cpp \
   3551 +  SSAUpdater.cpp \
   3552 +  SimplifyCFG.cpp \
   3553 +  SimplifyIndVar.cpp \
   3554 +  SimplifyInstructions.cpp \
   3555 +  SimplifyLibCalls.cpp \
   3556 +  SpecialCaseList.cpp \
   3557 +  UnifyFunctionExitNodes.cpp \
   3558 +  Utils.cpp \
   3559 +  ValueMapper.cpp
   3560 +
   3561 +# For the host
   3562 +# =====================================================
   3563 +include $(CLEAR_VARS)
   3564 +
   3565 +LOCAL_SRC_FILES := $(transforms_utils_SRC_FILES)
   3566 +LOCAL_MODULE:= libLLVMTransformUtils
   3567 +
   3568 +LOCAL_MODULE_TAGS := optional
   3569 +
   3570 +include $(LLVM_HOST_BUILD_MK)
   3571 +include $(LLVM_GEN_INTRINSICS_MK)
   3572 +include $(BUILD_HOST_STATIC_LIBRARY)
   3573 +
   3574 +# For the device
   3575 +# =====================================================
   3576 +ifneq (true,$(DISABLE_LLVM_DEVICE_BUILDS))
   3577 +include $(CLEAR_VARS)
   3578 +
   3579 +LOCAL_SRC_FILES := $(transforms_utils_SRC_FILES)
   3580 +LOCAL_MODULE:= libLLVMTransformUtils
   3581 +
   3582 +LOCAL_MODULE_TAGS := optional
   3583 +
   3584 +include $(LLVM_DEVICE_BUILD_MK)
   3585 +include $(LLVM_GEN_INTRINSICS_MK)
   3586 +include $(BUILD_STATIC_LIBRARY)
   3587 +endif
   3588 diff --git a/lib/Transforms/Vectorize/Android.mk b/lib/Transforms/Vectorize/Android.mk
   3589 new file mode 100644
   3590 index 0000000..ea090c0
   3591 --- /dev/null
   3592 +++ b/lib/Transforms/Vectorize/Android.mk
   3593 @@ -0,0 +1,35 @@
   3594 +LOCAL_PATH:= $(call my-dir)
   3595 +
   3596 +transforms_vectorize_SRC_FILES := \
   3597 +  BBVectorize.cpp \
   3598 +  LoopVectorize.cpp \
   3599 +  SLPVectorizer.cpp \
   3600 +  Vectorize.cpp
   3601 +
   3602 +# For the host
   3603 +# =====================================================
   3604 +include $(CLEAR_VARS)
   3605 +
   3606 +LOCAL_SRC_FILES := $(transforms_vectorize_SRC_FILES)
   3607 +LOCAL_MODULE:= libLLVMVectorize
   3608 +
   3609 +LOCAL_MODULE_TAGS := optional
   3610 +
   3611 +include $(LLVM_HOST_BUILD_MK)
   3612 +include $(LLVM_GEN_INTRINSICS_MK)
   3613 +include $(BUILD_HOST_STATIC_LIBRARY)
   3614 +
   3615 +# For the device
   3616 +# =====================================================
   3617 +ifneq (true,$(DISABLE_LLVM_DEVICE_BUILDS))
   3618 +include $(CLEAR_VARS)
   3619 +
   3620 +LOCAL_SRC_FILES := $(transforms_vectorize_SRC_FILES)
   3621 +LOCAL_MODULE:= libLLVMVectorize
   3622 +
   3623 +LOCAL_MODULE_TAGS := optional
   3624 +
   3625 +include $(LLVM_DEVICE_BUILD_MK)
   3626 +include $(LLVM_GEN_INTRINSICS_MK)
   3627 +include $(BUILD_STATIC_LIBRARY)
   3628 +endif
   3629 diff --git a/llvm-device-build.mk b/llvm-device-build.mk
   3630 new file mode 100644
   3631 index 0000000..7464c98
   3632 --- /dev/null
   3633 +++ b/llvm-device-build.mk
   3634 @@ -0,0 +1,79 @@
   3635 +LOCAL_MODULE_TARGET_ARCH := $(LLVM_SUPPORTED_ARCH)
   3636 +
   3637 +LOCAL_CLANG := true
   3638 +
   3639 +LOCAL_CFLAGS :=	\
   3640 +	-D_GNU_SOURCE	\
   3641 +	-D__STDC_LIMIT_MACROS	\
   3642 +	-D__STDC_CONSTANT_MACROS	\
   3643 +	-D__STDC_FORMAT_MACROS	\
   3644 +	-O2	\
   3645 +	-fomit-frame-pointer	\
   3646 +	-Wall	\
   3647 +	-W	\
   3648 +	-Wno-unused-parameter	\
   3649 +	-Wwrite-strings	\
   3650 +        -Dsprintf=sprintf \
   3651 +	$(LOCAL_CFLAGS)
   3652 +
   3653 +# The three inline options together reduce libbcc.so almost 1MB.
   3654 +# We move them from global build/core/combo/TARGET_linux-arm.mk
   3655 +# to here.
   3656 +LOCAL_CFLAGS := -DANDROID_TARGET_BUILD \
   3657 +		-finline-functions \
   3658 +		$(LOCAL_CFLAGS)
   3659 +
   3660 +ifeq ($(TARGET_BUILD_VARIANT),eng)
   3661 +LOCAL_CFLAGS := -DANDROID_ENGINEERING_BUILD \
   3662 +                $(LOCAL_CFLAGS)
   3663 +endif
   3664 +
   3665 +ifeq ($(LLVM_ENABLE_ASSERTION),true)
   3666 +LOCAL_CFLAGS :=	\
   3667 +	$(LOCAL_CFLAGS) \
   3668 +	-D_DEBUG	\
   3669 +	-UNDEBUG
   3670 +endif
   3671 +
   3672 +ifneq ($(REQUIRES_EH),1)
   3673 +LOCAL_CFLAGS +=	-fno-exceptions
   3674 +else
   3675 +# No action. The device target should not have exception enabled since bionic
   3676 +# doesn't support it
   3677 +REQUIRES_EH := 0
   3678 +endif
   3679 +
   3680 +ifneq ($(REQUIRES_RTTI),1)
   3681 +LOCAL_CPPFLAGS +=	-fno-rtti
   3682 +else
   3683 +REQUIRES_RTTI := 0
   3684 +endif
   3685 +
   3686 +LOCAL_CPPFLAGS :=	\
   3687 +	$(LOCAL_CPPFLAGS)	\
   3688 +	-Woverloaded-virtual	\
   3689 +	-Wno-sign-promo
   3690 +
   3691 +# Make sure bionic is first so we can include system headers.
   3692 +LOCAL_C_INCLUDES :=	\
   3693 +	bionic \
   3694 +	external/stlport/stlport \
   3695 +	$(LLVM_ROOT_PATH)	\
   3696 +	$(LLVM_ROOT_PATH)/include	\
   3697 +	$(LLVM_ROOT_PATH)/device/include	\
   3698 +	$(LOCAL_C_INCLUDES)
   3699 +
   3700 +###########################################################
   3701 +## Commands for running tblgen to compile a td file
   3702 +###########################################################
   3703 +define transform-device-td-to-out
   3704 +@mkdir -p $(dir $@)
   3705 +@echo "Device TableGen (gen-$(1)): $(TBLGEN_LOCAL_MODULE) <= $<"
   3706 +$(hide) $(TBLGEN) \
   3707 +	-I $(dir $<)	\
   3708 +	-I $(LLVM_ROOT_PATH)/include	\
   3709 +	-I $(LLVM_ROOT_PATH)/device/include	\
   3710 +	-I $(LLVM_ROOT_PATH)/lib/Target	\
   3711 +    -gen-$(strip $(1)) \
   3712 +    -o $@ $<
   3713 +endef
   3714 diff --git a/llvm-gen-intrinsics.mk b/llvm-gen-intrinsics.mk
   3715 new file mode 100644
   3716 index 0000000..358027b
   3717 --- /dev/null
   3718 +++ b/llvm-gen-intrinsics.mk
   3719 @@ -0,0 +1,19 @@
   3720 +# We treat Intrinsics.td as a very special target just like what lib/VMCore/Makefile does
   3721 +INTRINSICTD := $(LLVM_ROOT_PATH)/include/llvm/IR/Intrinsics.td
   3722 +INTRINSICTDS := $(wildcard $(dir $(INTRINSICTD))/Intrinsics*.td)
   3723 +
   3724 +LOCAL_SRC_FILES := $(INTRINSICTD) $(LOCAL_SRC_FILES)
   3725 +
   3726 +ifeq ($(LOCAL_MODULE_CLASS),)
   3727 +	LOCAL_MODULE_CLASS := STATIC_LIBRARIES
   3728 +endif
   3729 +
   3730 +GENFILE := $(addprefix $(call local-generated-sources-dir)/llvm/IR/,Intrinsics.gen)
   3731 +LOCAL_GENERATED_SOURCES += $(GENFILE)
   3732 +$(GENFILE): TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
   3733 +$(GENFILE): $(INTRINSICTD) $(INTRINSICTDS) | $(TBLGEN)
   3734 +ifeq ($(LOCAL_IS_HOST_MODULE),true)
   3735 +	$(call transform-host-td-to-out,intrinsic)
   3736 +else
   3737 +	$(call transform-device-td-to-out,intrinsic)
   3738 +endif
   3739 diff --git a/llvm-host-build.mk b/llvm-host-build.mk
   3740 new file mode 100644
   3741 index 0000000..7e96615
   3742 --- /dev/null
   3743 +++ b/llvm-host-build.mk
   3744 @@ -0,0 +1,64 @@
   3745 +LOCAL_CLANG := true
   3746 +
   3747 +LOCAL_CFLAGS +=	\
   3748 +	-D_GNU_SOURCE	\
   3749 +	-D__STDC_LIMIT_MACROS	\
   3750 +	-O2	\
   3751 +	-fomit-frame-pointer	\
   3752 +	-Wall	\
   3753 +	-W	\
   3754 +	-Wno-unused-parameter	\
   3755 +	-Wwrite-strings	\
   3756 +        -Dsprintf=sprintf \
   3757 +	$(LOCAL_CFLAGS)
   3758 +
   3759 +ifeq ($(LLVM_ENABLE_ASSERTION),true)
   3760 +LOCAL_CFLAGS :=	\
   3761 +	$(LOCAL_CFLAGS) \
   3762 +	-D_DEBUG	\
   3763 +	-UNDEBUG
   3764 +endif
   3765 +
   3766 +ifneq ($(REQUIRES_EH),1)
   3767 +LOCAL_CFLAGS += -fno-exceptions
   3768 +else
   3769 +REQUIRES_EH := 0
   3770 +LOCAL_CFLAGS += -fexceptions
   3771 +endif
   3772 +
   3773 +ifneq ($(REQUIRES_RTTI),1)
   3774 +LOCAL_CPPFLAGS += -fno-rtti
   3775 +else
   3776 +REQUIRES_RTTI := 0
   3777 +endif
   3778 +
   3779 +LOCAL_CPPFLAGS :=	\
   3780 +	$(LOCAL_CPPFLAGS)	\
   3781 +	-Woverloaded-virtual	\
   3782 +	-Wno-sign-promo         \
   3783 +	-std=c++11
   3784 +
   3785 +# Make sure bionic is first so we can include system headers.
   3786 +LOCAL_C_INCLUDES :=	\
   3787 +	$(LLVM_ROOT_PATH)	\
   3788 +	$(LLVM_ROOT_PATH)/include	\
   3789 +	$(LLVM_ROOT_PATH)/host/include	\
   3790 +	$(LOCAL_C_INCLUDES)
   3791 +
   3792 +LOCAL_IS_HOST_MODULE := true
   3793 +
   3794 +###########################################################
   3795 +## Commands for running tblgen to compile a td file
   3796 +###########################################################
   3797 +define transform-host-td-to-out
   3798 +@mkdir -p $(dir $@)
   3799 +@echo "Host TableGen: $(TBLGEN_LOCAL_MODULE) (gen-$(1)) <= $<"
   3800 +$(hide) $(TBLGEN) \
   3801 +	-I $(dir $<)	\
   3802 +	-I $(LLVM_ROOT_PATH)/include	\
   3803 +	-I $(LLVM_ROOT_PATH)/host/include	\
   3804 +	-I $(LLVM_ROOT_PATH)/lib/Target	\
   3805 +	$(if $(strip $(CLANG_ROOT_PATH)),-I $(CLANG_ROOT_PATH)/include,)	\
   3806 +	-gen-$(strip $(1))	\
   3807 +	-o $@ $<
   3808 +endef
   3809 diff --git a/llvm-tblgen-rules.mk b/llvm-tblgen-rules.mk
   3810 new file mode 100644
   3811 index 0000000..0746e8b
   3812 --- /dev/null
   3813 +++ b/llvm-tblgen-rules.mk
   3814 @@ -0,0 +1,208 @@
   3815 +###########################################################
   3816 +## Commands for running tblgen to compile a td file
   3817 +##########################################################
   3818 +define transform-td-to-out
   3819 +$(if $(LOCAL_IS_HOST_MODULE),	\
   3820 +	$(call transform-host-td-to-out,$(1)),	\
   3821 +	$(call transform-device-td-to-out,$(1)))
   3822 +endef
   3823 +
   3824 +###########################################################
   3825 +## TableGen: Compile .td files to .inc.
   3826 +###########################################################
   3827 +
   3828 +# Set LOCAL_MODULE_CLASS to STATIC_LIBRARIES default (require
   3829 +# for macro local-generated-sources-dir)
   3830 +ifeq ($(LOCAL_MODULE_CLASS),)
   3831 +	LOCAL_MODULE_CLASS := STATIC_LIBRARIES
   3832 +endif
   3833 +
   3834 +ifneq ($(strip $(TBLGEN_TABLES)),)
   3835 +
   3836 +generated_sources := $(call local-generated-sources-dir)
   3837 +tblgen_gen_tables := $(addprefix $(generated_sources)/,$(TBLGEN_TABLES))
   3838 +LOCAL_GENERATED_SOURCES += $(tblgen_gen_tables)
   3839 +
   3840 +tblgen_source_dir := $(LOCAL_PATH)
   3841 +ifneq ($(TBLGEN_TD_DIR),)
   3842 +tblgen_source_dir := $(TBLGEN_TD_DIR)
   3843 +endif
   3844 +
   3845 +ifneq (,$(filter $(tblgen_source_dir),MCTargetDesc))
   3846 +tblgen_td_deps := $(tblgen_source_dir)/../*.td
   3847 +else
   3848 +tblgen_td_deps := $(tblgen_source_dir)/*.td
   3849 +endif
   3850 +tblgen_td_deps := $(wildcard $(tblgen_td_deps))
   3851 +
   3852 +#
   3853 +# The directory and the .td directory is not the same.
   3854 +#
   3855 +ifeq ($(tblgen_source_dir),$(LLVM_ROOT_PATH)/lib/Target/ARM/MCTargetDesc)
   3856 +$(generated_sources)/%GenRegisterInfo.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
   3857 +$(generated_sources)/%GenRegisterInfo.inc: $(tblgen_source_dir)/../%.td \
   3858 +                                       $(tblgen_td_deps) | $(TBLGEN)
   3859 +	$(call transform-td-to-out, register-info)
   3860 +
   3861 +$(generated_sources)/%GenInstrInfo.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
   3862 +$(generated_sources)/%GenInstrInfo.inc: $(tblgen_source_dir)/../%.td \
   3863 +                                    $(tblgen_td_deps) | $(TBLGEN)
   3864 +	$(call transform-td-to-out,instr-info)
   3865 +
   3866 +$(generated_sources)/%GenSubtargetInfo.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
   3867 +$(generated_sources)/%GenSubtargetInfo.inc: $(tblgen_source_dir)/../%.td \
   3868 +                                        $(tblgen_td_deps) | $(TBLGEN)
   3869 +	$(call transform-td-to-out,subtarget)
   3870 +endif
   3871 +
   3872 +ifeq ($(tblgen_source_dir),$(LLVM_ROOT_PATH)/lib/Target/X86/MCTargetDesc)
   3873 +$(generated_sources)/%GenRegisterInfo.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
   3874 +$(generated_sources)/%GenRegisterInfo.inc: $(tblgen_source_dir)/../%.td \
   3875 +                                       $(tblgen_td_deps) | $(TBLGEN)
   3876 +	$(call transform-td-to-out, register-info)
   3877 +
   3878 +$(generated_sources)/%GenInstrInfo.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
   3879 +$(generated_sources)/%GenInstrInfo.inc: $(tblgen_source_dir)/../%.td \
   3880 +                                    $(tblgen_td_deps) | $(TBLGEN)
   3881 +	$(call transform-td-to-out,instr-info)
   3882 +
   3883 +$(generated_sources)/%GenSubtargetInfo.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
   3884 +$(generated_sources)/%GenSubtargetInfo.inc: $(tblgen_source_dir)/../%.td \
   3885 +                                        $(tblgen_td_deps) | $(TBLGEN)
   3886 +	$(call transform-td-to-out,subtarget)
   3887 +endif
   3888 +
   3889 +ifeq ($(tblgen_source_dir),$(LLVM_ROOT_PATH)/lib/Target/Mips/MCTargetDesc)
   3890 +$(generated_sources)/%GenRegisterInfo.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
   3891 +$(generated_sources)/%GenRegisterInfo.inc: $(tblgen_source_dir)/../%.td \
   3892 +                                       $(tblgen_td_deps) | $(TBLGEN)
   3893 +	$(call transform-td-to-out, register-info)
   3894 +
   3895 +$(generated_sources)/%GenInstrInfo.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
   3896 +$(generated_sources)/%GenInstrInfo.inc: $(tblgen_source_dir)/../%.td \
   3897 +                                    $(tblgen_td_deps) | $(TBLGEN)
   3898 +	$(call transform-td-to-out,instr-info)
   3899 +
   3900 +$(generated_sources)/%GenSubtargetInfo.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
   3901 +$(generated_sources)/%GenSubtargetInfo.inc: $(tblgen_source_dir)/../%.td \
   3902 +                                        $(tblgen_td_deps) | $(TBLGEN)
   3903 +	$(call transform-td-to-out,subtarget)
   3904 +endif
   3905 +
   3906 +
   3907 +ifneq ($(filter %GenRegisterInfo.inc,$(tblgen_gen_tables)),)
   3908 +$(generated_sources)/%GenRegisterInfo.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
   3909 +$(generated_sources)/%GenRegisterInfo.inc: $(tblgen_source_dir)/%.td \
   3910 +                                       $(tblgen_td_deps) | $(TBLGEN)
   3911 +	$(call transform-td-to-out,register-info)
   3912 +endif
   3913 +
   3914 +ifneq ($(filter %GenInstrInfo.inc,$(tblgen_gen_tables)),)
   3915 +$(generated_sources)/%GenInstrInfo.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
   3916 +$(generated_sources)/%GenInstrInfo.inc: $(tblgen_source_dir)/%.td \
   3917 +                                    $(tblgen_td_deps) | $(TBLGEN)
   3918 +	$(call transform-td-to-out,instr-info)
   3919 +endif
   3920 +
   3921 +ifneq ($(filter %GenAsmWriter.inc,$(tblgen_gen_tables)),)
   3922 +$(generated_sources)/%GenAsmWriter.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
   3923 +$(generated_sources)/%GenAsmWriter.inc: $(tblgen_source_dir)/%.td \
   3924 +                                    $(tblgen_td_deps) | $(TBLGEN)
   3925 +	$(call transform-td-to-out,asm-writer)
   3926 +endif
   3927 +
   3928 +ifneq ($(filter %GenAsmWriter1.inc,$(tblgen_gen_tables)),)
   3929 +$(generated_sources)/%GenAsmWriter1.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
   3930 +$(generated_sources)/%GenAsmWriter1.inc: $(tblgen_source_dir)/%.td \
   3931 +                                     $(tblgen_td_deps) | $(TBLGEN)
   3932 +	$(call transform-td-to-out,asm-writer -asmwriternum=1)
   3933 +endif
   3934 +
   3935 +ifneq ($(filter %GenAsmMatcher.inc,$(tblgen_gen_tables)),)
   3936 +$(generated_sources)/%GenAsmMatcher.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
   3937 +$(generated_sources)/%GenAsmMatcher.inc: $(tblgen_source_dir)/%.td \
   3938 +                                     $(tblgen_td_deps) | $(TBLGEN)
   3939 +	$(call transform-td-to-out,asm-matcher)
   3940 +endif
   3941 +
   3942 +ifneq ($(filter %GenCodeEmitter.inc,$(tblgen_gen_tables)),)
   3943 +$(generated_sources)/%GenCodeEmitter.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
   3944 +$(generated_sources)/%GenCodeEmitter.inc: $(tblgen_source_dir)/%.td \
   3945 +                                      $(tblgen_td_deps) | $(TBLGEN)
   3946 +	$(call transform-td-to-out,emitter)
   3947 +endif
   3948 +
   3949 +ifneq ($(filter %GenMCCodeEmitter.inc,$(tblgen_gen_tables)),)
   3950 +$(generated_sources)/%GenMCCodeEmitter.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
   3951 +$(generated_sources)/%GenMCCodeEmitter.inc: $(tblgen_source_dir)/%.td \
   3952 +                                        $(tblgen_td_deps) | $(TBLGEN)
   3953 +	$(call transform-td-to-out,emitter -mc-emitter)
   3954 +endif
   3955 +
   3956 +ifneq ($(filter %GenMCPseudoLowering.inc,$(tblgen_gen_tables)),)
   3957 +$(generated_sources)/%GenMCPseudoLowering.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
   3958 +$(generated_sources)/%GenMCPseudoLowering.inc: $(tblgen_source_dir)/%.td \
   3959 +                                           $(tblgen_td_deps) | $(TBLGEN)
   3960 +	$(call transform-td-to-out,pseudo-lowering)
   3961 +endif
   3962 +
   3963 +ifneq ($(filter %GenDAGISel.inc,$(tblgen_gen_tables)),)
   3964 +$(generated_sources)/%GenDAGISel.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
   3965 +$(generated_sources)/%GenDAGISel.inc: $(tblgen_source_dir)/%.td \
   3966 +                                  $(tblgen_td_deps) | $(TBLGEN)
   3967 +	$(call transform-td-to-out,dag-isel)
   3968 +endif
   3969 +
   3970 +ifneq ($(filter %GenDisassemblerTables.inc,$(tblgen_gen_tables)),)
   3971 +$(generated_sources)/%GenDisassemblerTables.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
   3972 +$(generated_sources)/%GenDisassemblerTables.inc: $(tblgen_source_dir)/%.td \
   3973 +                                             $(tblgen_td_deps) | $(TBLGEN)
   3974 +	$(call transform-td-to-out,disassembler)
   3975 +endif
   3976 +
   3977 +ifneq ($(filter %GenEDInfo.inc,$(tblgen_gen_tables)),)
   3978 +$(generated_sources)/%GenEDInfo.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
   3979 +$(generated_sources)/%GenEDInfo.inc: $(tblgen_source_dir)/%.td \
   3980 +                                 $(tblgen_td_deps) | $(TBLGEN)
   3981 +	$(call transform-td-to-out,enhanced-disassembly-info)
   3982 +endif
   3983 +
   3984 +ifneq ($(filter %GenFastISel.inc,$(tblgen_gen_tables)),)
   3985 +$(generated_sources)/%GenFastISel.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
   3986 +$(generated_sources)/%GenFastISel.inc: $(tblgen_source_dir)/%.td \
   3987 +                                   $(tblgen_td_deps) | $(TBLGEN)
   3988 +	$(call transform-td-to-out,fast-isel)
   3989 +endif
   3990 +
   3991 +ifneq ($(filter %GenSubtargetInfo.inc,$(tblgen_gen_tables)),)
   3992 +$(generated_sources)/%GenSubtargetInfo.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
   3993 +$(generated_sources)/%GenSubtargetInfo.inc: $(tblgen_source_dir)/%.td \
   3994 +                                        $(tblgen_td_deps) | $(TBLGEN)
   3995 +	$(call transform-td-to-out,subtarget)
   3996 +endif
   3997 +
   3998 +ifneq ($(filter %GenCallingConv.inc,$(tblgen_gen_tables)),)
   3999 +$(generated_sources)/%GenCallingConv.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
   4000 +$(generated_sources)/%GenCallingConv.inc: $(tblgen_source_dir)/%.td \
   4001 +                                      $(tblgen_td_deps) | $(TBLGEN)
   4002 +	$(call transform-td-to-out,callingconv)
   4003 +endif
   4004 +
   4005 +ifneq ($(filter %GenIntrinsics.inc,$(tblgen_gen_tables)),)
   4006 +$(generated_sources)/%GenIntrinsics.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
   4007 +$(generated_sources)/%GenIntrinsics.inc: $(tblgen_source_dir)/%.td \
   4008 +                                     $(tblgen_td_deps) | $(TBLGEN)
   4009 +	$(call transform-td-to-out,tgt_intrinsics)
   4010 +endif
   4011 +
   4012 +ifneq ($(findstring ARMGenDecoderTables.inc,$(tblgen_gen_tables)),)
   4013 +$(generated_sources)/ARMGenDecoderTables.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
   4014 +$(generated_sources)/ARMGenDecoderTables.inc: $(tblgen_source_dir)/ARM.td \
   4015 +                                          $(tblgen_td_deps) | $(TBLGEN)
   4016 +	$(call transform-td-to-out,arm-decoder)
   4017 +endif
   4018 +
   4019 +# Reset local variables
   4020 +tblgen_td_deps :=
   4021 +
   4022 +endif
   4023 diff --git a/llvm.mk b/llvm.mk
   4024 new file mode 100644
   4025 index 0000000..073ceb7
   4026 --- /dev/null
   4027 +++ b/llvm.mk
   4028 @@ -0,0 +1,11 @@
   4029 +ifeq ($(LLVM_ROOT_PATH),)
   4030 +$(error Must set variable LLVM_ROOT_PATH before including this! $(LOCAL_PATH))
   4031 +endif
   4032 +
   4033 +CLEAR_TBLGEN_VARS := $(LLVM_ROOT_PATH)/clear_tblgen_vars.mk
   4034 +LLVM_HOST_BUILD_MK := $(LLVM_ROOT_PATH)/llvm-host-build.mk
   4035 +LLVM_DEVICE_BUILD_MK := $(LLVM_ROOT_PATH)/llvm-device-build.mk
   4036 +LLVM_GEN_INTRINSICS_MK := $(LLVM_ROOT_PATH)/llvm-gen-intrinsics.mk
   4037 +LLVM_TBLGEN_RULES_MK := $(LLVM_ROOT_PATH)/llvm-tblgen-rules.mk
   4038 +
   4039 +LLVM_SUPPORTED_ARCH := arm arm64 mips x86 x86_64
   4040 diff --git a/shared_llvm.mk b/shared_llvm.mk
   4041 new file mode 100644
   4042 index 0000000..f4be822
   4043 --- /dev/null
   4044 +++ b/shared_llvm.mk
   4045 @@ -0,0 +1,137 @@
   4046 +# Don't build the library in unbundled branches.
   4047 +ifeq (,$(TARGET_BUILD_APPS))
   4048 +
   4049 +LOCAL_PATH:= $(call my-dir)
   4050 +
   4051 +llvm_pre_static_libraries := \
   4052 +  libLLVMLinker \
   4053 +  libLLVMipo \
   4054 +  libLLVMIRReader \
   4055 +  libLLVMBitWriter \
   4056 +  libLLVMBitReader
   4057 +
   4058 +llvm_arm_static_libraries := \
   4059 +  libLLVMARMCodeGen \
   4060 +  libLLVMARMAsmParser \
   4061 +  libLLVMARMAsmPrinter \
   4062 +  libLLVMARMInfo \
   4063 +  libLLVMARMDesc \
   4064 +  libLLVMARMDisassembler
   4065 +
   4066 +llvm_x86_static_libraries := \
   4067 +  libLLVMX86CodeGen \
   4068 +  libLLVMX86Info \
   4069 +  libLLVMX86Desc \
   4070 +  libLLVMX86AsmParser \
   4071 +  libLLVMX86AsmPrinter \
   4072 +  libLLVMX86Utils \
   4073 +  libLLVMX86Disassembler
   4074 +
   4075 +llvm_mips_static_libraries := \
   4076 +  libLLVMMipsCodeGen \
   4077 +  libLLVMMipsInfo \
   4078 +  libLLVMMipsDesc \
   4079 +  libLLVMMipsAsmParser \
   4080 +  libLLVMMipsAsmPrinter \
   4081 +  libLLVMMipsDisassembler
   4082 +
   4083 +llvm_arm64_static_libraries := \
   4084 +  libLLVMARM64CodeGen \
   4085 +  libLLVMARM64Info \
   4086 +  libLLVMARM64Desc \
   4087 +  libLLVMARM64AsmParser \
   4088 +  libLLVMARM64AsmPrinter \
   4089 +  libLLVMARM64Utils \
   4090 +  libLLVMARM64Disassembler
   4091 +
   4092 +llvm_post_static_libraries := \
   4093 +  libLLVMAsmPrinter \
   4094 +  libLLVMSelectionDAG \
   4095 +  libLLVMCodeGen \
   4096 +  libLLVMObject \
   4097 +  libLLVMScalarOpts \
   4098 +  libLLVMInstCombine \
   4099 +  libLLVMInstrumentation \
   4100 +  libLLVMTransformObjCARC \
   4101 +  libLLVMTransformUtils \
   4102 +  libLLVMipa \
   4103 +  libLLVMAnalysis \
   4104 +  libLLVMTarget \
   4105 +  libLLVMMC \
   4106 +  libLLVMMCParser \
   4107 +  libLLVMCore \
   4108 +  libLLVMAsmParser \
   4109 +  libLLVMOption \
   4110 +  libLLVMSupport \
   4111 +  libLLVMVectorize
   4112 +
   4113 +llvm_host_static_libraries := \
   4114 +  libLLVMExecutionEngine \
   4115 +  libLLVMMCDisassembler \
   4116 +  libLLVMRuntimeDyld \
   4117 +  libLLVMJIT \
   4118 +  libLLVMMCJIT
   4119 +
   4120 +ifeq (true,$(FORCE_BUILD_LLVM_COMPONENTS))
   4121 +# HOST LLVM shared library build
   4122 +include $(CLEAR_VARS)
   4123 +LOCAL_IS_HOST_MODULE := true
   4124 +
   4125 +LOCAL_MODULE:= libLLVM
   4126 +
   4127 +LOCAL_MODULE_TAGS := optional
   4128 +
   4129 +# Host build pulls in all ARM, Mips, X86 components.
   4130 +LOCAL_WHOLE_STATIC_LIBRARIES := \
   4131 +  $(llvm_pre_static_libraries) \
   4132 +  $(llvm_arm_static_libraries) \
   4133 +  $(llvm_x86_static_libraries) \
   4134 +  $(llvm_mips_static_libraries) \
   4135 +  $(llvm_arm64_static_libraries) \
   4136 +  $(llvm_host_static_libraries) \
   4137 +  $(llvm_post_static_libraries)
   4138 +
   4139 +ifeq ($(HOST_OS),windows)
   4140 +  LOCAL_LDLIBS := -limagehlp -lpsapi
   4141 +else
   4142 +  LOCAL_LDLIBS := -ldl -lpthread
   4143 +endif
   4144 +
   4145 +include $(LLVM_HOST_BUILD_MK)
   4146 +include $(BUILD_HOST_SHARED_LIBRARY)
   4147 +endif
   4148 +
   4149 +ifeq (,$(filter $(TARGET_ARCH),$(LLVM_SUPPORTED_ARCH)))
   4150 +$(warning TODO $(TARGET_ARCH): Enable llvm build)
   4151 +endif
   4152 +
   4153 +ifneq (true,$(DISABLE_LLVM_DEVICE_BUILDS))
   4154 +# DEVICE LLVM shared library build
   4155 +include $(CLEAR_VARS)
   4156 +
   4157 +LOCAL_MODULE:= libLLVM
   4158 +
   4159 +LOCAL_MODULE_TAGS := optional
   4160 +
   4161 +# Device build selectively pulls in ARM, Mips, X86 components.
   4162 +LOCAL_WHOLE_STATIC_LIBRARIES := \
   4163 +  $(llvm_pre_static_libraries)
   4164 +
   4165 +LOCAL_WHOLE_STATIC_LIBRARIES_arm += $(llvm_arm_static_libraries)
   4166 +LOCAL_WHOLE_STATIC_LIBRARIES_x86 += $(llvm_x86_static_libraries)
   4167 +LOCAL_WHOLE_STATIC_LIBRARIES_x86_64 += $(llvm_x86_static_libraries)
   4168 +LOCAL_WHOLE_STATIC_LIBRARIES_mips += $(llvm_mips_static_libraries)
   4169 +LOCAL_WHOLE_STATIC_LIBRARIES_arm64 += $(llvm_arm64_static_libraries)
   4170 +
   4171 +LOCAL_WHOLE_STATIC_LIBRARIES += $(llvm_post_static_libraries)
   4172 +
   4173 +#LOCAL_LDLIBS := -ldl -lpthread
   4174 +LOCAL_SHARED_LIBRARIES := libcutils libdl libstlport
   4175 +
   4176 +include $(LLVM_DEVICE_BUILD_MK)
   4177 +include $(BUILD_SHARED_LIBRARY)
   4178 +
   4179 +endif
   4180 +
   4181 +endif # don't build in unbundled branches
   4182 +
   4183 diff --git a/tools/llc/Android.mk b/tools/llc/Android.mk
   4184 new file mode 100644
   4185 index 0000000..b9d4b74
   4186 --- /dev/null
   4187 +++ b/tools/llc/Android.mk
   4188 @@ -0,0 +1,136 @@
   4189 +LOCAL_PATH := $(call my-dir)
   4190 +
   4191 +LLVM_ROOT_PATH := $(LOCAL_PATH)/../..
   4192 +
   4193 +
   4194 +#===---------------------------------------------------------------===
   4195 +# llc command line tool (common)
   4196 +#===---------------------------------------------------------------===
   4197 +
   4198 +llvm_llc_SRC_FILES := \
   4199 +  llc.cpp
   4200 +
   4201 +llvm_llc_mips_STATIC_LIBRARIES := \
   4202 +  libLLVMMipsAsmParser \
   4203 +  libLLVMMipsInfo \
   4204 +  libLLVMMipsCodeGen \
   4205 +  libLLVMMipsDesc \
   4206 +  libLLVMMipsAsmPrinter \
   4207 +
   4208 +llvm_llc_x86_STATIC_LIBRARIES := \
   4209 +  libLLVMX86Info \
   4210 +  libLLVMX86AsmParser \
   4211 +  libLLVMX86CodeGen \
   4212 +  libLLVMX86Disassembler \
   4213 +  libLLVMX86Desc \
   4214 +  libLLVMX86AsmPrinter \
   4215 +  libLLVMX86Utils
   4216 +
   4217 +llvm_llc_arm_STATIC_LIBRARIES := \
   4218 +  libLLVMARMCodeGen \
   4219 +  libLLVMARMDisassembler \
   4220 +  libLLVMARMAsmParser \
   4221 +  libLLVMARMAsmPrinter \
   4222 +  libLLVMARMDesc \
   4223 +  libLLVMARMInfo
   4224 +
   4225 +llvm_llc_STATIC_LIBRARIES := \
   4226 +  libLLVMAsmPrinter \
   4227 +  libLLVMIRReader \
   4228 +  libLLVMAsmParser \
   4229 +  libLLVMBitReader \
   4230 +  libLLVMBitWriter \
   4231 +  libLLVMSelectionDAG \
   4232 +  libLLVMInstCombine \
   4233 +  libLLVMInstrumentation \
   4234 +  libLLVMCodeGen \
   4235 +  libLLVMObject \
   4236 +  libLLVMipo \
   4237 +  libLLVMipa \
   4238 +  libLLVMLinker \
   4239 +  libLLVMMC \
   4240 +  libLLVMMCParser \
   4241 +  libLLVMScalarOpts \
   4242 +  libLLVMTransformUtils \
   4243 +  libLLVMVectorize \
   4244 +  libLLVMAnalysis \
   4245 +  libLLVMTarget \
   4246 +  libLLVMCore \
   4247 +  libLLVMSupport
   4248 +
   4249 +llvm_llc_arm64_STATIC_LIBRARIES := \
   4250 +  libLLVMARM64Info \
   4251 +  libLLVMARM64AsmParser \
   4252 +  libLLVMARM64CodeGen \
   4253 +  libLLVMARM64Disassembler \
   4254 +  libLLVMARM64Desc \
   4255 +  libLLVMARM64AsmPrinter \
   4256 +  libLLVMARM64Utils
   4257 +
   4258 +
   4259 +
   4260 +#===---------------------------------------------------------------===
   4261 +# llc command line tool (host)
   4262 +#===---------------------------------------------------------------===
   4263 +
   4264 +include $(CLEAR_VARS)
   4265 +
   4266 +LOCAL_MODULE := llc
   4267 +LOCAL_MODULE_TAGS := optional
   4268 +LOCAL_MODULE_CLASS := EXECUTABLES
   4269 +LOCAL_IS_HOST_MODULE := true
   4270 +
   4271 +LOCAL_SRC_FILES := $(llvm_llc_SRC_FILES)
   4272 +
   4273 +LOCAL_STATIC_LIBRARIES := \
   4274 +  $(llvm_llc_arm_STATIC_LIBRARIES) \
   4275 +  $(llvm_llc_mips_STATIC_LIBRARIES) \
   4276 +  $(llvm_llc_x86_STATIC_LIBRARIES) \
   4277 +  $(llvm_llc_arm64_STATIC_LIBRARIES) \
   4278 +  $(llvm_llc_STATIC_LIBRARIES)
   4279 +
   4280 +LOCAL_LDLIBS += -lpthread -lm -ldl
   4281 +LOCAL_C_INCLUDES += external/llvm/include
   4282 +
   4283 +include $(LLVM_ROOT_PATH)/llvm.mk
   4284 +include $(LLVM_HOST_BUILD_MK)
   4285 +include $(LLVM_GEN_INTRINSICS_MK)
   4286 +include $(BUILD_HOST_EXECUTABLE)
   4287 +
   4288 +
   4289 +#===---------------------------------------------------------------===
   4290 +# llc command line tool (target)
   4291 +#===---------------------------------------------------------------===
   4292 +
   4293 +ifeq (,$(filter $(TARGET_ARCH),$(LLVM_SUPPORTED_ARCH)))
   4294 +$(warning TODO $(TARGET_ARCH): Enable llc build)
   4295 +endif
   4296 +
   4297 +ifneq (true,$(DISABLE_LLVM_DEVICE_BUILDS))
   4298 +include $(CLEAR_VARS)
   4299 +
   4300 +LOCAL_MODULE := llc
   4301 +LOCAL_MODULE_TAGS := optional
   4302 +LOCAL_MODULE_CLASS := EXECUTABLES
   4303 +
   4304 +LOCAL_SRC_FILES := $(llvm_llc_SRC_FILES)
   4305 +LOCAL_C_INCLUDES += external/llvm/include
   4306 +
   4307 +LOCAL_STATIC_LIBRARIES_arm := $(llvm_llc_arm_STATIC_LIBRARIES)
   4308 +LOCAL_STATIC_LIBRARIES_mips := $(llvm_llc_mips_STATIC_LIBRARIES)
   4309 +LOCAL_STATIC_LIBRARIES_x86 := $(llvm_llc_x86_STATIC_LIBRARIES)
   4310 +LOCAL_STATIC_LIBRARIES_x86_64 := $(llvm_llc_x86_STATIC_LIBRARIES)
   4311 +LOCAL_STATIC_LIBRARIES_arm64 := $(llvm_llc_arm64_STATIC_LIBRARIES)
   4312 +
   4313 +LOCAL_STATIC_LIBRARIES += $(llvm_llc_STATIC_LIBRARIES)
   4314 +
   4315 +LOCAL_SHARED_LIBRARIES :=  \
   4316 +  libcutils  \
   4317 +  libdl  \
   4318 +  libstlport
   4319 +
   4320 +include $(LLVM_ROOT_PATH)/llvm.mk
   4321 +include $(LLVM_DEVICE_BUILD_MK)
   4322 +include $(LLVM_GEN_INTRINSICS_MK)
   4323 +include $(BUILD_EXECUTABLE)
   4324 +endif
   4325 diff --git a/tools/llvm-as/Android.mk b/tools/llvm-as/Android.mk
   4326 new file mode 100644
   4327 index 0000000..e58868b
   4328 --- /dev/null
   4329 +++ b/tools/llvm-as/Android.mk
   4330 @@ -0,0 +1,28 @@
   4331 +LOCAL_PATH:= $(call my-dir)
   4332 +
   4333 +llvm_as_SRC_FILES := \
   4334 +  llvm-as.cpp
   4335 +
   4336 +include $(CLEAR_VARS)
   4337 +
   4338 +LOCAL_MODULE := llvm-as
   4339 +LOCAL_MODULE_TAGS := optional
   4340 +LOCAL_SRC_FILES := $(llvm_as_SRC_FILES)
   4341 +LOCAL_LDLIBS += -lm
   4342 +ifdef USE_MINGW
   4343 +LOCAL_LDLIBS += -limagehlp
   4344 +else
   4345 +LOCAL_LDLIBS += -lpthread -ldl
   4346 +endif
   4347 +
   4348 +REQUIRES_EH := 1
   4349 +REQUIRES_RTTI := 1
   4350 +
   4351 +LOCAL_STATIC_LIBRARIES := \
   4352 +  libLLVMAsmParser \
   4353 +  libLLVMBitWriter \
   4354 +  libLLVMCore \
   4355 +  libLLVMSupport
   4356 +
   4357 +include $(LLVM_HOST_BUILD_MK)
   4358 +include $(BUILD_HOST_EXECUTABLE)
   4359 diff --git a/tools/llvm-dis/Android.mk b/tools/llvm-dis/Android.mk
   4360 new file mode 100644
   4361 index 0000000..22d44fd
   4362 --- /dev/null
   4363 +++ b/tools/llvm-dis/Android.mk
   4364 @@ -0,0 +1,25 @@
   4365 +LOCAL_PATH:= $(call my-dir)
   4366 +
   4367 +llvm_dis_SRC_FILES := \
   4368 +  llvm-dis.cpp
   4369 +
   4370 +include $(CLEAR_VARS)
   4371 +
   4372 +LOCAL_MODULE := llvm-dis
   4373 +LOCAL_MODULE_CLASS := EXECUTABLES
   4374 +LOCAL_MODULE_TAGS := optional
   4375 +LOCAL_SRC_FILES := $(llvm_dis_SRC_FILES)
   4376 +LOCAL_LDLIBS += -lpthread -lm -ldl
   4377 +
   4378 +REQUIRES_EH := 1
   4379 +REQUIRES_RTTI := 1
   4380 +
   4381 +LOCAL_STATIC_LIBRARIES := \
   4382 +  libLLVMAnalysis \
   4383 +  libLLVMBitReader \
   4384 +  libLLVMCore \
   4385 +  libLLVMSupport
   4386 +
   4387 +include $(LLVM_HOST_BUILD_MK)
   4388 +include $(LLVM_GEN_INTRINSICS_MK)
   4389 +include $(BUILD_HOST_EXECUTABLE)
   4390 diff --git a/tools/llvm-link/Android.mk b/tools/llvm-link/Android.mk
   4391 new file mode 100644
   4392 index 0000000..e051492
   4393 --- /dev/null
   4394 +++ b/tools/llvm-link/Android.mk
   4395 @@ -0,0 +1,50 @@
   4396 +LOCAL_PATH:= $(call my-dir)
   4397 +
   4398 +llvm_link_SRC_FILES := \
   4399 +  llvm-link.cpp
   4400 +
   4401 +llvm_link_STATIC_LIBRARIES := \
   4402 +  libLLVMLinker \
   4403 +  libLLVMIRReader \
   4404 +  libLLVMBitReader \
   4405 +  libLLVMBitWriter \
   4406 +  libLLVMAsmParser \
   4407 +  libLLVMTransformUtils \
   4408 +  libLLVMAnalysis \
   4409 +  libLLVMTarget \
   4410 +  libLLVMCore \
   4411 +  libLLVMSupport
   4412 +
   4413 +#===---------------------------------------------------------------===
   4414 +# llvm-link command line tool (host)
   4415 +#===---------------------------------------------------------------===
   4416 +
   4417 +include $(CLEAR_VARS)
   4418 +
   4419 +LOCAL_MODULE := llvm-link
   4420 +LOCAL_MODULE_TAGS := optional
   4421 +LOCAL_SRC_FILES := $(llvm_link_SRC_FILES)
   4422 +LOCAL_STATIC_LIBRARIES := $(llvm_link_STATIC_LIBRARIES)
   4423 +LOCAL_LDLIBS += -lpthread -lm -ldl
   4424 +
   4425 +include $(LLVM_HOST_BUILD_MK)
   4426 +include $(BUILD_HOST_EXECUTABLE)
   4427 +
   4428 +#===---------------------------------------------------------------===
   4429 +# llvm-link command line tool (target)
   4430 +#===---------------------------------------------------------------===
   4431 +
   4432 +ifneq (true,$(DISABLE_LLVM_DEVICE_BUILDS))
   4433 +include $(CLEAR_VARS)
   4434 +
   4435 +LOCAL_MODULE := llvm-link
   4436 +LOCAL_MODULE_TAGS := optional
   4437 +LOCAL_SRC_FILES := $(llvm_link_SRC_FILES)
   4438 +LOCAL_STATIC_LIBRARIES := $(llvm_link_STATIC_LIBRARIES)
   4439 +LOCAL_SHARED_LIBRARIES := \
   4440 +  libcutils  \
   4441 +  libstlport
   4442 +
   4443 +include $(LLVM_DEVICE_BUILD_MK)
   4444 +include $(BUILD_EXECUTABLE)
   4445 +endif
   4446 diff --git a/tools/opt/Android.mk b/tools/opt/Android.mk
   4447 new file mode 100644
   4448 index 0000000..c5bb4f8
   4449 --- /dev/null
   4450 +++ b/tools/opt/Android.mk
   4451 @@ -0,0 +1,81 @@
   4452 +LOCAL_PATH := $(call my-dir)
   4453 +
   4454 +LLVM_ROOT_PATH := $(LOCAL_PATH)/../..
   4455 +
   4456 +
   4457 +#===---------------------------------------------------------------===
   4458 +# opt command line tool (common)
   4459 +#===---------------------------------------------------------------===
   4460 +
   4461 +llvm_opt_SRC_FILES := \
   4462 +  AnalysisWrappers.cpp \
   4463 +  GraphPrinters.cpp \
   4464 +  PrintSCC.cpp \
   4465 +  opt.cpp
   4466 +
   4467 +llvm_opt_STATIC_LIBRARIES := \
   4468 +  libLLVMScalarOpts \
   4469 +  libLLVMInstCombine \
   4470 +  libLLVMInstrumentation \
   4471 +  libLLVMMCParser \
   4472 +  libLLVMMC \
   4473 +  libLLVMAsmParser \
   4474 +  libLLVMBitWriter \
   4475 +  libLLVMBitReader \
   4476 +  libLLVMipa \
   4477 +  libLLVMipo \
   4478 +  libLLVMTransformUtils \
   4479 +  libLLVMVectorize \
   4480 +  libLLVMAnalysis \
   4481 +  libLLVMTarget \
   4482 +  libLLVMCore \
   4483 +  libLLVMSupport
   4484 +
   4485 +
   4486 +#===---------------------------------------------------------------===
   4487 +# opt command line tool (host)
   4488 +#===---------------------------------------------------------------===
   4489 +
   4490 +include $(CLEAR_VARS)
   4491 +
   4492 +LOCAL_MODULE := opt
   4493 +LOCAL_MODULE_TAGS := optional
   4494 +LOCAL_MODULE_CLASS := EXECUTABLES
   4495 +LOCAL_IS_HOST_MODULE := true
   4496 +
   4497 +LOCAL_SRC_FILES := $(llvm_opt_SRC_FILES)
   4498 +LOCAL_STATIC_LIBRARIES := $(llvm_opt_STATIC_LIBRARIES)
   4499 +LOCAL_LDLIBS += -lpthread -lm -ldl
   4500 +LOCAL_C_INCLUDES += external/llvm/include
   4501 +
   4502 +include $(LLVM_ROOT_PATH)/llvm.mk
   4503 +include $(LLVM_HOST_BUILD_MK)
   4504 +include $(LLVM_GEN_INTRINSICS_MK)
   4505 +include $(BUILD_HOST_EXECUTABLE)
   4506 +
   4507 +
   4508 +#===---------------------------------------------------------------===
   4509 +# opt command line tool (target)
   4510 +#===---------------------------------------------------------------===
   4511 +
   4512 +ifneq (true,$(DISABLE_LLVM_DEVICE_BUILDS))
   4513 +include $(CLEAR_VARS)
   4514 +
   4515 +LOCAL_MODULE := opt
   4516 +LOCAL_MODULE_TAGS := optional
   4517 +LOCAL_MODULE_CLASS := EXECUTABLES
   4518 +
   4519 +LOCAL_SRC_FILES := $(llvm_opt_SRC_FILES)
   4520 +LOCAL_C_INCLUDES += external/llvm/include
   4521 +LOCAL_STATIC_LIBRARIES := $(llvm_opt_STATIC_LIBRARIES)
   4522 +LOCAL_SHARED_LIBRARIES :=  \
   4523 +  libcutils  \
   4524 +  libdl  \
   4525 +  libstlport
   4526 +
   4527 +
   4528 +include $(LLVM_ROOT_PATH)/llvm.mk
   4529 +include $(LLVM_DEVICE_BUILD_MK)
   4530 +include $(LLVM_GEN_INTRINSICS_MK)
   4531 +include $(BUILD_EXECUTABLE)
   4532 +endif
   4533 diff --git a/utils/FileCheck/Android.mk b/utils/FileCheck/Android.mk
   4534 new file mode 100644
   4535 index 0000000..2c211cf
   4536 --- /dev/null
   4537 +++ b/utils/FileCheck/Android.mk
   4538 @@ -0,0 +1,23 @@
   4539 +LOCAL_PATH:= $(call my-dir)
   4540 +
   4541 +filecheck_SRC_FILES := \
   4542 +  FileCheck.cpp
   4543 +
   4544 +filecheck_STATIC_LIBRARIES := \
   4545 +  libLLVMSupport
   4546 +
   4547 +include $(CLEAR_VARS)
   4548 +
   4549 +LOCAL_MODULE := FileCheck
   4550 +LOCAL_SRC_FILES := $(filecheck_SRC_FILES)
   4551 +LOCAL_STATIC_LIBRARIES := $(filecheck_STATIC_LIBRARIES)
   4552 +LOCAL_C_INCLUDES += external/llvm/include
   4553 +LOCAL_C_INCLUDES += external/llvm/host/include
   4554 +LOCAL_LDLIBS += -lpthread -lm -ldl
   4555 +LOCAL_CFLAGS += -D __STDC_LIMIT_MACROS -D __STDC_CONSTANT_MACROS
   4556 +
   4557 +#REQUIRES_EH := 1
   4558 +#REQUIRES_RTTI := 1
   4559 +
   4560 +include $(LLVM_HOST_BUILD_MK)
   4561 +include $(BUILD_HOST_EXECUTABLE)
   4562 diff --git a/utils/TableGen/Android.mk b/utils/TableGen/Android.mk
   4563 new file mode 100644
   4564 index 0000000..8117672
   4565 --- /dev/null
   4566 +++ b/utils/TableGen/Android.mk
   4567 @@ -0,0 +1,58 @@
   4568 +LOCAL_PATH:= $(call my-dir)
   4569 +
   4570 +tablegen_SRC_FILES := \
   4571 +  AsmMatcherEmitter.cpp \
   4572 +  AsmWriterEmitter.cpp \
   4573 +  AsmWriterInst.cpp \
   4574 +  CallingConvEmitter.cpp \
   4575 +  CodeEmitterGen.cpp \
   4576 +  CodeGenDAGPatterns.cpp \
   4577 +  CodeGenInstruction.cpp \
   4578 +  CodeGenMapTable.cpp \
   4579 +  CodeGenRegisters.cpp \
   4580 +  CodeGenSchedule.cpp \
   4581 +  CodeGenTarget.cpp \
   4582 +  CTagsEmitter.cpp \
   4583 +  DAGISelEmitter.cpp \
   4584 +  DAGISelMatcherEmitter.cpp \
   4585 +  DAGISelMatcherGen.cpp \
   4586 +  DAGISelMatcherOpt.cpp \
   4587 +  DAGISelMatcher.cpp \
   4588 +  DFAPacketizerEmitter.cpp \
   4589 +  DisassemblerEmitter.cpp \
   4590 +  FastISelEmitter.cpp \
   4591 +  FixedLenDecoderEmitter.cpp \
   4592 +  InstrInfoEmitter.cpp \
   4593 +  IntrinsicEmitter.cpp \
   4594 +  OptParserEmitter.cpp \
   4595 +  PseudoLoweringEmitter.cpp \
   4596 +  RegisterInfoEmitter.cpp \
   4597 +  SetTheory.cpp \
   4598 +  SubtargetEmitter.cpp \
   4599 +  TableGen.cpp \
   4600 +  X86DisassemblerTables.cpp \
   4601 +  X86ModRMFilters.cpp \
   4602 +  X86RecognizableInstr.cpp
   4603 +
   4604 +include $(CLEAR_VARS)
   4605 +
   4606 +LOCAL_MODULE := tblgen
   4607 +LOCAL_MODULE_TAGS := optional
   4608 +LOCAL_SRC_FILES := $(tablegen_SRC_FILES)
   4609 +
   4610 +REQUIRES_EH := 1
   4611 +REQUIRES_RTTI := 1
   4612 +
   4613 +LOCAL_STATIC_LIBRARIES := \
   4614 +  libLLVMTableGen \
   4615 +  libLLVMSupport
   4616 +
   4617 +LOCAL_LDLIBS += -lm
   4618 +ifeq ($(HOST_OS),windows)
   4619 +  LOCAL_LDLIBS += -limagehlp -lpsapi
   4620 +else
   4621 +  LOCAL_LDLIBS += -lpthread -ldl
   4622 +endif
   4623 +
   4624 +include $(LLVM_HOST_BUILD_MK)
   4625 +include $(BUILD_HOST_EXECUTABLE)
   4626 -- 
   4627 1.9.1.423.g4596e3a
   4628 
   4629