From 764b46ea2de93cbfa3e1064e1750c88c2441b317 Mon Sep 17 00:00:00 2001 From: "Vikram S. Adve" Date: Thu, 29 Aug 2002 18:40:51 +0000 Subject: [PATCH] Factor out /shared/... path to simplify changing it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3521 91177308-0d34-0410-b5e6-96231b3b80d8 --- Makefile.common | 17 +++++++++++++---- Makefile.rules | 17 +++++++++++++---- 2 files changed, 26 insertions(+), 8 deletions(-) diff --git a/Makefile.common b/Makefile.common index 5770ada8272..d564cad3eb1 100644 --- a/Makefile.common +++ b/Makefile.common @@ -41,9 +41,19 @@ # #ENABLE_OPTIMIZED = 1 -# If you do not want to build into /shared, uncomment this +# Current working directory, used below +CUR_DIRECTORY := $(shell pwd) + +# Path to directory where object files should be stored during a build. +# Set this to "." if you do not want to use a separate place for object files. +# +BUILD_DIR = /shared/$(LOGIN_NAME)$(patsubst $(HOME)%,%,$(CUR_DIRECTORY)) + +# Flag whether or not to use a separate location for build files # -#BUILD_ROOT = . +ifeq ($(BUILD_DIR),".") + BUILD_ROOT = $(BUILD_DIR) +endif ifdef SHARED_LIBRARY # if SHARED_LIBRARY is specified, the default is to build the dynamic lib @@ -66,8 +76,7 @@ BUILD_ROOT_TOP := $(LEVEL) else LOGIN_NAME := $(shell whoami) -CUR_DIRECTORY := $(shell pwd) -BUILD_ROOT := /shared/$(LOGIN_NAME)$(patsubst $(HOME)%,%,$(CUR_DIRECTORY)) +BUILD_ROOT := $(BUILD_DIR) # Calculate the BUILD_ROOT_TOP variable, which is the top of the llvm/ tree. # Note that although this is just equal to $(BUILD_ROOT)/$(LEVEL), we cannot use diff --git a/Makefile.rules b/Makefile.rules index 5770ada8272..d564cad3eb1 100644 --- a/Makefile.rules +++ b/Makefile.rules @@ -41,9 +41,19 @@ # #ENABLE_OPTIMIZED = 1 -# If you do not want to build into /shared, uncomment this +# Current working directory, used below +CUR_DIRECTORY := $(shell pwd) + +# Path to directory where object files should be stored during a build. +# Set this to "." if you do not want to use a separate place for object files. +# +BUILD_DIR = /shared/$(LOGIN_NAME)$(patsubst $(HOME)%,%,$(CUR_DIRECTORY)) + +# Flag whether or not to use a separate location for build files # -#BUILD_ROOT = . +ifeq ($(BUILD_DIR),".") + BUILD_ROOT = $(BUILD_DIR) +endif ifdef SHARED_LIBRARY # if SHARED_LIBRARY is specified, the default is to build the dynamic lib @@ -66,8 +76,7 @@ BUILD_ROOT_TOP := $(LEVEL) else LOGIN_NAME := $(shell whoami) -CUR_DIRECTORY := $(shell pwd) -BUILD_ROOT := /shared/$(LOGIN_NAME)$(patsubst $(HOME)%,%,$(CUR_DIRECTORY)) +BUILD_ROOT := $(BUILD_DIR) # Calculate the BUILD_ROOT_TOP variable, which is the top of the llvm/ tree. # Note that although this is just equal to $(BUILD_ROOT)/$(LEVEL), we cannot use -- 2.34.1