diff --git a/Makefile.common b/Makefile.common index 47c5f7b5dea..3bdee2ae158 100644 --- a/Makefile.common +++ b/Makefile.common @@ -115,6 +115,17 @@ BUILD_OBJ_ROOT := $(HOME_OBJ_ROOT) endif endif +# +# Set the LLVM object directory. +# +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 source directory. # It is typically the root directory of what we're compiling now. @@ -123,13 +134,6 @@ ifndef LLVM_SRC_ROOT LLVM_SRC_ROOT := $(BUILD_SRC_ROOT) endif -# -# Set the LLVM object directory. -# -ifndef LLVM_OBJ_ROOT -LLVM_OBJ_ROOT := $(shell cd $(BUILD_OBJ_DIR); cd $(LLVM_SRC_ROOT); pwd) -endif - ########################################################################### # Default Targets: # The following targets are the standard top level targets for diff --git a/Makefile.rules b/Makefile.rules index 47c5f7b5dea..3bdee2ae158 100644 --- a/Makefile.rules +++ b/Makefile.rules @@ -115,6 +115,17 @@ BUILD_OBJ_ROOT := $(HOME_OBJ_ROOT) endif endif +# +# Set the LLVM object directory. +# +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 source directory. # It is typically the root directory of what we're compiling now. @@ -123,13 +134,6 @@ ifndef LLVM_SRC_ROOT LLVM_SRC_ROOT := $(BUILD_SRC_ROOT) endif -# -# Set the LLVM object directory. -# -ifndef LLVM_OBJ_ROOT -LLVM_OBJ_ROOT := $(shell cd $(BUILD_OBJ_DIR); cd $(LLVM_SRC_ROOT); pwd) -endif - ########################################################################### # Default Targets: # The following targets are the standard top level targets for