freebsd-skq/lib/clang/Makefile
dim b4a5074609 MFC r263778:
Add a SUBDIR_PARALLEL option to bsd.subdir.mk, to allow make to process
all the SUBDIR entries in parallel, instead of serially.  Apply this
option to a selected number of Makefiles, which can greatly speed up the
build on multi-core machines, when using make -j.

This can be extended to more Makefiles later on, whenever they are
verified to work correctly with parallel building.

I tested this on a 24-core machine, with make -j48 buildworld (N = 6):

		before    stddev       after    stddev
		=======   ======       =======  ======
real time        1741.1     16.5         959.8     2.7
user time       12468.7     16.4       14393.0    16.8
sys  time        1825.0     54.8        2110.6    22.8

(user+sys)/real     8.2                   17.1

E.g. the build was approximately 45% faster in real time.  On machines
with less cores, or with lower -j settings, the speedup will not be as
impressive.  But at least you can now almost max out a machine with
buildworld!

Submitted by:	jilles

MFC r263833:

Enable parallel building for gnu/usr.bin and usr.bin/clang too.
2014-04-09 18:16:58 +00:00

153 lines
3.3 KiB
Makefile

# $FreeBSD$
.include <bsd.own.mk>
.if !make(install)
.if !defined(EARLY_BUILD)
.if defined(MK_CLANG_FULL) && ${MK_CLANG_FULL} != "no"
_libclangstaticanalyzer= \
libclangstaticanalyzercheckers \
libclangstaticanalyzercore \
libclangstaticanalyzerfrontend
_libclangarcmigrate= \
libclangarcmigrate
.endif # MK_CLANG_FULL
.if (defined(MK_CLANG_FULL) && ${MK_CLANG_FULL} != "no") || \
(defined(MK_LLDB) && ${MK_LLDB} != "no")
_libclangrewriter= \
libclangrewritecore \
libclangrewritefrontend
.endif # (MK_CLANG_FULL || MK_LLDB)
.endif # !EARLY_BUILD
SUBDIR= libclanganalysis \
${_libclangarcmigrate} \
libclangast \
libclangbasic \
libclangcodegen \
libclangdriver \
libclangedit \
libclangfrontend \
libclangfrontendtool \
libclanglex \
libclangparse \
${_libclangrewriter} \
libclangsema \
libclangserialization \
${_libclangstaticanalyzer} \
\
libllvmanalysis \
libllvmasmparser \
libllvmasmprinter \
libllvmbitreader \
libllvmbitwriter \
libllvmcodegen \
libllvmcore \
libllvminstcombine \
libllvminstrumentation \
libllvmipa \
libllvmipo \
libllvmirreader \
libllvmlinker \
libllvmmc \
libllvmmcparser \
libllvmobjcarcopts \
libllvmobject \
libllvmoption \
libllvmscalaropts \
libllvmselectiondag \
libllvmsupport \
libllvmtablegen \
libllvmtarget \
libllvmtransformutils \
libllvmvectorize \
\
libllvmarmasmparser \
libllvmarmcodegen \
libllvmarmdesc \
libllvmarmdisassembler \
libllvmarminfo \
libllvmarminstprinter \
libllvmmipsasmparser \
libllvmmipscodegen \
libllvmmipsdesc \
libllvmmipsdisassembler \
libllvmmipsinfo \
libllvmmipsinstprinter \
libllvmpowerpcasmparser \
libllvmpowerpccodegen \
libllvmpowerpcdesc \
libllvmpowerpcinfo \
libllvmpowerpcinstprinter \
libllvmsparcasmparser \
libllvmsparccodegen \
libllvmsparcdesc \
libllvmsparcdisassembler \
libllvmsparcinfo \
libllvmsparcinstprinter \
libllvmx86asmparser \
libllvmx86codegen \
libllvmx86desc \
libllvmx86disassembler \
libllvmx86info \
libllvmx86instprinter \
libllvmx86utils
.if ${MK_CLANG_EXTRAS} != "no"
SUBDIR+=libllvmdebuginfo
.endif # MK_CLANG_EXTRAS
.if ${MK_CLANG_EXTRAS} != "no" || ${MK_LLDB} != "no"
SUBDIR+=libllvmexecutionengine \
libllvminterpreter \
libllvmjit \
libllvmmcdisassembler \
libllvmmcjit \
libllvmruntimedyld
.endif # MK_CLANG_EXTRAS | LLDB
.if !defined(EARLY_BUILD) && ${MK_LLDB} != "no"
SUBDIR+=liblldb \
\
liblldbAPI \
liblldbBreakpoint \
liblldbCommands \
liblldbCore \
liblldbDataFormatters \
liblldbExpression \
liblldbHostCommon \
liblldbHostFreeBSD \
liblldbInterpreter \
liblldbSymbol \
liblldbTarget \
liblldbUtility \
\
liblldbPluginABISysV_x86_64 \
liblldbPluginCXXItaniumABI \
liblldbPluginDisassemblerLLVM \
liblldbPluginDynamicLoaderStatic \
liblldbPluginDynamicLoaderPosixDYLD \
liblldbPluginInstructionARM \
liblldbPluginObjectContainerBSDArchive \
liblldbPluginObjectFileELF \
liblldbPluginPlatformFreeBSD \
liblldbPluginPlatformGDB \
liblldbPluginProcessElfCore \
liblldbPluginProcessFreeBSD \
liblldbPluginProcessGDBRemote \
liblldbPluginProcessPOSIX \
liblldbPluginProcessUtility \
liblldbPluginSymbolFileDWARF \
liblldbPluginSymbolFileSymtab \
liblldbPluginSymbolVendorELF \
liblldbPluginUnwindAssemblyInstEmulation \
liblldbPluginUnwindAssemblyX86
.endif # !EARLY_BUILD && MK_LLDB
.endif # !make(install)
SUBDIR+= include
SUBDIR_PARALLEL=
.include <bsd.subdir.mk>