OSDN Git Service

llvm: convert makefiles to support multilib build
authorColin Cross <ccross@android.com>
Wed, 5 Feb 2014 00:26:26 +0000 (16:26 -0800)
committerColin Cross <ccross@android.com>
Fri, 7 Feb 2014 02:38:52 +0000 (18:38 -0800)
Convert makefiles to allow for building two architectures at the
same time.  This will also cause make checkbuild to build the target
libraries for all supported architectures.

Change-Id: Ia5e6fe5b1186a67753faafd3532ed4cb280a8b10

20 files changed:
lib/Target/ARM/Android.mk
lib/Target/ARM/Disassembler/Android.mk
lib/Target/ARM/MCTargetDesc/Android.mk
lib/Target/ARM/TargetInfo/Android.mk
lib/Target/Mips/Android.mk
lib/Target/Mips/Disassembler/Android.mk
lib/Target/Mips/MCTargetDesc/Android.mk
lib/Target/Mips/TargetInfo/Android.mk
lib/Target/X86/Android.mk
lib/Target/X86/Disassembler/Android.mk
lib/Target/X86/InstPrinter/Android.mk
lib/Target/X86/MCTargetDesc/Android.mk
lib/Target/X86/TargetInfo/Android.mk
lib/Transforms/Scalar/Android.mk
llvm-device-build.mk
llvm-gen-intrinsics.mk
llvm-tblgen-rules.mk
llvm.mk
shared_llvm.mk
tools/llc/Android.mk

index 25b0d89..86649b2 100644 (file)
@@ -67,7 +67,6 @@ include $(BUILD_HOST_STATIC_LIBRARY)
 
 # For the device only
 # =====================================================
-ifeq ($(TARGET_ARCH),arm)
 include $(CLEAR_VARS)
 include $(CLEAR_TBLGEN_VARS)
 
@@ -82,4 +81,3 @@ include $(LLVM_DEVICE_BUILD_MK)
 include $(LLVM_TBLGEN_RULES_MK)
 include $(LLVM_GEN_INTRINSICS_MK)
 include $(BUILD_STATIC_LIBRARY)
-endif
index 51e364b..45a5407 100644 (file)
@@ -11,7 +11,6 @@ arm_disassembler_SRC_FILES := \
 
 # For the device
 # =====================================================
-ifeq ($(TARGET_ARCH),arm)
 include $(CLEAR_VARS)
 include $(CLEAR_TBLGEN_VARS)
 
@@ -30,7 +29,6 @@ LOCAL_MODULE_TAGS := optional
 include $(LLVM_DEVICE_BUILD_MK)
 include $(LLVM_TBLGEN_RULES_MK)
 include $(BUILD_STATIC_LIBRARY)
-endif
 
 # For the host
 # =====================================================
index af22753..faa482c 100644 (file)
@@ -40,7 +40,6 @@ include $(BUILD_HOST_STATIC_LIBRARY)
 
 # For the device only
 # =====================================================
-ifeq ($(TARGET_ARCH),arm)
 include $(CLEAR_VARS)
 include $(CLEAR_TBLGEN_VARS)
 
@@ -57,4 +56,3 @@ include $(LLVM_DEVICE_BUILD_MK)
 include $(LLVM_TBLGEN_RULES_MK)
 include $(LLVM_GEN_INTRINSICS_MK)
 include $(BUILD_STATIC_LIBRARY)
-endif
index d1af6ae..de4416e 100644 (file)
@@ -32,7 +32,6 @@ include $(BUILD_HOST_STATIC_LIBRARY)
 
 # For the device
 # =====================================================
-ifeq ($(TARGET_ARCH),arm)
 include $(CLEAR_VARS)
 include $(CLEAR_TBLGEN_VARS)
 
@@ -52,4 +51,3 @@ LOCAL_MODULE_TAGS := optional
 include $(LLVM_DEVICE_BUILD_MK)
 include $(LLVM_TBLGEN_RULES_MK)
 include $(BUILD_STATIC_LIBRARY)
