Fix a crash in block placement due to an inner loop that happened to be
[oota-llvm.git] / Makefile.rules
index f9ca8e688b8883bd2b9909e4f5f7f75da6b0d8cd..3816bbb1a1cbb698f18ee0c30a6061dd6fb72e48 100644 (file)
@@ -81,6 +81,11 @@ LLVMBuildMakeFrag := $(PROJ_OBJ_ROOT)/Makefile.llvmbuild
 LLVMConfigLibraryDependenciesInc := \
        $(PROJ_OBJ_ROOT)/tools/llvm-config-2/LibraryDependencies.inc
 
+# This is for temporary backwards compatibility.
+ifndef TARGET_NATIVE_ARCH
+TARGET_NATIVE_ARCH := $(ARCH)
+endif
+
 # The rule to create the LLVMBuild Makefile fragment as well as the llvm-config
 # library table.
 #
@@ -92,7 +97,7 @@ LLVMConfigLibraryDependenciesInc := \
 $(LLVMBuildMakeFrag): $(PROJ_SRC_ROOT)/Makefile.rules
        $(Echo) Constructing LLVMBuild project information.
        $(Verb) $(LLVMBuildTool) \
-         --native-target "$(ARCH)" \
+         --native-target "$(TARGET_NATIVE_ARCH)" \
          --enable-targets "$(TARGETS_TO_BUILD)" \
          --write-library-table $(LLVMConfigLibraryDependenciesInc) \
          --write-make-fragment $(LLVMBuildMakeFrag)
@@ -506,8 +511,12 @@ endif
 #--------------------------------------------------------------------
 # Full Paths To Compiled Tools and Utilities
 #--------------------------------------------------------------------
-EchoCmd  = $(ECHO) llvm[$(MAKELEVEL)]:
-Echo     = @$(EchoCmd)
+EchoCmd  := $(ECHO) llvm[$(MAKELEVEL)]:
+ifdef BUILD_DIRS_ONLY
+EchoCmd  := $(EchoCmd) "(build tools)":
+endif
+
+Echo     := @$(EchoCmd)
 ifndef LLVMAS
 LLVMAS   := $(LLVMToolDir)/llvm-as$(EXEEXT)
 endif
@@ -518,7 +527,11 @@ ifndef LLVM_TBLGEN
     LLVM_TBLGEN   := $(LLVMToolDir)/llvm-tblgen$(EXEEXT)
   endif
 endif
-LLVM_CONFIG := $(LLVMToolDir)/llvm-config
+ifeq ($(LLVM_CROSS_COMPILING),1)
+  LLVM_CONFIG := $(BuildLLVMToolDir)/llvm-config-2$(BUILD_EXEEXT)
+else
+  LLVM_CONFIG := $(LLVMToolDir)/llvm-config-2$(EXEEXT)
+endif
 ifndef LLVMLD
 LLVMLD    := $(LLVMToolDir)/llvm-ld$(EXEEXT)
 endif