freebsd-dev/usr.bin/clang/Makefile
Dimitry Andric 986e05bc2a Completely revamp the way llvm, clang and lldb are built.
* Bootstrap llvm-tblgen and clang-tblgen with a minimal llvm static
  library, that has no other dependencies.
* Roll up all separate llvm libraries into one big static libllvm.
* Similar for all separate clang and lldb static libraries.
* For all these libraries, generate their .inc files only once.
* Link all llvm tools (including extra) against the big libllvm.
* Link clang and clang-format against the big libllvm and libclang.
* Link lldb against the big libllvm, libclang and liblldb.

N.B.: This is work in progress, some details may still be missing.

It also heavily depends on bsd.*.mk's support for SRCS and DPSRCS with
relative pathnames, which apparently does not always work as expected.
For building llvm, clang and lldb though, it seems to work just fine.

The main idea behind this restructuring is maintainability and build
peformance.  The previous large number of very small libraries, each
with their own generated files and dependencies was slow to traverse
and hard to understand.

Possible future improvements:
* Only build certain targets, e.g. for most regular users having just
  one target will be fine.  This will shave off some build time.
* Building the big llvm, clang and lldb libraries as shared (private)
  libraries.
* Adding other components from the LLVM project, such as lld.
2016-08-26 22:44:22 +00:00

44 lines
727 B
Makefile

# $FreeBSD$
.include <src.opts.mk>
SUBDIR+= clang
SUBDIR+= clang-tblgen
SUBDIR+= llvm-tblgen
.if !defined(TOOLS_PREFIX)
.if ${MK_CLANG_EXTRAS} != "no"
SUBDIR+= bugpoint
SUBDIR+= clang-format
SUBDIR+= llc
SUBDIR+= lli
SUBDIR+= llvm-ar
SUBDIR+= llvm-as
SUBDIR+= llvm-bcanalyzer
SUBDIR+= llvm-cov
SUBDIR+= llvm-cxxdump
SUBDIR+= llvm-diff
SUBDIR+= llvm-dis
SUBDIR+= llvm-dwarfdump
SUBDIR+= llvm-extract
SUBDIR+= llvm-link
SUBDIR+= llvm-lto
SUBDIR+= llvm-mc
SUBDIR+= llvm-nm
SUBDIR+= llvm-objdump
SUBDIR+= llvm-pdbdump
SUBDIR+= llvm-profdata
SUBDIR+= llvm-rtdyld
SUBDIR+= llvm-symbolizer
SUBDIR+= opt
.endif
.if ${MK_LLDB} != "no"
SUBDIR+= lldb
.endif # MK_LLDB
.endif # TOOLS_PREFIX
SUBDIR_PARALLEL=
.include <bsd.subdir.mk>