-endif
index 954b1d0..97c6d9b 100644 (file)
@@ -65,7 +65,6 @@ include $(BUILD_HOST_STATIC_LIBRARY)
 
 # For the device only
 # =====================================================
-ifeq ($(TARGET_ARCH),mips)
 include $(CLEAR_VARS)
 include $(CLEAR_TBLGEN_VARS)
 
@@ -81,4 +80,3 @@ include $(LLVM_DEVICE_BUILD_MK)
 include $(LLVM_TBLGEN_RULES_MK)
 include $(LLVM_GEN_INTRINSICS_MK)
 include $(BUILD_STATIC_LIBRARY)
-endif
index 4e38c4b..868b43a 100644 (file)
@@ -11,7 +11,6 @@ mips_disassembler_SRC_FILES := \
 
 # For the device
 # =====================================================
-ifeq ($(TARGET_ARCH),mips)
 include $(CLEAR_VARS)
 include $(CLEAR_TBLGEN_VARS)
 
@@ -27,7 +26,6 @@ TBLGEN_TD_DIR := $(LOCAL_PATH)/..
 include $(LLVM_DEVICE_BUILD_MK)
 include $(LLVM_TBLGEN_RULES_MK)
 include $(BUILD_STATIC_LIBRARY)
-endif
 
 # For the host
 # =====================================================
index fcf58c3..1bf2dea 100644 (file)
@@ -36,7 +36,6 @@ include $(BUILD_HOST_STATIC_LIBRARY)
 
 # For the device only
 # =====================================================
-ifeq ($(TARGET_ARCH),mips)
 include $(CLEAR_VARS)
 include $(CLEAR_TBLGEN_VARS)
 
@@ -53,4 +52,3 @@ include $(LLVM_DEVICE_BUILD_MK)
 include $(LLVM_TBLGEN_RULES_MK)
 include $(LLVM_GEN_INTRINSICS_MK)
 include $(BUILD_STATIC_LIBRARY)
-endif
index e3f41bc..8db12d3 100644 (file)
@@ -28,7 +28,6 @@ include $(BUILD_HOST_STATIC_LIBRARY)
 
 # For the device
 # =====================================================
-ifeq ($(TARGET_ARCH),mips)
 include $(CLEAR_VARS)
 include $(CLEAR_TBLGEN_VARS)
 
@@ -44,4 +43,3 @@ LOCAL_C_INCLUDES +=   $(LOCAL_PATH)/..
 include $(LLVM_DEVICE_BUILD_MK)
 include $(LLVM_TBLGEN_RULES_MK)
 include $(BUILD_STATIC_LIBRARY)
-endif
index a9c413d..c9840c3 100644 (file)
@@ -53,7 +53,6 @@ include $(BUILD_HOST_STATIC_LIBRARY)
 
 # For the device only
 # =====================================================
-ifeq ($(TARGET_ARCH),x86)
 include $(CLEAR_VARS)
 include $(CLEAR_TBLGEN_VARS)
 
@@ -69,4 +68,3 @@ include $(LLVM_DEVICE_BUILD_MK)
 include $(LLVM_TBLGEN_RULES_MK)
 include $(LLVM_GEN_INTRINSICS_MK)
 include $(BUILD_STATIC_LIBRARY)
-endif
index 1cee663..67400ad 100644 (file)
@@ -11,7 +11,6 @@ x86_disassembler_SRC_FILES := \
 
 # For the device
 # =====================================================
-ifeq ($(TARGET_ARCH),x86)
 include $(CLEAR_VARS)
 include $(CLEAR_TBLGEN_VARS)
 
@@ -30,7 +29,6 @@ LOCAL_MODULE_TAGS := optional
 include $(LLVM_DEVICE_BUILD_MK)
 include $(LLVM_TBLGEN_RULES_MK)
 include $(BUILD_STATIC_LIBRARY)
-endif
 
 # For the host
 # =====================================================
