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