[llvm-commits] [llvm] r142101 - /llvm/trunk/Makefile.rules
NAKAMURA Takumi
geek4civic at gmail.com
Sat Oct 15 19:54:19 PDT 2011
Author: chapuni
Date: Sat Oct 15 21:54:19 2011
New Revision: 142101
URL: http://llvm.org/viewvc/llvm-project?rev=142101&view=rev
Log:
Makefile.rules: Let OPTIONAL_PARALLEL_DIRS accept out-of-tree absolute path.
Modified:
llvm/trunk/Makefile.rules
Modified: llvm/trunk/Makefile.rules
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/Makefile.rules?rev=142101&r1=142100&r2=142101&view=diff
==============================================================================
--- llvm/trunk/Makefile.rules (original)
+++ llvm/trunk/Makefile.rules Sat Oct 15 21:54:19 2011
@@ -806,7 +806,7 @@
# 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 @@
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
#---------------------------------------------------------
More information about the llvm-commits
mailing list