index 0fd7058..633df62 100644 (file)
@@ -14,7 +14,6 @@ x86_instprinter_SRC_FILES := \
 
 # For the device
 # =====================================================
-ifeq ($(TARGET_ARCH),x86)
 include $(CLEAR_VARS)
 include $(CLEAR_TBLGEN_VARS)
 
@@ -33,7 +32,6 @@ LOCAL_MODULE_TAGS := optional
 include $(LLVM_DEVICE_BUILD_MK)
 include $(LLVM_TBLGEN_RULES_MK)
 include $(BUILD_STATIC_LIBRARY)
-endif
 
 # For the host
 # =====================================================
index 31ba842..65cd8df 100644 (file)
@@ -36,7 +36,6 @@ include $(BUILD_HOST_STATIC_LIBRARY)
 
 # For the device only
 # =====================================================
-ifeq ($(TARGET_ARCH),x86)
 include $(CLEAR_VARS)
 include $(CLEAR_TBLGEN_VARS)
 
@@ -53,4 +52,3 @@ include $(LLVM_DEVICE_BUILD_MK)
 include $(LLVM_TBLGEN_RULES_MK)
 include $(LLVM_GEN_INTRINSICS_MK)
 include $(BUILD_STATIC_LIBRARY)
-endif
index c72b383..1c53475 100644 (file)
@@ -32,7 +32,6 @@ include $(BUILD_HOST_STATIC_LIBRARY)
 
 # For the device
 # =====================================================
-ifeq ($(TARGET_ARCH),x86)
 include $(CLEAR_VARS)
 include $(CLEAR_TBLGEN_VARS)
 
@@ -52,4 +51,3 @@ LOCAL_MODULE_TAGS := optional
 include $(LLVM_DEVICE_BUILD_MK)
 include $(LLVM_TBLGEN_RULES_MK)
 include $(BUILD_STATIC_LIBRARY)
-endif
index d2e1478..d79fabe 100644 (file)
@@ -59,9 +59,7 @@ LOCAL_MODULE:= libLLVMScalarOpts
 # Override the default optimization level to work around a SIGSEGV
 # on x86 target builds for SROA.cpp.
 # Bug: 8047767
-ifeq ($(TARGET_ARCH),x86)
-LOCAL_CFLAGS += -O1
-endif
+LOCAL_CFLAGS_x86 += -O1
 
 LOCAL_MODULE_TAGS := optional
 
index 30baec0..70c9a84 100644 (file)
@@ -1,3 +1,5 @@
+LOCAL_MODULE_TARGET_ARCH := $(LLVM_SUPPORTED_ARCH)
+
 LOCAL_CFLAGS :=        \
        -D_GNU_SOURCE   \
        -D__STDC_LIMIT_MACROS   \
index bae748e..358027b 100644 (file)
@@ -8,7 +8,7 @@ ifeq ($(LOCAL_MODULE_CLASS),)
        LOCAL_MODULE_CLASS := STATIC_LIBRARIES
 endif
 
-GENFILE := $(addprefix $(call local-intermediates-dir)/llvm/IR/,Intrinsics.gen)
+GENFILE := $(addprefix $(call local-generated-sources-dir)/llvm/IR/,Intrinsics.gen)
 LOCAL_GENERATED_SOURCES += $(GENFILE)
 $(GENFILE): TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
 $(GENFILE): $(INTRINSICTD) $(INTRINSICTDS) | $(TBLGEN)
index e3a7ca3..0746e8b 100644 (file)
@@ -12,15 +12,15 @@ endef
 ###########################################################
 
 # Set LOCAL_MODULE_CLASS to STATIC_LIBRARIES default (require
-# for macro local-intermediates-dir)
+# for macro local-generated-sources-dir)
 ifeq ($(LOCAL_MODULE_CLASS),)
        LOCAL_MODULE_CLASS := STATIC_LIBRARIES
 endif
 
 ifneq ($(strip $(TBLGEN_TABLES)),)
 
