From 472aa0fb84246beec075f8a8967590abd81941f1 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Wed, 26 Jul 2006 20:22:26 +0000 Subject: [PATCH] Reduce work done for directory traversal in srcdir==objdir builds. llvm-svn: 29300 --- Makefile.rules | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Makefile.rules b/Makefile.rules index 779e0a6933b..eee01eee60e 100644 --- a/Makefile.rules +++ b/Makefile.rules @@ -487,6 +487,8 @@ $(PROJ_etcdir): $(PROJ_etcdir)/.dir SubDirs := ifdef DIRS SubDirs += $(DIRS) + +ifneq ($(PROJ_SRC_ROOT),$(PROJ_OBJ_ROOT)) $(RecursiveTargets):: $(Verb) for dir in $(DIRS); do \ if [ ! -f $$dir/Makefile ]; then \ @@ -495,6 +497,13 @@ $(RecursiveTargets):: fi; \ ($(MAKE) -C $$dir $@ ) || exit 1; \ done +else +$(RecursiveTargets):: + $(Verb) for dir in $(DIRS); do \ + ($(MAKE) -C $$dir $@ ) || exit 1; \ + done +endif + endif #--------------------------------------------------------- @@ -545,6 +554,7 @@ ifdef OPTIONAL_DIRS SubDirs += $(OPTIONAL_DIRS) +ifneq ($(PROJ_SRC_ROOT),$(PROJ_OBJ_ROOT)) $(RecursiveTargets):: $(Verb) for dir in $(OPTIONAL_DIRS); do \ if [ -d $(PROJ_SRC_DIR)/$$dir ]; then\ @@ -555,6 +565,12 @@ $(RecursiveTargets):: ($(MAKE) -C$$dir $@ ) || exit 1; \ fi \ done +else +$(RecursiveTargets):: + $(Verb) for dir in $(OPTIONAL_DIRS); do \ + ($(MAKE) -C$$dir $@ ) || exit 1; \ + done +endif endif #---------------------------------------------------------