]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - usr.bin/clang/lld/Makefile
Merge llvm, clang, lld, lldb, compiler-rt and libc++ r305575, and update
[FreeBSD/FreeBSD.git] / usr.bin / clang / lld / Makefile
1 # $FreeBSD$
2
3 .include <src.opts.mk>
4
5 LLVM_SRCS=      ${SRCTOP}/contrib/llvm
6 LLD_SRCS=       ${LLVM_SRCS}/tools/lld
7
8 PACKAGE=        lld
9 PROG_CXX=       ld.lld
10 MAN=
11 .if ${MK_LLD_IS_LD} != "no"
12 SYMLINKS=       ${PROG_CXX} ${BINDIR}/ld
13 .endif
14
15 CFLAGS+=        -I${LLD_SRCS}/ELF
16 CFLAGS+=        -I${LLD_SRCS}/include
17 CFLAGS+=        -I${.OBJDIR}
18 CFLAGS+=        -I${OBJTOP}/lib/clang/libllvm
19
20 SRCDIR=         tools/lld
21 SRCS+=          ELF/Arch/AArch64.cpp
22 SRCS+=          ELF/Arch/AMDGPU.cpp
23 SRCS+=          ELF/Arch/ARM.cpp
24 SRCS+=          ELF/Arch/AVR.cpp
25 SRCS+=          ELF/Arch/Mips.cpp
26 SRCS+=          ELF/Arch/PPC.cpp
27 SRCS+=          ELF/Arch/PPC64.cpp
28 SRCS+=          ELF/Arch/X86.cpp
29 SRCS+=          ELF/Arch/X86_64.cpp
30 SRCS+=          ELF/Driver.cpp
31 SRCS+=          ELF/DriverUtils.cpp
32 SRCS+=          ELF/EhFrame.cpp
33 SRCS+=          ELF/Error.cpp
34 SRCS+=          ELF/Filesystem.cpp
35 SRCS+=          ELF/GdbIndex.cpp
36 SRCS+=          ELF/ICF.cpp
37 SRCS+=          ELF/InputFiles.cpp
38 SRCS+=          ELF/InputSection.cpp
39 SRCS+=          ELF/LTO.cpp
40 SRCS+=          ELF/LinkerScript.cpp
41 SRCS+=          ELF/MapFile.cpp
42 SRCS+=          ELF/MarkLive.cpp
43 SRCS+=          ELF/Mips.cpp
44 SRCS+=          ELF/OutputSections.cpp
45 SRCS+=          ELF/Relocations.cpp
46 SRCS+=          ELF/ScriptLexer.cpp
47 SRCS+=          ELF/ScriptParser.cpp
48 SRCS+=          ELF/Strings.cpp
49 SRCS+=          ELF/SymbolTable.cpp
50 SRCS+=          ELF/Symbols.cpp
51 SRCS+=          ELF/SyntheticSections.cpp
52 SRCS+=          ELF/Target.cpp
53 SRCS+=          ELF/Thunks.cpp
54 SRCS+=          ELF/Writer.cpp
55 SRCS+=          lib/Config/Version.cpp
56 SRCS+=          lib/Core/Error.cpp
57 SRCS+=          lib/Core/File.cpp
58 SRCS+=          lib/Core/LinkingContext.cpp
59 SRCS+=          lib/Core/Reader.cpp
60 SRCS+=          lib/Core/Reproduce.cpp
61 SRCS+=          lib/Core/Resolver.cpp
62 SRCS+=          lib/Core/SymbolTable.cpp
63 SRCS+=          lib/Core/TargetOptionsCommandFlags.cpp
64 SRCS+=          tools/lld/lld.cpp
65
66 .include "${SRCTOP}/lib/clang/llvm.build.mk"
67
68 LIBDEPS+=       llvm
69
70 .for lib in ${LIBDEPS}
71 DPADD+=         ${OBJTOP}/lib/clang/lib${lib}/lib${lib}.a
72 LDADD+=         ${OBJTOP}/lib/clang/lib${lib}/lib${lib}.a
73 .endfor
74
75 LLVM_TBLGEN?=   llvm-tblgen
76 ELF/Options.inc: ${LLD_SRCS}/ELF/Options.td
77         ${LLVM_TBLGEN} -gen-opt-parser-defs \
78             -I ${LLVM_SRCS}/include \
79             -d ${.TARGET:C/$/.d/} -o ${.TARGET} \
80             ${LLVM_SRCS}/tools/lld/ELF/Options.td
81 TGHDRS+=        ELF/Options.inc
82
83 DPSRCS+=        ${TGHDRS}
84 CLEANFILES+=    ${TGHDRS} ${TGHDRS:C/$/.d/}
85
86 LIBADD+=        ncursesw
87 LIBADD+=        pthread
88 LIBADD+=        z
89
90 .include <bsd.prog.mk>