-intermediates := $(call local-intermediates-dir)
-tblgen_gen_tables := $(addprefix $(intermediates)/,$(TBLGEN_TABLES))
+generated_sources := $(call local-generated-sources-dir)
+tblgen_gen_tables := $(addprefix $(generated_sources)/,$(TBLGEN_TABLES))
 LOCAL_GENERATED_SOURCES += $(tblgen_gen_tables)
 
 tblgen_source_dir := $(LOCAL_PATH)
@@ -39,165 +39,165 @@ tblgen_td_deps := $(wildcard $(tblgen_td_deps))
 # The directory and the .td directory is not the same.
 #
 ifeq ($(tblgen_source_dir),$(LLVM_ROOT_PATH)/lib/Target/ARM/MCTargetDesc)
-$(intermediates)/%GenRegisterInfo.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
-$(intermediates)/%GenRegisterInfo.inc: $(tblgen_source_dir)/../%.td \
+$(generated_sources)/%GenRegisterInfo.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
+$(generated_sources)/%GenRegisterInfo.inc: $(tblgen_source_dir)/../%.td \
                                        $(tblgen_td_deps) | $(TBLGEN)
        $(call transform-td-to-out, register-info)
 
-$(intermediates)/%GenInstrInfo.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
-$(intermediates)/%GenInstrInfo.inc: $(tblgen_source_dir)/../%.td \
+$(generated_sources)/%GenInstrInfo.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
+$(generated_sources)/%GenInstrInfo.inc: $(tblgen_source_dir)/../%.td \
                                     $(tblgen_td_deps) | $(TBLGEN)
        $(call transform-td-to-out,instr-info)
 
-$(intermediates)/%GenSubtargetInfo.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
-$(intermediates)/%GenSubtargetInfo.inc: $(tblgen_source_dir)/../%.td \
+$(generated_sources)/%GenSubtargetInfo.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
+$(generated_sources)/%GenSubtargetInfo.inc: $(tblgen_source_dir)/../%.td \
                                         $(tblgen_td_deps) | $(TBLGEN)
        $(call transform-td-to-out,subtarget)
 endif
 
 ifeq ($(tblgen_source_dir),$(LLVM_ROOT_PATH)/lib/Target/X86/MCTargetDesc)
-$(intermediates)/%GenRegisterInfo.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
-$(intermediates)/%GenRegisterInfo.inc: $(tblgen_source_dir)/../%.td \
+$(generated_sources)/%GenRegisterInfo.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
+$(generated_sources)/%GenRegisterInfo.inc: $(tblgen_source_dir)/../%.td \
                                        $(tblgen_td_deps) | $(TBLGEN)
        $(call transform-td-to-out, register-info)
 
-$(intermediates)/%GenInstrInfo.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
-$(intermediates)/%GenInstrInfo.inc: $(tblgen_source_dir)/../%.td \
+$(generated_sources)/%GenInstrInfo.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
+$(generated_sources)/%GenInstrInfo.inc: $(tblgen_source_dir)/../%.td \
                                     $(tblgen_td_deps) | $(TBLGEN)
        $(call transform-td-to-out,instr-info)
 
-$(intermediates)/%GenSubtargetInfo.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
-$(intermediates)/%GenSubtargetInfo.inc: $(tblgen_source_dir)/../%.td \
+$(generated_sources)/%GenSubtargetInfo.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
+$(generated_sources)/%GenSubtargetInfo.inc: $(tblgen_source_dir)/../%.td \
                                         $(tblgen_td_deps) | $(TBLGEN)
        $(call transform-td-to-out,subtarget)
 endif
 
 ifeq ($(tblgen_source_dir),$(LLVM_ROOT_PATH)/lib/Target/Mips/MCTargetDesc)
-$(intermediates)/%GenRegisterInfo.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
-$(intermediates)/%GenRegisterInfo.inc: $(tblgen_source_dir)/../%.td \
+$(generated_sources)/%GenRegisterInfo.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
+$(generated_sources)/%GenRegisterInfo.inc: $(tblgen_source_dir)/../%.td \
                                        $(tblgen_td_deps) | $(TBLGEN)
        $(call transform-td-to-out, register-info)
 
