+# Let users override the set of tools to build from the command line.
+ifdef ONLY_TOOLS
+ OPTIONAL_PARALLEL_DIRS :=
+ OPTIONAL_DIRS := $(findstring lldb,$(ONLY_TOOLS))
+ PARALLEL_DIRS := $(filter-out lldb,$(ONLY_TOOLS))
+endif
+
+# These libraries build as dynamic libraries (.dylib /.so), they can only be
+# built if ENABLE_PIC is set.
+ifndef ONLY_TOOLS
+ifeq ($(ENABLE_PIC),1)
+ # gold only builds if binutils is around. It requires "lto" to build before
+ # it so it is added to DIRS. llvm-lto also requires lto
+ DIRS += lto llvm-lto
+ ifdef BINUTILS_INCDIR
+ DIRS += gold
+ endif