summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Criswell <criswell@uiuc.edu>2003-06-20 18:35:39 +0000
committerJohn Criswell <criswell@uiuc.edu>2003-06-20 18:35:39 +0000
commit917fb38274cfc664f7cb5ea1d342fccb95d494e5 (patch)
tree0f1688c2197b8783a231b1bfb0b01335200c6340
parent259a144ef56b6471e4d42a12206b2781b39e6a27 (diff)
Added a hack that takes the path relative to the home directory into account
if a home directory is provided by the environment. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6805 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--Makefile.common24
-rw-r--r--Makefile.rules24
2 files changed, 44 insertions, 4 deletions
diff --git a/Makefile.common b/Makefile.common
index 9a69fc4c7aa..8d4913d95a2 100644
--- a/Makefile.common
+++ b/Makefile.common
@@ -75,6 +75,18 @@ BUILD_SRC_ROOT = $(shell cd $(BUILD_SRC_DIR)/$(LEVEL); pwd)
endif
#
+# Now for a hack:
+# If we have a home directory, append our offset from it to OBJ_ROOT.
+# This will "emulate" the previous behavior while not breaking builds
+# in which there is no home directory.
+#
+ifdef HOME
+OBJ_ROOT := $(OBJ_ROOT)$(patsubst $(HOME)%,%,$(BUILD_SRC_ROOT))
+else
+OBJ_ROOT := $(OBJ_ROOT)/$(shell basename $(BUILD_SRC_ROOT))
+endif
+
+#
# Set the object build directory. Its location depends upon the source path
# and where object files should go.
#
@@ -82,7 +94,7 @@ ifndef BUILD_OBJ_DIR
ifeq ($(OBJ_ROOT),.)
BUILD_OBJ_DIR = $(shell pwd)
else
-BUILD_OBJ_DIR := $(OBJ_ROOT)$(patsubst $(shell dirname $(BUILD_SRC_ROOT))%,%,$(shell cd $(BUILD_SRC_DIR); pwd))
+BUILD_OBJ_DIR := $(OBJ_ROOT)$(patsubst $(BUILD_SRC_ROOT)%,%,$(shell cd $(BUILD_SRC_DIR); pwd))
endif
endif
@@ -93,7 +105,7 @@ ifndef BUILD_OBJ_ROOT
ifeq ($(OBJ_ROOT),.)
BUILD_OBJ_ROOT = $(shell cd $(LEVEL); pwd)
else
-BUILD_OBJ_ROOT := $(OBJ_ROOT)$(patsubst $(shell dirname $(BUILD_SRC_ROOT))%,%,$(shell cd $(BUILD_SRC_ROOT); pwd))
+BUILD_OBJ_ROOT := $(OBJ_ROOT)$(patsubst $(BUILD_SRC_ROOT)%,%,$(shell cd $(BUILD_SRC_ROOT); pwd))
endif
endif
@@ -133,6 +145,14 @@ install ::
# Default rule for test. It ensures everything has a test rule
test::
+prdirs::
+ echo "LLVM Source Root : $(LLVM_SRC_ROOT)"; \
+ echo "LLVM Object Root : $(LLVM_OBJ_ROOT)"; \
+ echo "Build Source Root : $(BUILD_SRC_ROOT)"; \
+ echo "Build Source Directory : $(BUILD_SRC_DIR)"; \
+ echo "Build Object Root : $(BUILD_OBJ_ROOT)"; \
+ echo "Build Object Directory : $(BUILD_OBJ_DIR)";
+
#--------------------------------------------------------------------
# Variables derived from configuration options...
#--------------------------------------------------------------------
diff --git a/Makefile.rules b/Makefile.rules
index 9a69fc4c7aa..8d4913d95a2 100644
--- a/Makefile.rules
+++ b/Makefile.rules
@@ -75,6 +75,18 @@ BUILD_SRC_ROOT = $(shell cd $(BUILD_SRC_DIR)/$(LEVEL); pwd)
endif
#
+# Now for a hack:
+# If we have a home directory, append our offset from it to OBJ_ROOT.
+# This will "emulate" the previous behavior while not breaking builds
+# in which there is no home directory.
+#
+ifdef HOME
+OBJ_ROOT := $(OBJ_ROOT)$(patsubst $(HOME)%,%,$(BUILD_SRC_ROOT))
+else
+OBJ_ROOT := $(OBJ_ROOT)/$(shell basename $(BUILD_SRC_ROOT))
+endif
+
+#
# Set the object build directory. Its location depends upon the source path
# and where object files should go.
#
@@ -82,7 +94,7 @@ ifndef BUILD_OBJ_DIR
ifeq ($(OBJ_ROOT),.)
BUILD_OBJ_DIR = $(shell pwd)
else
-BUILD_OBJ_DIR := $(OBJ_ROOT)$(patsubst $(shell dirname $(BUILD_SRC_ROOT))%,%,$(shell cd $(BUILD_SRC_DIR); pwd))
+BUILD_OBJ_DIR := $(OBJ_ROOT)$(patsubst $(BUILD_SRC_ROOT)%,%,$(shell cd $(BUILD_SRC_DIR); pwd))
endif
endif
@@ -93,7 +105,7 @@ ifndef BUILD_OBJ_ROOT
ifeq ($(OBJ_ROOT),.)
BUILD_OBJ_ROOT = $(shell cd $(LEVEL); pwd)
else
-BUILD_OBJ_ROOT := $(OBJ_ROOT)$(patsubst $(shell dirname $(BUILD_SRC_ROOT))%,%,$(shell cd $(BUILD_SRC_ROOT); pwd))
+BUILD_OBJ_ROOT := $(OBJ_ROOT)$(patsubst $(BUILD_SRC_ROOT)%,%,$(shell cd $(BUILD_SRC_ROOT); pwd))
endif
endif
@@ -133,6 +145,14 @@ install ::
# Default rule for test. It ensures everything has a test rule
test::
+prdirs::
+ echo "LLVM Source Root : $(LLVM_SRC_ROOT)"; \
+ echo "LLVM Object Root : $(LLVM_OBJ_ROOT)"; \
+ echo "Build Source Root : $(BUILD_SRC_ROOT)"; \
+ echo "Build Source Directory : $(BUILD_SRC_DIR)"; \
+ echo "Build Object Root : $(BUILD_OBJ_ROOT)"; \
+ echo "Build Object Directory : $(BUILD_OBJ_DIR)";
+
#--------------------------------------------------------------------
# Variables derived from configuration options...
#--------------------------------------------------------------------