-$(intermediates)/%GenInstrInfo.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
-$(intermediates)/%GenInstrInfo.inc: $(tblgen_source_dir)/../%.td \
+$(generated_sources)/%GenInstrInfo.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
+$(generated_sources)/%GenInstrInfo.inc: $(tblgen_source_dir)/../%.td \
                                     $(tblgen_td_deps) | $(TBLGEN)
        $(call transform-td-to-out,instr-info)
 
-$(intermediates)/%GenSubtargetInfo.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
-$(intermediates)/%GenSubtargetInfo.inc: $(tblgen_source_dir)/../%.td \
+$(generated_sources)/%GenSubtargetInfo.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
+$(generated_sources)/%GenSubtargetInfo.inc: $(tblgen_source_dir)/../%.td \
                                         $(tblgen_td_deps) | $(TBLGEN)
        $(call transform-td-to-out,subtarget)
 endif
 
 
 ifneq ($(filter %GenRegisterInfo.inc,$(tblgen_gen_tables)),)
-$(intermediates)/%GenRegisterInfo.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
-$(intermediates)/%GenRegisterInfo.inc: $(tblgen_source_dir)/%.td \
+$(generated_sources)/%GenRegisterInfo.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
+$(generated_sources)/%GenRegisterInfo.inc: $(tblgen_source_dir)/%.td \
                                        $(tblgen_td_deps) | $(TBLGEN)
        $(call transform-td-to-out,register-info)
 endif
 
 ifneq ($(filter %GenInstrInfo.inc,$(tblgen_gen_tables)),)
-$(intermediates)/%GenInstrInfo.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
-$(intermediates)/%GenInstrInfo.inc: $(tblgen_source_dir)/%.td \
+$(generated_sources)/%GenInstrInfo.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
+$(generated_sources)/%GenInstrInfo.inc: $(tblgen_source_dir)/%.td \
                                     $(tblgen_td_deps) | $(TBLGEN)
        $(call transform-td-to-out,instr-info)
 endif
 
 ifneq ($(filter %GenAsmWriter.inc,$(tblgen_gen_tables)),)
-$(intermediates)/%GenAsmWriter.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
-$(intermediates)/%GenAsmWriter.inc: $(tblgen_source_dir)/%.td \
+$(generated_sources)/%GenAsmWriter.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
+$(generated_sources)/%GenAsmWriter.inc: $(tblgen_source_dir)/%.td \
                                     $(tblgen_td_deps) | $(TBLGEN)
        $(call transform-td-to-out,asm-writer)
 endif
 
 ifneq ($(filter %GenAsmWriter1.inc,$(tblgen_gen_tables)),)
-$(intermediates)/%GenAsmWriter1.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
-$(intermediates)/%GenAsmWriter1.inc: $(tblgen_source_dir)/%.td \
+$(generated_sources)/%GenAsmWriter1.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
+$(generated_sources)/%GenAsmWriter1.inc: $(tblgen_source_dir)/%.td \
                                      $(tblgen_td_deps) | $(TBLGEN)
        $(call transform-td-to-out,asm-writer -asmwriternum=1)
 endif
 
 ifneq ($(filter %GenAsmMatcher.inc,$(tblgen_gen_tables)),)
-$(intermediates)/%GenAsmMatcher.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
-$(intermediates)/%GenAsmMatcher.inc: $(tblgen_source_dir)/%.td \
+$(generated_sources)/%GenAsmMatcher.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
+$(generated_sources)/%GenAsmMatcher.inc: $(tblgen_source_dir)/%.td \
                                      $(tblgen_td_deps) | $(TBLGEN)
        $(call transform-td-to-out,asm-matcher)
 endif
 
 ifneq ($(filter %GenCodeEmitter.inc,$(tblgen_gen_tables)),)
