Simplified significantly by pulling out local configuration options
authorVikram S. Adve <vadve@cs.uiuc.edu>
Thu, 29 Aug 2002 23:28:46 +0000 (23:28 +0000)
committerVikram S. Adve <vadve@cs.uiuc.edu>
Thu, 29 Aug 2002 23:28:46 +0000 (23:28 +0000)
into Makefile.config.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3527 91177308-0d34-0410-b5e6-96231b3b80d8

Makefile.common
Makefile.rules

index d564cad3eb1fa632c997cfd6368ff71c3ab31aae..20a991c4cb9322034b7f961a5fca1b6d576932e0 100644 (file)
@@ -5,7 +5,8 @@
 # These are platform dependant, so this is the file used to specify these
 # system dependant operations.
 #
-# The following functionality may be set by setting incoming variables:
+# The following functionality can be set by setting incoming variables.
+# The variable $(LEVEL) *must* be set:
 #
 # 1. LEVEL - The level of the current subdirectory from the top of the 
 #    MagicStats view.  This level should be expressed as a path, for 
 #
 #===-----------------------------------------------------------------------====
 
+# Configuration file to set paths specific to local installation of LLVM
+# 
+include $(LEVEL)/Makefile.config
+
 # These are options that can either be enabled here, or can be enabled on the
 # make command line (ie, make ENABLE_PROFILING=1)
 #
 #
 #ENABLE_OPTIMIZED = 1
 
-# 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
-#
-ifeq ($(BUILD_DIR),".")
-  BUILD_ROOT = $(BUILD_DIR)
-endif
-
 ifdef SHARED_LIBRARY
 # if SHARED_LIBRARY is specified, the default is to build the dynamic lib
 dynamic ::
@@ -71,12 +62,12 @@ install ::
 # /shared directory by default because it is guaranteed to be local to the
 # current machine.
 #
-ifdef BUILD_ROOT
-BUILD_ROOT_TOP := $(LEVEL)
+ifeq ($(LLVM_OBJ_DIR),.)
+BUILD_ROOT     = $(LLVM_OBJ_DIR)
+BUILD_ROOT_TOP = $(LEVEL)
 else
 
-LOGIN_NAME := $(shell whoami)
-BUILD_ROOT := $(BUILD_DIR)
+BUILD_ROOT := $(LLVM_OBJ_DIR)$(patsubst $(HOME)%,%,$(shell pwd))
 
 # 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
@@ -85,22 +76,20 @@ BUILD_ROOT := $(BUILD_DIR)
 # the directory to eliminate the ../'s
 #
 TOP_DIRECTORY := $(shell cd $(LEVEL); pwd)
-BUILD_ROOT_TOP := /shared/$(LOGIN_NAME)$(patsubst $(HOME)%,%,$(TOP_DIRECTORY))
+BUILD_ROOT_TOP := $(LLVM_OBJ_DIR)$(patsubst $(HOME)%,%,$(TOP_DIRECTORY))
 endif
 
 #--------------------------------------------------------------------
-# Installation configuration options... 
+# Variables derived from configuration options... 
 #--------------------------------------------------------------------
 
 #BinInstDir=/usr/local/bin
 #LibInstDir=/usrl/local/lib/xxx
 #DocInstDir=/usr/doc/xxx
 
-BURG = /home/vadve/vadve/Research/DynOpt/Burg/burg
 BURG_OPTS = -I
 
-
-PURIFY = /usr/dcs/applications/purify/bin/purify -cache-dir="$(BUILD_ROOT_TOP)/../purifycache" -chain-length="30" -messages=all 
+PURIFY := $(PURIFY) -cache-dir="$(BUILD_ROOT_TOP)/../purifycache" -chain-length="30" -messages=all 
 
 # Shorthand for commonly accessed directories
 LIBDEBUG    := $(BUILD_ROOT_TOP)/lib/Debug
index d564cad3eb1fa632c997cfd6368ff71c3ab31aae..20a991c4cb9322034b7f961a5fca1b6d576932e0 100644 (file)
@@ -5,7 +5,8 @@
 # These are platform dependant, so this is the file used to specify these
 # system dependant operations.
 #
-# The following functionality may be set by setting incoming variables:
+# The following functionality can be set by setting incoming variables.
+# The variable $(LEVEL) *must* be set:
 #
 # 1. LEVEL - The level of the current subdirectory from the top of the 
 #    MagicStats view.  This level should be expressed as a path, for 
 #
 #===-----------------------------------------------------------------------====
 
+# Configuration file to set paths specific to local installation of LLVM
+# 
+include $(LEVEL)/Makefile.config
+
 # These are options that can either be enabled here, or can be enabled on the
 # make command line (ie, make ENABLE_PROFILING=1)
 #
 #
 #ENABLE_OPTIMIZED = 1
 
-# 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
-#
-ifeq ($(BUILD_DIR),".")
-  BUILD_ROOT = $(BUILD_DIR)
-endif
-
 ifdef SHARED_LIBRARY
 # if SHARED_LIBRARY is specified, the default is to build the dynamic lib
 dynamic ::
@@ -71,12 +62,12 @@ install ::
 # /shared directory by default because it is guaranteed to be local to the
 # current machine.
 #
-ifdef BUILD_ROOT
-BUILD_ROOT_TOP := $(LEVEL)
+ifeq ($(LLVM_OBJ_DIR),.)
+BUILD_ROOT     = $(LLVM_OBJ_DIR)
+BUILD_ROOT_TOP = $(LEVEL)
 else
 
-LOGIN_NAME := $(shell whoami)
-BUILD_ROOT := $(BUILD_DIR)
+BUILD_ROOT := $(LLVM_OBJ_DIR)$(patsubst $(HOME)%,%,$(shell pwd))
 
 # 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
@@ -85,22 +76,20 @@ BUILD_ROOT := $(BUILD_DIR)
 # the directory to eliminate the ../'s
 #
 TOP_DIRECTORY := $(shell cd $(LEVEL); pwd)
-BUILD_ROOT_TOP := /shared/$(LOGIN_NAME)$(patsubst $(HOME)%,%,$(TOP_DIRECTORY))
+BUILD_ROOT_TOP := $(LLVM_OBJ_DIR)$(patsubst $(HOME)%,%,$(TOP_DIRECTORY))
 endif
 
 #--------------------------------------------------------------------
-# Installation configuration options... 
+# Variables derived from configuration options... 
 #--------------------------------------------------------------------
 
 #BinInstDir=/usr/local/bin
 #LibInstDir=/usrl/local/lib/xxx
 #DocInstDir=/usr/doc/xxx
 
-BURG = /home/vadve/vadve/Research/DynOpt/Burg/burg
 BURG_OPTS = -I
 
-
-PURIFY = /usr/dcs/applications/purify/bin/purify -cache-dir="$(BUILD_ROOT_TOP)/../purifycache" -chain-length="30" -messages=all 
+PURIFY := $(PURIFY) -cache-dir="$(BUILD_ROOT_TOP)/../purifycache" -chain-length="30" -messages=all 
 
 # Shorthand for commonly accessed directories
 LIBDEBUG    := $(BUILD_ROOT_TOP)/lib/Debug