* Remove some bogus dependencies on Depend/.dir

* Build into the machine local /shared directory instead of using local
  Debug/Depend/Release directories


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3269 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2002-08-09 15:41:55 +00:00
parent 38c633d8fc
commit e16b1b492d
2 changed files with 70 additions and 38 deletions

View File

@ -41,6 +41,10 @@
# #
#ENABLE_OPTIMIZED = 1 #ENABLE_OPTIMIZED = 1
# If you do not want to build into /shared, uncomment this
#
#BUILD_ROOT = .
ifdef SHARED_LIBRARY ifdef SHARED_LIBRARY
# if SHARED_LIBRARY is specified, the default is to build the dynamic lib # if SHARED_LIBRARY is specified, the default is to build the dynamic lib
dynamic :: dynamic ::
@ -52,6 +56,17 @@ all ::
# Default for install is to at least build everything... # Default for install is to at least build everything...
install :: install ::
# Figure out which directory to build stuff into. We want to build into the
# /shared directory by default because it is guaranteed to be local to the
# current machine.
#
ifndef BUILD_ROOT
LOGIN_NAME := $(shell whoami)
CUR_DIRECTORY := $(shell pwd)
BUILD_ROOT := /shared/$(LOGIN_NAME)$(patsubst $(HOME)%,%,$(CUR_DIRECTORY))
endif
#-------------------------------------------------------------------- #--------------------------------------------------------------------
# Installation configuration options... # Installation configuration options...
#-------------------------------------------------------------------- #--------------------------------------------------------------------
@ -67,10 +82,10 @@ BURG_OPTS = -I
PURIFY = /usr/dcs/applications/purify/bin/purify -cache-dir="$(HOME)/purifycache" -chain-length="30" -messages=all PURIFY = /usr/dcs/applications/purify/bin/purify -cache-dir="$(HOME)/purifycache" -chain-length="30" -messages=all
# Shorthand for commonly accessed directories # Shorthand for commonly accessed directories
LIBDEBUG = $(LEVEL)/lib/Debug LIBDEBUG = $(BUILD_ROOT)/$(LEVEL)/lib/Debug
LIBRELEASE = $(LEVEL)/lib/Release LIBRELEASE = $(BUILD_ROOT)/$(LEVEL)/lib/Release
TOOLDEBUG = $(LEVEL)/tools/Debug TOOLDEBUG = $(BUILD_ROOT)/$(LEVEL)/tools/Debug
TOOLRELEASE = $(LEVEL)/tools/Release TOOLRELEASE = $(BUILD_ROOT)/$(LEVEL)/tools/Release
#--------------------------------------------------------- #---------------------------------------------------------
# Compilation options... # Compilation options...
@ -128,8 +143,8 @@ MakeLib = $(AR)
Source := $(ExtraSource) $(wildcard *.cpp *.c *.y *.l) Source := $(ExtraSource) $(wildcard *.cpp *.c *.y *.l)
Objs := $(sort $(patsubst Debug/%.o, %.o, $(addsuffix .o,$(basename $(Source))))) Objs := $(sort $(patsubst Debug/%.o, %.o, $(addsuffix .o,$(basename $(Source)))))
ObjectsO = $(addprefix Release/,$(Objs)) ObjectsO = $(addprefix $(BUILD_ROOT)/Release/,$(Objs)))
ObjectsG = $(addprefix Debug/,$(Objs)) ObjectsG = $(addprefix $(BUILD_ROOT)/Debug/,$(Objs))
#--------------------------------------------------------- #---------------------------------------------------------
@ -198,28 +213,28 @@ all:: $(BUILD_LIBNAME_AG) $(BUILD_LIBNAME_OBJG) # Debug
all:: $(BUILD_LIBNAME_AO) $(BUILD_LIBNAME_OBJO) # Release all:: $(BUILD_LIBNAME_AO) $(BUILD_LIBNAME_OBJO) # Release
dynamic:: $(BUILD_LIBNAME_G) $(BUILD_LIBNAME_O) # .so files dynamic:: $(BUILD_LIBNAME_G) $(BUILD_LIBNAME_O) # .so files
$(LIBNAME_O): $(ObjectsO) $(LibSubDirs) $(LIBRELEASE)/.dir Depend/.dir $(LIBNAME_O): $(ObjectsO) $(LibSubDirs) $(LIBRELEASE)/.dir
@echo ======= Linking $(LIBRARYNAME) release library ======= @echo ======= Linking $(LIBRARYNAME) release library =======
$(MakeSOO) -o $@ $(ObjectsO) $(LibSubDirs) $(LibLinkOpts) $(MakeSOO) -o $@ $(ObjectsO) $(LibSubDirs) $(LibLinkOpts)
$(LIBNAME_G): $(ObjectsG) $(LibSubDirs) $(LIBDEBUG)/.dir Depend/.dir $(LIBNAME_G): $(ObjectsG) $(LibSubDirs) $(LIBDEBUG)/.dir
@echo ======= Linking $(LIBRARYNAME) debug library ======= @echo ======= Linking $(LIBRARYNAME) debug library =======
$(MakeSO) -g -o $@ $(ObjectsG) $(LibSubDirs) $(LibLinkOpts) $(MakeSO) -g -o $@ $(ObjectsG) $(LibSubDirs) $(LibLinkOpts)
$(LIBNAME_AO): $(ObjectsO) $(LibSubDirs) $(LIBRELEASE)/.dir Depend/.dir $(LIBNAME_AO): $(ObjectsO) $(LibSubDirs) $(LIBRELEASE)/.dir
@echo ======= Linking $(LIBRARYNAME) release library ======= @echo ======= Linking $(LIBRARYNAME) release library =======
@rm -f $@ @rm -f $@
$(MakeLib) $@ $(ObjectsO) $(LibSubDirs) $(MakeLib) $@ $(ObjectsO) $(LibSubDirs)
$(LIBNAME_AG): $(ObjectsG) $(LibSubDirs) $(LIBDEBUG)/.dir Depend/.dir $(LIBNAME_AG): $(ObjectsG) $(LibSubDirs) $(LIBDEBUG)/.dir
@echo ======= Linking $(LIBRARYNAME) debug library ======= @echo ======= Linking $(LIBRARYNAME) debug library =======
@rm -f $@ @rm -f $@
$(MakeLib) $@ $(ObjectsG) $(LibSubDirs) $(MakeLib) $@ $(ObjectsG) $(LibSubDirs)
$(LIBNAME_OBJO): $(ObjectsO) $(LibSubDirs) $(LIBRELEASE)/.dir Depend/.dir $(LIBNAME_OBJO): $(ObjectsO) $(LibSubDirs) $(LIBRELEASE)/.dir
$(Relink) -o $@ $(ObjectsO) $(LibSubDirs) $(Relink) -o $@ $(ObjectsO) $(LibSubDirs)
$(LIBNAME_OBJG): $(ObjectsG) $(LibSubDirs) $(LIBDEBUG)/.dir Depend/.dir $(LIBNAME_OBJG): $(ObjectsG) $(LibSubDirs) $(LIBDEBUG)/.dir
$(Relink) -o $@ $(ObjectsG) $(LibSubDirs) $(Relink) -o $@ $(ObjectsG) $(LibSubDirs)
endif endif
@ -282,27 +297,28 @@ endif
#--------------------------------------------------------- #---------------------------------------------------------
.PRECIOUS: Depend/.dir Debug/.dir Release/.dir .PRECIOUS: $(BUILD_ROOT)/Depend/.dir
.PRECIOUS: $(BUILD_ROOT)/Debug/.dir $(BUILD_ROOT)/Release/.dir
# Create dependencies for the *.cpp files... # Create dependencies for the *.cpp files...
Depend/%.d: %.cpp Depend/.dir $(BUILD_ROOT)/Depend/%.d: %.cpp $(BUILD_ROOT)/Depend/.dir
$(Depend) $< | sed 's|$*\.o *|Release/& Debug/& Depend/$(@F)|g' > $@ $(Depend) $< | sed 's|$*\.o *|Release/& Debug/& Depend/$(@F)|g' > $@
# Create dependencies for the *.c files... # Create dependencies for the *.c files...
Depend/%.d: %.c Depend/.dir $(BUILD_ROOT)/Depend/%.d: %.c $(BUILD_ROOT)/Depend/.dir
$(Depend) $< | sed 's|$*\.o *|Release/& Debug/& Depend/$(@F)|g' > $@ $(Depend) $< | sed 's|$*\.o *|Release/& Debug/& Depend/$(@F)|g' > $@
# Create .o files in the ObjectFiles directory from the .cpp and .c files... # Create .o files in the ObjectFiles directory from the .cpp and .c files...
Release/%.o: %.cpp Release/.dir Depend/.dir $(BUILD_ROOT)/Release/%.o: %.cpp $(BUILD_ROOT)/Release/.dir
$(CompileO) $< -o $@ $(CompileO) $< -o $@
#Release/%.o: %.c Release/.dir Depend/.dir #Release/%.o: %.c Release/.dir Depend/.dir
# $(CompileOC) $< -o $@ # $(CompileOC) $< -o $@
Debug/%.o: %.cpp Debug/.dir Depend/.dir $(BUILD_ROOT)/Debug/%.o: %.cpp $(BUILD_ROOT)/Debug/.dir
$(CompileG) $< -o $@ $(CompileG) $< -o $@
#Debug/%.o: %.c Debug/.dir Depend/.dir #Debug/%.o: %.c Debug/.dir
# $(CompileGC) $< -o $@ # $(CompileGC) $< -o $@
# Create a .cpp source file from a flex input file... this uses sed to cut down # Create a .cpp source file from a flex input file... this uses sed to cut down
@ -330,7 +346,7 @@ clean::
# If dependancies were generated for the file that included this file, # If dependancies were generated for the file that included this file,
# include the dependancies now... # include the dependancies now...
# #
SourceDepend = $(addsuffix .d,$(addprefix Depend/,$(basename $(filter-out Debug/%, $(Source))))) SourceDepend = $(addsuffix .d,$(addprefix $(BUILD_ROOT)/Depend/,$(basename $(filter-out Debug/%, $(Source)))))
ifneq ($(SourceDepend),) ifneq ($(SourceDepend),)
include $(SourceDepend) include $(SourceDepend)
endif endif