-$(intermediates)/%GenCodeEmitter.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
-$(intermediates)/%GenCodeEmitter.inc: $(tblgen_source_dir)/%.td \
+$(generated_sources)/%GenCodeEmitter.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
+$(generated_sources)/%GenCodeEmitter.inc: $(tblgen_source_dir)/%.td \
                                       $(tblgen_td_deps) | $(TBLGEN)
        $(call transform-td-to-out,emitter)
 endif
 
 ifneq ($(filter %GenMCCodeEmitter.inc,$(tblgen_gen_tables)),)
-$(intermediates)/%GenMCCodeEmitter.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
-$(intermediates)/%GenMCCodeEmitter.inc: $(tblgen_source_dir)/%.td \
+$(generated_sources)/%GenMCCodeEmitter.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
+$(generated_sources)/%GenMCCodeEmitter.inc: $(tblgen_source_dir)/%.td \
                                         $(tblgen_td_deps) | $(TBLGEN)
        $(call transform-td-to-out,emitter -mc-emitter)
 endif
 
 ifneq ($(filter %GenMCPseudoLowering.inc,$(tblgen_gen_tables)),)
-$(intermediates)/%GenMCPseudoLowering.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
-$(intermediates)/%GenMCPseudoLowering.inc: $(tblgen_source_dir)/%.td \
+$(generated_sources)/%GenMCPseudoLowering.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
+$(generated_sources)/%GenMCPseudoLowering.inc: $(tblgen_source_dir)/%.td \
                                            $(tblgen_td_deps) | $(TBLGEN)
        $(call transform-td-to-out,pseudo-lowering)
 endif
 
 ifneq ($(filter %GenDAGISel.inc,$(tblgen_gen_tables)),)
-$(intermediates)/%GenDAGISel.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
-$(intermediates)/%GenDAGISel.inc: $(tblgen_source_dir)/%.td \
+$(generated_sources)/%GenDAGISel.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
+$(generated_sources)/%GenDAGISel.inc: $(tblgen_source_dir)/%.td \
                                   $(tblgen_td_deps) | $(TBLGEN)
        $(call transform-td-to-out,dag-isel)
 endif
 
 ifneq ($(filter %GenDisassemblerTables.inc,$(tblgen_gen_tables)),)
-$(intermediates)/%GenDisassemblerTables.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
-$(intermediates)/%GenDisassemblerTables.inc: $(tblgen_source_dir)/%.td \
+$(generated_sources)/%GenDisassemblerTables.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
+$(generated_sources)/%GenDisassemblerTables.inc: $(tblgen_source_dir)/%.td \
                                              $(tblgen_td_deps) | $(TBLGEN)
        $(call transform-td-to-out,disassembler)
 endif
 
 ifneq ($(filter %GenEDInfo.inc,$(tblgen_gen_tables)),)
-$(intermediates)/%GenEDInfo.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
-$(intermediates)/%GenEDInfo.inc: $(tblgen_source_dir)/%.td \
+$(generated_sources)/%GenEDInfo.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
+$(generated_sources)/%GenEDInfo.inc: $(tblgen_source_dir)/%.td \
                                  $(tblgen_td_deps) | $(TBLGEN)
        $(call transform-td-to-out,enhanced-disassembly-info)
 endif
 
 ifneq ($(filter %GenFastISel.inc,$(tblgen_gen_tables)),)
-$(intermediates)/%GenFastISel.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
-$(intermediates)/%GenFastISel.inc: $(tblgen_source_dir)/%.td \
+$(generated_sources)/%GenFastISel.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
+$(generated_sources)/%GenFastISel.inc: $(tblgen_source_dir)/%.td \
                                    $(tblgen_td_deps) | $(TBLGEN)
        $(call transform-td-to-out,fast-isel)
 endif
 
 ifneq ($(filter %GenSubtargetInfo.inc,$(tblgen_gen_tables)),)
