Fix computation of LLVM_OBJ_ROOT for non-projects :(
authorChris Lattner <sabre@nondot.org>
Fri, 22 Aug 2003 05:18:49 +0000 (05:18 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 22 Aug 2003 05:18:49 +0000 (05:18 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8046 91177308-0d34-0410-b5e6-96231b3b80d8

Makefile.common
Makefile.rules

index 47c5f7b5dea610ebc64e205b164e8b1f245390a5..3bdee2ae158d703d2472efa1fe352f89346b7eb9 100644 (file)
@@ -116,18 +116,22 @@ endif
 endif
 
 #
-# Set the LLVM source directory.
-# It is typically the root directory of what we're compiling now.
+# Set the LLVM object directory.
 #
-ifndef LLVM_SRC_ROOT
-LLVM_SRC_ROOT := $(BUILD_SRC_ROOT)
+ifndef LLVM_OBJ_ROOT
+ifdef LLVM_SRC_ROOT
+LLVM_OBJ_ROOT := $(shell cd $(BUILD_OBJ_DIR); cd $(LLVM_SRC_ROOT); pwd)
+else
+LLVM_OBJ_ROOT := $(shell cd $(BUILD_OBJ_DIR); cd $(LEVEL); pwd)
+endif
 endif
 
 #
-# Set the LLVM object directory.
+# Set the LLVM source directory.
+# It is typically the root directory of what we're compiling now.
 #
-ifndef LLVM_OBJ_ROOT
-LLVM_OBJ_ROOT := $(shell cd $(BUILD_OBJ_DIR); cd $(LLVM_SRC_ROOT); pwd)
+ifndef LLVM_SRC_ROOT
+LLVM_SRC_ROOT := $(BUILD_SRC_ROOT)
 endif
 
 ###########################################################################
index 47c5f7b5dea610ebc64e205b164e8b1f245390a5..3bdee2ae158d703d2472efa1fe352f89346b7eb9 100644 (file)
@@ -116,18 +116,22 @@ endif
 endif
 
 #
-# Set the LLVM source directory.
-# It is typically the root directory of what we're compiling now.
+# Set the LLVM object directory.
 #
-ifndef LLVM_SRC_ROOT
-LLVM_SRC_ROOT := $(BUILD_SRC_ROOT)
+ifndef LLVM_OBJ_ROOT
+ifdef LLVM_SRC_ROOT
+LLVM_OBJ_ROOT := $(shell cd $(BUILD_OBJ_DIR); cd $(LLVM_SRC_ROOT); pwd)
+else
+LLVM_OBJ_ROOT := $(shell cd $(BUILD_OBJ_DIR); cd $(LEVEL); pwd)
+endif
 endif
 
 #
-# Set the LLVM object directory.
+# Set the LLVM source directory.
+# It is typically the root directory of what we're compiling now.
 #
-ifndef LLVM_OBJ_ROOT
-LLVM_OBJ_ROOT := $(shell cd $(BUILD_OBJ_DIR); cd $(LLVM_SRC_ROOT); pwd)
+ifndef LLVM_SRC_ROOT
+LLVM_SRC_ROOT := $(BUILD_SRC_ROOT)
 endif
 
 ###########################################################################