diff --git a/llvm/Makefile.rules b/llvm/Makefile.rules index 0d4a0c8aedf2..5bddff8e8a22 100644 --- a/llvm/Makefile.rules +++ b/llvm/Makefile.rules @@ -612,6 +612,13 @@ $(RecursiveTargets):: done 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)")) +endif + #----------------------------------------------------------- # Handle the PARALLEL_DIRS options for parallel construction #----------------------------------------------------------- diff --git a/llvm/tools/Makefile b/llvm/tools/Makefile index 2726c1f3e43e..519717ad98de 100644 --- a/llvm/tools/Makefile +++ b/llvm/tools/Makefile @@ -8,6 +8,10 @@ ##===----------------------------------------------------------------------===## LEVEL := .. + +# Build clang if present. +OPTIONAL_PARALLEL_DIRS := clang + # NOTE: The tools are organized into five groups of four consisting of one # large and three small executables. This is done to minimize memory load # in parallel builds. Please retain this ordering.