summaryrefslogtreecommitdiff
path: root/Makefile.rules
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
commita87a7dba537f671eceac6cb6600d6cb5354ff2e5 (patch)
treedae363e61bd95a892c1a435d3f34066d6fcbe576 /Makefile.rules
parent40a436018625d5d954d5ee172fd0731660f91b67 (diff)
downloadllvm-a87a7dba537f671eceac6cb6600d6cb5354ff2e5.tar.gz
llvm-a87a7dba537f671eceac6cb6600d6cb5354ff2e5.tar.bz2
llvm-a87a7dba537f671eceac6cb6600d6cb5354ff2e5.tar.xz
Makefile.rules: Let OPTIONAL_PARALLEL_DIRS accept out-of-tree absolute path.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142101 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'Makefile.rules')
-rw-r--r--Makefile.rules21
1 files changed, 14 insertions, 7 deletions
diff --git a/Makefile.rules b/Makefile.rules
index d057f043ff..54c378054b 100644
--- a/Makefile.rules
+++ b/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
#---------------------------------------------------------