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