-$(intermediates)/%GenSubtargetInfo.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
-$(intermediates)/%GenSubtargetInfo.inc: $(tblgen_source_dir)/%.td \
+$(generated_sources)/%GenSubtargetInfo.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
+$(generated_sources)/%GenSubtargetInfo.inc: $(tblgen_source_dir)/%.td \
                                         $(tblgen_td_deps) | $(TBLGEN)
        $(call transform-td-to-out,subtarget)
 endif
 
 ifneq ($(filter %GenCallingConv.inc,$(tblgen_gen_tables)),)
-$(intermediates)/%GenCallingConv.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
-$(intermediates)/%GenCallingConv.inc: $(tblgen_source_dir)/%.td \
+$(generated_sources)/%GenCallingConv.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
+$(generated_sources)/%GenCallingConv.inc: $(tblgen_source_dir)/%.td \
                                       $(tblgen_td_deps) | $(TBLGEN)
        $(call transform-td-to-out,callingconv)
 endif
 
 ifneq ($(filter %GenIntrinsics.inc,$(tblgen_gen_tables)),)
-$(intermediates)/%GenIntrinsics.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
-$(intermediates)/%GenIntrinsics.inc: $(tblgen_source_dir)/%.td \
+$(generated_sources)/%GenIntrinsics.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
+$(generated_sources)/%GenIntrinsics.inc: $(tblgen_source_dir)/%.td \
                                      $(tblgen_td_deps) | $(TBLGEN)
        $(call transform-td-to-out,tgt_intrinsics)
 endif
 
 ifneq ($(findstring ARMGenDecoderTables.inc,$(tblgen_gen_tables)),)
-$(intermediates)/ARMGenDecoderTables.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
-$(intermediates)/ARMGenDecoderTables.inc: $(tblgen_source_dir)/ARM.td \
+$(generated_sources)/ARMGenDecoderTables.inc: TBLGEN_LOCAL_MODULE := $(LOCAL_MODULE)
+$(generated_sources)/ARMGenDecoderTables.inc: $(tblgen_source_dir)/ARM.td \
                                           $(tblgen_td_deps) | $(TBLGEN)
        $(call transform-td-to-out,arm-decoder)
 endif
diff --git a/llvm.mk b/llvm.mk
index badc445..3acc8cc 100644 (file)
--- a/llvm.mk
+++ b/llvm.mk
@@ -9,3 +9,5 @@ LLVM_HOST_BUILD_MK := $(LLVM_ROOT_PATH)/llvm-host-build.mk
 LLVM_DEVICE_BUILD_MK := $(LLVM_ROOT_PATH)/llvm-device-build.mk
 LLVM_GEN_INTRINSICS_MK := $(LLVM_ROOT_PATH)/llvm-gen-intrinsics.mk
 LLVM_TBLGEN_RULES_MK := $(LLVM_ROOT_PATH)/llvm-tblgen-rules.mk
+
+LLVM_SUPPORTED_ARCH := arm mips x86 x86_64
index 718afb3..14c60b9 100644 (file)
@@ -81,9 +81,10 @@ endif
 include $(LLVM_HOST_BUILD_MK)
 include $(BUILD_HOST_SHARED_LIBRARY)
 
-#TODOArm64: Enable llvm build
-#TODOMips64: Enable llvm build
-ifeq ($(filter $(TARGET_ARCH),arm64 mips64),)
+ifeq (,$(filter $(TARGET_ARCH),$(LLVM_SUPPORTED_ARCH)))
+$(warning TODO $(TARGET_ARCH): Enable llvm build)
+endif
+
 # DEVICE LLVM shared library build
 include $(CLEAR_VARS)
 
@@ -95,19 +96,10 @@ LOCAL_MODULE_TAGS := optional
 LOCAL_WHOLE_STATIC_LIBRARIES := \
   $(llvm_pre_static_libraries)
 
