xref: /freebsd/usr.bin/clang/lld/Makefile (revision 076ad2f836d5f49dc1375f1677335a48fe0d4b82)
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${.OBJDIR}/../../../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/ICF.cpp
25SRCS+=		ELF/InputFiles.cpp
26SRCS+=		ELF/InputSection.cpp
27SRCS+=		ELF/LinkerScript.cpp
28SRCS+=		ELF/LTO.cpp
29SRCS+=		ELF/MarkLive.cpp
30SRCS+=		ELF/OutputSections.cpp
31SRCS+=		ELF/Relocations.cpp
32SRCS+=		ELF/ScriptParser.cpp
33SRCS+=		ELF/Strings.cpp
34SRCS+=		ELF/SymbolListFile.cpp
35SRCS+=		ELF/SymbolTable.cpp
36SRCS+=		ELF/Symbols.cpp
37SRCS+=		ELF/Target.cpp
38SRCS+=		ELF/Thunks.cpp
39SRCS+=		ELF/Writer.cpp
40SRCS+=		lib/Config/Version.cpp
41SRCS+=		lib/Core/DefinedAtom.cpp
42SRCS+=		lib/Core/Error.cpp
43SRCS+=		lib/Core/File.cpp
44SRCS+=		lib/Core/LinkingContext.cpp
45SRCS+=		lib/Core/Reader.cpp
46SRCS+=		lib/Core/Resolver.cpp
47SRCS+=		lib/Core/SymbolTable.cpp
48SRCS+=		lib/Core/Writer.cpp
49SRCS+=		tools/lld/lld.cpp
50
51.include "${SRCTOP}/lib/clang/llvm.build.mk"
52
53LIBDEPS+=	llvm
54
55.for lib in ${LIBDEPS}
56DPADD+=		${OBJTOP}/lib/clang/lib${lib}/lib${lib}.a
57LDADD+=		${OBJTOP}/lib/clang/lib${lib}/lib${lib}.a
58.endfor
59
60LLVM_TBLGEN?=	llvm-tblgen
61ELF/Options.inc: ${LLD_SRCS}/ELF/Options.td
62	${LLVM_TBLGEN} -gen-opt-parser-defs \
63	    -I ${LLVM_SRCS}/include \
64	    -d ${.TARGET:C/$/.d/} -o ${.TARGET} \
65	    ${LLVM_SRCS}/tools/lld/ELF/Options.td
66TGHDRS+=	ELF/Options.inc
67
68DPSRCS+=	${TGHDRS}
69CLEANFILES+=	${TGHDRS} ${TGHDRS:C/$/.d/}
70
71LIBADD+=	ncursesw
72LIBADD+=	pthread
73LIBADD+=	z
74
75.include <bsd.prog.mk>
76