summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNAKAMURA Takumi <geek4civic@gmail.com>2011-10-16 02:54:19 +0000
committerNAKAMURA Takumi <geek4civic@gmail.com>2011-10-16 02:54:19 +0000
commit2c1a4cce4ccff6f94bdd16f7720378359a82ebdd (patch)
treec35d9df52d41c2cadd103057ad99011ac48f7049
parent4f539312df06e92e063e8c77a654d62ed617bef3 (diff)
downloadbcm5719-llvm-2c1a4cce4ccff6f94bdd16f7720378359a82ebdd.tar.gz
bcm5719-llvm-2c1a4cce4ccff6f94bdd16f7720378359a82ebdd.zip
Makefile.rules: Let OPTIONAL_PARALLEL_DIRS accept out-of-tree absolute path.
llvm-svn: 142101
-rw-r--r--llvm/Makefile.rules21
1 files changed, 14 insertions, 7 deletions
diff --git a/llvm/Makefile.rules b/llvm/Makefile.rules
index d057f043ff6..54c378054b0 100644
--- a/llvm/Makefile.rules
+++ b/llvm/Makefile.rules
@@ -806,7 +806,7 @@ endif
# Handle the OPTIONAL_PARALLEL_DIRS options for optional parallel construction
#-----------------------------------------------------------
ifdef OPTIONAL_PARALLEL_DIRS
- PARALLEL_DIRS += $(foreach T,$(OPTIONAL_PARALLEL_DIRS),$(shell test -d $(PROJ_SRC_DIR)/$(T) && echo "$(T)"))
+ PARALLEL_DIRS += $(foreach T,$(OPTIONAL_PARALLEL_DIRS),$(shell test -d $(PROJ_SRC_DIR)/$(T) -o -f $(T)/Makefile && echo "$(T)"))
endif
#-----------------------------------------------------------
@@ -828,13 +828,20 @@ unitcheck:: $(addsuffix /.makeunitcheck,$(PARALLEL_DIRS))
ParallelTargets := $(foreach T,$(RecursiveTargets),%/.make$(T))
$(ParallelTargets) :
- $(Verb) if ([ ! -f $(@D)/Makefile ] || \
- command test $(@D)/Makefile -ot \
- $(PROJ_SRC_DIR)/$(@D)/Makefile ); then \
- $(MKDIR) $(@D); \
- $(CP) $(PROJ_SRC_DIR)/$(@D)/Makefile $(@D)/Makefile; \
+ $(Verb) \
+ SD=$(PROJ_SRC_DIR)/$(@D); \
+ DD=$(@D); \
+ if [ ! -f $$SD/Makefile ]; then \
+ SD=$(@D); \
+ DD=$(notdir $(@D)); \
+ fi; \
+ if ([ ! -f $$DD/Makefile ] || \
+ command test $$DD/Makefile -ot \
+ $$SD/Makefile ); then \
+ $(MKDIR) $$DD; \
+ $(CP) $$SD/Makefile $$DD/Makefile; \
fi; \
- $(MAKE) -C $(@D) $(subst $(@D)/.make,,$@)
+ $(MAKE) -C $$DD $(subst $(@D)/.make,,$@)
endif
#---------------------------------------------------------
OpenPOWER on IntegriCloud