Fix llvm.mk and the other 49 mk files
Change-Id: I5aa02363c1083297d163a575f5a35c495f950230
diff --git a/Android.mk b/Android.mk
index 78aca54..dc12eb8 100644
--- a/Android.mk
+++ b/Android.mk
@@ -1,3 +1,6 @@
+# Only use this on the device or emulator.
+ifneq ($(TARGET_ARCH),arm)
+
LOCAL_PATH := $(call my-dir)
CLANG_ROOT_PATH := $(LOCAL_PATH)
@@ -17,3 +20,5 @@
include $(LOCAL_PATH)/clang.mk
include $(subdirs)
+
+endif
diff --git a/clang-host-build.mk b/clang-host-build.mk
index d7b70bb..4b3d57c 100644
--- a/clang-host-build.mk
+++ b/clang-host-build.mk
@@ -1,3 +1,6 @@
+# Only use this on the device or emulator.
+ifneq ($(TARGET_ARCH),arm)
+
LOCAL_CFLAGS := \
-pedantic \
-Wcast-qual \
@@ -12,3 +15,5 @@
ifneq ($(LLVM_HOST_BUILD_MK),)
include $(LLVM_HOST_BUILD_MK)
endif
+
+endif
diff --git a/clang-tblgen-rules.mk b/clang-tblgen-rules.mk
index db41335..ed84997 100644
--- a/clang-tblgen-rules.mk
+++ b/clang-tblgen-rules.mk
@@ -1,3 +1,6 @@
+# Only use this on the device or emulator.
+ifneq ($(TARGET_ARCH),arm)
+
###########################################################
## TableGen: Compile .td files to .inc.
###########################################################
@@ -37,5 +40,6 @@
$(call transform-host-td-to-out,opt-parser-defs)
endif
+endif
endif
diff --git a/clang.mk b/clang.mk
index 655e88f..69305ea 100644
--- a/clang.mk
+++ b/clang.mk
@@ -1,6 +1,11 @@
+# Only use this on the device or emulator.
+ifneq ($(TARGET_ARCH),arm)
+
ifeq ($(CLANG_ROOT_PATH),)
$(error Must set variable CLANG_ROOT_PATH before including this! $(LOCAL_PATH))
endif
CLANG_HOST_BUILD_MK := $(CLANG_ROOT_PATH)/clang-host-build.mk
CLANG_TBLGEN_RULES_MK := $(CLANG_ROOT_PATH)/clang-tblgen-rules.mk
+
+endif
diff --git a/lib/AST/Android.mk b/lib/AST/Android.mk
index 68f8f3c..6ce4efc 100644
--- a/lib/AST/Android.mk
+++ b/lib/AST/Android.mk
@@ -1,3 +1,6 @@
+# Only use this on the device or emulator.
+ifneq ($(TARGET_ARCH),arm)
+
LOCAL_PATH:= $(call my-dir)
# For the host only
@@ -7,7 +10,7 @@
TBLGEN_TABLES := \
DiagnosticASTKinds.inc \
- DiagnosticCommonKinds.inc
+ DiagnosticCommonKinds.inc
clang_ast_SRC_FILES := \
APValue.cpp \
@@ -54,3 +57,5 @@
include $(CLANG_HOST_BUILD_MK)
include $(CLANG_TBLGEN_RULES_MK)
include $(BUILD_HOST_STATIC_LIBRARY)
+
+endif
diff --git a/lib/Analysis/Android.mk b/lib/Analysis/Android.mk
index c43aa61..a0e6e29 100644
--- a/lib/Analysis/Android.mk
+++ b/lib/Analysis/Android.mk
@@ -1,3 +1,6 @@
+# Only use this on the device or emulator.
+ifneq ($(TARGET_ARCH),arm)
+
LOCAL_PATH:= $(call my-dir)
# For the host only
@@ -16,7 +19,7 @@
PrintfFormatString.cpp \
ReachableCode.cpp \
UninitializedValues.cpp
-
+
LOCAL_SRC_FILES := $(clang_analysis_SRC_FILES)
@@ -25,3 +28,5 @@
include $(CLANG_HOST_BUILD_MK)
include $(CLANG_TBLGEN_RULES_MK)
include $(BUILD_HOST_STATIC_LIBRARY)
+
+endif
diff --git a/lib/Basic/Android.mk b/lib/Basic/Android.mk
index 128c258..9603e8c 100644
--- a/lib/Basic/Android.mk
+++ b/lib/Basic/Android.mk
@@ -1,3 +1,6 @@
+# Only use this on the device or emulator.
+ifneq ($(TARGET_ARCH),arm)
+
LOCAL_PATH:= $(call my-dir)
# For the host only
@@ -36,3 +39,5 @@
include $(CLANG_HOST_BUILD_MK)
include $(CLANG_TBLGEN_RULES_MK)
include $(BUILD_HOST_STATIC_LIBRARY)
+
+endif
diff --git a/lib/CodeGen/Android.mk b/lib/CodeGen/Android.mk
index c73002d..c55e789 100644
--- a/lib/CodeGen/Android.mk
+++ b/lib/CodeGen/Android.mk
@@ -1,3 +1,6 @@
+# Only use this on the device or emulator.
+ifneq ($(TARGET_ARCH),arm)
+
LOCAL_PATH:= $(call my-dir)
# For the host only
@@ -6,7 +9,7 @@
include $(CLEAR_TBLGEN_VARS)
TBLGEN_TABLES := \
- DiagnosticCommonKinds.inc
+ DiagnosticCommonKinds.inc
clang_codegen_SRC_FILES := \
CGBlocks.cpp \
@@ -48,3 +51,5 @@
include $(CLANG_TBLGEN_RULES_MK)
include $(LLVM_GEN_INTRINSICS_MK)
include $(BUILD_HOST_STATIC_LIBRARY)
+
+endif
diff --git a/lib/Index/Android.mk b/lib/Index/Android.mk
index 3c2dc66..0e786da 100644
--- a/lib/Index/Android.mk
+++ b/lib/Index/Android.mk
@@ -1,3 +1,6 @@
+# Only use this on the device or emulator.
+ifneq ($(TARGET_ARCH),arm)
+
LOCAL_PATH:= $(call my-dir)
# For the host only
@@ -6,7 +9,7 @@
include $(CLEAR_TBLGEN_VARS)
TBLGEN_TABLES := \
- DiagnosticCommonKinds.inc
+ DiagnosticCommonKinds.inc
clang_index_SRC_FILES := \
ASTLocation.cpp \
@@ -29,3 +32,5 @@
include $(CLANG_HOST_BUILD_MK)
include $(CLANG_TBLGEN_RULES_MK)
include $(BUILD_HOST_STATIC_LIBRARY)
+
+endif
diff --git a/lib/Lex/Android.mk b/lib/Lex/Android.mk
index f94d2e4..bf61b76 100644
--- a/lib/Lex/Android.mk
+++ b/lib/Lex/Android.mk
@@ -1,3 +1,6 @@
+# Only use this on the device or emulator.
+ifneq ($(TARGET_ARCH),arm)
+
LOCAL_PATH:= $(call my-dir)
# For the host only
@@ -7,7 +10,7 @@
TBLGEN_TABLES := \
DiagnosticLexKinds.inc \
- DiagnosticCommonKinds.inc
+ DiagnosticCommonKinds.inc
clang_lex_SRC_FILES := \
HeaderMap.cpp \
@@ -37,3 +40,5 @@
include $(CLANG_HOST_BUILD_MK)
include $(CLANG_TBLGEN_RULES_MK)
include $(BUILD_HOST_STATIC_LIBRARY)
+
+endif
diff --git a/lib/Parse/Android.mk b/lib/Parse/Android.mk
index 918a42c..28e96af 100644
--- a/lib/Parse/Android.mk
+++ b/lib/Parse/Android.mk
@@ -1,3 +1,6 @@
+# Only use this on the device or emulator.
+ifneq ($(TARGET_ARCH),arm)
+
LOCAL_PATH:= $(call my-dir)
# For the host only
@@ -33,3 +36,5 @@
include $(CLANG_HOST_BUILD_MK)
include $(CLANG_TBLGEN_RULES_MK)
include $(BUILD_HOST_STATIC_LIBRARY)
+
+endif
diff --git a/lib/Sema/Android.mk b/lib/Sema/Android.mk
index 60f292e..c3a516c 100644
--- a/lib/Sema/Android.mk
+++ b/lib/Sema/Android.mk
@@ -1,3 +1,6 @@
+# Only use this on the device or emulator.
+ifneq ($(TARGET_ARCH),arm)
+
LOCAL_PATH:= $(call my-dir)
# For the host only
@@ -51,3 +54,5 @@
include $(CLANG_HOST_BUILD_MK)
include $(CLANG_TBLGEN_RULES_MK)
include $(BUILD_HOST_STATIC_LIBRARY)
+
+endif