diff options
author | NAKAMURA Takumi <geek4civic@gmail.com> | 2011-10-16 02:54:19 +0000 |
---|---|---|
committer | NAKAMURA Takumi <geek4civic@gmail.com> | 2011-10-16 02:54:19 +0000 |
commit | a87a7dba537f671eceac6cb6600d6cb5354ff2e5 (patch) | |
tree | dae363e61bd95a892c1a435d3f34066d6fcbe576 | |
parent | 40a436018625d5d954d5ee172fd0731660f91b67 (diff) |
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
-rw-r--r-- | Makefile.rules | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/Makefile.rules b/Makefile.rules index d057f043ff6..54c378054b0 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 #--------------------------------------------------------- |