-ifeq ($(TARGET_ARCH),arm)
-  LOCAL_WHOLE_STATIC_LIBRARIES += $(llvm_arm_static_libraries)
-else
-  ifeq ($(TARGET_ARCH),$(filter $(TARGET_ARCH),x86 x86_64 x32))
-    LOCAL_WHOLE_STATIC_LIBRARIES += $(llvm_x86_static_libraries)
-  else
-    ifeq ($(TARGET_ARCH),mips)
-      LOCAL_WHOLE_STATIC_LIBRARIES += $(llvm_mips_static_libraries)
-    else
-      $(error Unsupported architecture $(TARGET_ARCH))
-    endif
-  endif
-endif
+LOCAL_WHOLE_STATIC_LIBRARIES_arm += $(llvm_arm_static_libraries)
+LOCAL_WHOLE_STATIC_LIBRARIES_x86 += $(llvm_x86_static_libraries)
+LOCAL_WHOLE_STATIC_LIBRARIES_x86_64 += $(llvm_x86_static_libraries)
+LOCAL_WHOLE_STATIC_LIBRARIES_mips += $(llvm_mips_static_libraries)
 
 LOCAL_WHOLE_STATIC_LIBRARIES += $(llvm_post_static_libraries)
 
@@ -117,6 +109,4 @@ LOCAL_SHARED_LIBRARIES := libcutils libdl libstlport
 include $(LLVM_DEVICE_BUILD_MK)
 include $(BUILD_SHARED_LIBRARY)
 
-endif # !(arm64 || mips64)
-
 endif # don't build in unbundled branches
index af1f75a..fde9f8c 100644 (file)
@@ -91,9 +91,10 @@ include $(BUILD_HOST_EXECUTABLE)
 # llc command line tool (target)
 #===---------------------------------------------------------------===
 
-#TODOArm64: Enable llc build
-#TODOMips64: Enable llc build
-ifeq ($(filter $(TARGET_ARCH),arm64 mips64),)
+ifeq (,$(filter $(TARGET_ARCH),$(LLVM_SUPPORTED_ARCH)))
+$(warning TODO $(TARGET_ARCH): Enable llc build)
+endif
+
 include $(CLEAR_VARS)
 
 LOCAL_MODULE := llc
@@ -103,19 +104,10 @@ LOCAL_MODULE_CLASS := EXECUTABLES
 LOCAL_SRC_FILES := $(llvm_llc_SRC_FILES)
 LOCAL_C_INCLUDES += external/llvm/include
 
-ifeq ($(TARGET_ARCH),arm)
-  LOCAL_STATIC_LIBRARIES := $(llvm_llc_arm_STATIC_LIBRARIES)
-else
-  ifeq ($(TARGET_ARCH),mips)
-    LOCAL_STATIC_LIBRARIES := $(llvm_llc_mips_STATIC_LIBRARIES)
-  else
-    ifeq ($(TARGET_ARCH),$(filter $(TARGET_ARCH),x86 x86_64 x32))
-      LOCAL_STATIC_LIBRARIES := $(llvm_llc_x86_STATIC_LIBRARIES)
-    else
-      $(error "Unsupport llc target $(TARGET_ARCH)")
-    endif
-  endif
-endif
+LOCAL_STATIC_LIBRARIES_arm := $(llvm_llc_arm_STATIC_LIBRARIES)
+LOCAL_STATIC_LIBRARIES_mips := $(llvm_llc_mips_STATIC_LIBRARIES)
+LOCAL_STATIC_LIBRARIES_x86 := $(llvm_llc_x86_STATIC_LIBRARIES)
+LOCAL_STATIC_LIBRARIES_x86_64 := $(llvm_llc_x86_STATIC_LIBRARIES)
 
 LOCAL_STATIC_LIBRARIES += $(llvm_llc_STATIC_LIBRARIES)
 
@@ -128,5 +120,3 @@ include $(LLVM_ROOT_PATH)/llvm.mk
 include $(LLVM_DEVICE_BUILD_MK)
 include $(LLVM_GEN_INTRINSICS_MK)
 include $(BUILD_EXECUTABLE)
-
-endif # !(arm64 || mips64)