View File

@ -41,6 +41,10 @@
# #
#ENABLE_OPTIMIZED = 1 #ENABLE_OPTIMIZED = 1
# If you do not want to build into /shared, uncomment this
#
#BUILD_ROOT = .
ifdef SHARED_LIBRARY ifdef SHARED_LIBRARY
# if SHARED_LIBRARY is specified, the default is to build the dynamic lib # if SHARED_LIBRARY is specified, the default is to build the dynamic lib
dynamic :: dynamic ::
@ -52,6 +56,17 @@ all ::
# Default for install is to at least build everything... # Default for install is to at least build everything...
install :: install ::
# Figure out which directory to build stuff into. We want to build into the
# /shared directory by default because it is guaranteed to be local to the
# current machine.
#
ifndef BUILD_ROOT
LOGIN_NAME := $(shell whoami)
CUR_DIRECTORY := $(shell pwd)
BUILD_ROOT := /shared/$(LOGIN_NAME)$(patsubst $(HOME)%,%,$(CUR_DIRECTORY))
endif
#-------------------------------------------------------------------- #--------------------------------------------------------------------
# Installation configuration options... # Installation configuration options...
#-------------------------------------------------------------------- #--------------------------------------------------------------------
@ -67,10 +82,10 @@ BURG_OPTS = -I
PURIFY = /usr/dcs/applications/purify/bin/purify -cache-dir="$(HOME)/purifycache" -chain-length="30" -messages=all PURIFY = /usr/dcs/applications/purify/bin/purify -cache-dir="$(HOME)/purifycache" -chain-length="30" -messages=all
# Shorthand for commonly accessed directories # Shorthand for commonly accessed directories
LIBDEBUG = $(LEVEL)/lib/Debug LIBDEBUG = $(BUILD_ROOT)/$(LEVEL)/lib/Debug
LIBRELEASE = $(LEVEL)/lib/Release LIBRELEASE = $(BUILD_ROOT)/$(LEVEL)/lib/Release
TOOLDEBUG = $(LEVEL)/tools/Debug TOOLDEBUG = $(BUILD_ROOT)/$(LEVEL)/tools/Debug
TOOLRELEASE = $(LEVEL)/tools/Release TOOLRELEASE = $(BUILD_ROOT)/$(LEVEL)/tools/Release
#--------------------------------------------------------- #---------------------------------------------------------
# Compilation options... # Compilation options...
@ -128,8 +143,8 @@ MakeLib = $(AR)
Source := $(ExtraSource) $(wildcard *.cpp *.c *.y *.l) Source := $(ExtraSource) $(wildcard *.cpp *.c *.y *.l)
Objs := $(sort $(patsubst Debug/%.o, %.o, $(addsuffix .o,$(basename $(Source))))) Objs := $(sort $(patsubst Debug/%.o, %.o, $(addsuffix .o,$(basename $(Source)))))
ObjectsO = $(addprefix Release/,$(Objs)) ObjectsO = $(addprefix $(BUILD_ROOT)/Release/,$(Objs)))
ObjectsG = $(addprefix Debug/,$(Objs)) ObjectsG = $(addprefix $(BUILD_ROOT)/Debug/,$(Objs))
#--------------------------------------------------------- #---------------------------------------------------------
@ -198,28 +213,28 @@ all:: $(BUILD_LIBNAME_AG) $(BUILD_LIBNAME_OBJG) # Debug
all:: $(BUILD_LIBNAME_AO) $(BUILD_LIBNAME_OBJO) # Release all:: $(BUILD_LIBNAME_AO) $(BUILD_LIBNAME_OBJO) # Release
dynamic:: $(BUILD_LIBNAME_G) $(BUILD_LIBNAME_O) # .so files dynamic:: $(BUILD_LIBNAME_G) $(BUILD_LIBNAME_O) # .so files
$(LIBNAME_O): $(ObjectsO) $(LibSubDirs) $(LIBRELEASE)/.dir Depend/.dir $(LIBNAME_O): $(ObjectsO) $(LibSubDirs) $(LIBRELEASE)/.dir
@echo ======= Linking $(LIBRARYNAME) release library ======= @echo ======= Linking $(LIBRARYNAME) release library =======
$(MakeSOO) -o $@ $(ObjectsO) $(LibSubDirs) $(LibLinkOpts) $(MakeSOO) -o $@ $(ObjectsO) $(LibSubDirs) $(LibLinkOpts)
$(LIBNAME_G): $(ObjectsG) $(LibSubDirs) $(LIBDEBUG)/.dir Depend/.dir $(LIBNAME_G): $(ObjectsG) $(LibSubDirs) $(LIBDEBUG)/.dir
@echo ======= Linking $(LIBRARYNAME) debug library ======= @echo ======= Linking $(LIBRARYNAME) debug library =======
$(MakeSO) -g -o $@ $(ObjectsG) $(LibSubDirs) $(LibLinkOpts) $(MakeSO) -g -o $@ $(ObjectsG) $(LibSubDirs) $(LibLinkOpts)
$(LIBNAME_AO): $(ObjectsO) $(LibSubDirs) $(LIBRELEASE)/.dir Depend/.dir $(LIBNAME_AO): $(ObjectsO) $(LibSubDirs) $(LIBRELEASE)/.dir
@echo ======= Linking $(LIBRARYNAME) release library ======= @echo ======= Linking $(LIBRARYNAME) release library =======
@rm -f $@ @rm -f $@
$(MakeLib) $@ $(ObjectsO) $(LibSubDirs) $(MakeLib) $@ $(ObjectsO) $(LibSubDirs)
$(LIBNAME_AG): $(ObjectsG) $(LibSubDirs) $(LIBDEBUG)/.dir Depend/.dir $(LIBNAME_AG): $(ObjectsG) $(LibSubDirs) $(LIBDEBUG)/.dir
@echo ======= Linking $(LIBRARYNAME) debug library ======= @echo ======= Linking $(LIBRARYNAME) debug library =======
@rm -f $@ @rm -f $@
$(MakeLib) $@ $(ObjectsG) $(LibSubDirs) $(MakeLib) $@ $(ObjectsG) $(LibSubDirs)
$(LIBNAME_OBJO): $(ObjectsO) $(LibSubDirs) $(LIBRELEASE)/.dir Depend/.dir $(LIBNAME_OBJO): $(ObjectsO) $(LibSubDirs) $(LIBRELEASE)/.dir
$(Relink) -o $@ $(ObjectsO) $(LibSubDirs) $(Relink) -o $@ $(ObjectsO) $(LibSubDirs)
$(LIBNAME_OBJG): $(ObjectsG) $(LibSubDirs) $(LIBDEBUG)/.dir Depend/.dir $(LIBNAME_OBJG): $(ObjectsG) $(LibSubDirs) $(LIBDEBUG)/.dir
$(Relink) -o $@ $(ObjectsG) $(LibSubDirs) $(Relink) -o $@ $(ObjectsG) $(LibSubDirs)
endif endif
@ -282,27 +297,28 @@ endif
#--------------------------------------------------------- #---------------------------------------------------------
.PRECIOUS: Depend/.dir Debug/.dir Release/.dir .PRECIOUS: $(BUILD_ROOT)/Depend/.dir
.PRECIOUS: $(BUILD_ROOT)/Debug/.dir $(BUILD_ROOT)/Release/.dir
# Create dependencies for the *.cpp files... # Create dependencies for the *.cpp files...
Depend/%.d: %.cpp Depend/.dir $(BUILD_ROOT)/Depend/%.d: %.cpp $(BUILD_ROOT)/Depend/.dir
$(Depend) $< | sed 's|$*\.o *|Release/& Debug/& Depend/$(@F)|g' > $@ $(Depend) $< | sed 's|$*\.o *|Release/& Debug/& Depend/$(@F)|g' > $@
# Create dependencies for the *.c files... # Create dependencies for the *.c files...
Depend/%.d: %.c Depend/.dir $(BUILD_ROOT)/Depend/%.d: %.c $(BUILD_ROOT)/Depend/.dir
$(Depend) $< | sed 's|$*\.o *|Release/& Debug/& Depend/$(@F)|g' > $@ $(Depend) $< | sed 's|$*\.o *|Release/& Debug/& Depend/$(@F)|g' > $@
# Create .o files in the ObjectFiles directory from the .cpp and .c files... # Create .o files in the ObjectFiles directory from the .cpp and .c files...
Release/%.o: %.cpp Release/.dir Depend/.dir $(BUILD_ROOT)/Release/%.o: %.cpp $(BUILD_ROOT)/Release/.dir
$(CompileO) $< -o $@ $(CompileO) $< -o $@
#Release/%.o: %.c Release/.dir Depend/.dir #Release/%.o: %.c Release/.dir Depend/.dir
# $(CompileOC) $< -o $@ # $(CompileOC) $< -o $@
Debug/%.o: %.cpp Debug/.dir Depend/.dir $(BUILD_ROOT)/Debug/%.o: %.cpp $(BUILD_ROOT)/Debug/.dir
$(CompileG) $< -o $@ $(CompileG) $< -o $@
#Debug/%.o: %.c Debug/.dir Depend/.dir #Debug/%.o: %.c Debug/.dir
# $(CompileGC) $< -o $@ # $(CompileGC) $< -o $@
# Create a .cpp source file from a flex input file... this uses sed to cut down # Create a .cpp source file from a flex input file... this uses sed to cut down
@ -330,7 +346,7 @@ clean::
# If dependancies were generated for the file that included this file, # If dependancies were generated for the file that included this file,
# include the dependancies now... # include the dependancies now...
# #
SourceDepend = $(addsuffix .d,$(addprefix Depend/,$(basename $(filter-out Debug/%, $(Source))))) SourceDepend = $(addsuffix .d,$(addprefix $(BUILD_ROOT)/Depend/,$(basename $(filter-out Debug/%, $(Source)))))
ifneq ($(SourceDepend),) ifneq ($(SourceDepend),)
include $(SourceDepend) include $(SourceDepend)
endif endif