1# $FreeBSD$ 2 3.include <src.opts.mk> 4 5LLVM_BASE= ${SRCTOP}/contrib/llvm-project 6LLVM_SRCS= ${LLVM_BASE}/llvm 7LLD_SRCS= ${LLVM_BASE}/lld 8 9PACKAGE= lld 10PROG_CXX= ld.lld 11# Man page directory 12.PATH: ${LLD_SRCS}/docs 13.if (!defined(TOOLS_PREFIX) && ${MK_LLD_IS_LD} != "no") || \ 14 (defined(TOOLS_PREFIX) && ${MK_LLD_BOOTSTRAP} != "no") 15SYMLINKS= ${PROG_CXX} ${BINDIR}/ld 16MLINKS= ld.lld.1 ld.1 17.endif 18 19.if ${MK_SHARED_TOOLCHAIN} == "no" 20NO_SHARED?= yes 21.endif 22 23CFLAGS+= -I${LLD_SRCS}/ELF 24CFLAGS+= -I${LLD_SRCS}/include 25CFLAGS+= -I${.OBJDIR} 26CFLAGS+= -I${OBJTOP}/lib/clang/libllvm 27 28SRCDIR= lld 29SRCS+= Common/Args.cpp 30SRCS+= Common/DWARF.cpp 31SRCS+= Common/ErrorHandler.cpp 32SRCS+= Common/Filesystem.cpp 33SRCS+= Common/Memory.cpp 34SRCS+= Common/Reproduce.cpp 35SRCS+= Common/Strings.cpp 36SRCS+= Common/TargetOptionsCommandFlags.cpp 37SRCS+= Common/Threads.cpp 38SRCS+= Common/Version.cpp 39SRCS+= ELF/AArch64ErrataFix.cpp 40SRCS+= ELF/ARMErrataFix.cpp 41SRCS+= ELF/Arch/AArch64.cpp 42SRCS+= ELF/Arch/AMDGPU.cpp 43SRCS+= ELF/Arch/ARM.cpp 44SRCS+= ELF/Arch/AVR.cpp 45SRCS+= ELF/Arch/Hexagon.cpp 46SRCS+= ELF/Arch/MSP430.cpp 47SRCS+= ELF/Arch/Mips.cpp 48SRCS+= ELF/Arch/MipsArchTree.cpp 49SRCS+= ELF/Arch/PPC.cpp 50SRCS+= ELF/Arch/PPC64.cpp 51SRCS+= ELF/Arch/RISCV.cpp 52SRCS+= ELF/Arch/SPARCV9.cpp 53SRCS+= ELF/Arch/X86.cpp 54SRCS+= ELF/Arch/X86_64.cpp 55SRCS+= ELF/CallGraphSort.cpp 56SRCS+= ELF/DWARF.cpp 57SRCS+= ELF/Driver.cpp 58SRCS+= ELF/DriverUtils.cpp 59SRCS+= ELF/EhFrame.cpp 60SRCS+= ELF/ICF.cpp 61SRCS+= ELF/InputFiles.cpp 62SRCS+= ELF/InputSection.cpp 63SRCS+= ELF/LTO.cpp 64SRCS+= ELF/LinkerScript.cpp 65SRCS+= ELF/MapFile.cpp 66SRCS+= ELF/MarkLive.cpp 67SRCS+= ELF/OutputSections.cpp 68SRCS+= ELF/Relocations.cpp 69SRCS+= ELF/ScriptLexer.cpp 70SRCS+= ELF/ScriptParser.cpp 71SRCS+= ELF/SymbolTable.cpp 72SRCS+= ELF/Symbols.cpp 73SRCS+= ELF/SyntheticSections.cpp 74SRCS+= ELF/Target.cpp 75SRCS+= ELF/Thunks.cpp 76SRCS+= ELF/Writer.cpp 77SRCS+= lib/Core/Error.cpp 78SRCS+= lib/Core/File.cpp 79SRCS+= lib/Core/LinkingContext.cpp 80SRCS+= lib/Core/Reader.cpp 81SRCS+= lib/Core/Resolver.cpp 82SRCS+= lib/Core/SymbolTable.cpp 83SRCS+= tools/lld/lld.cpp 84 85.include "${SRCTOP}/lib/clang/llvm.build.mk" 86 87LIBDEPS+= llvm 88 89.for lib in ${LIBDEPS} 90DPADD+= ${OBJTOP}/lib/clang/lib${lib}/lib${lib}.a 91LDADD+= ${OBJTOP}/lib/clang/lib${lib}/lib${lib}.a 92.endfor 93 94LLVM_TBLGEN?= llvm-tblgen 95INCFILE= Options.inc 96TDFILE= ${LLD_SRCS}/ELF/Options.td 97GENOPT= -gen-opt-parser-defs 98${INCFILE}: ${TDFILE} 99 ${LLVM_TBLGEN} ${GENOPT} -I ${LLVM_SRCS}/include -d ${.TARGET:C/$/.d/} \ 100 -o ${.TARGET} ${TDFILE} 101TGHDRS+= ${INCFILE} 102 103DPSRCS+= ${TGHDRS} 104CLEANFILES+= ${TGHDRS} ${TGHDRS:C/$/.d/} 105 106LIBADD+= execinfo 107LIBADD+= ncursesw 108LIBADD+= pthread 109LIBADD+= z 110 111.include <bsd.prog.mk> 112