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 23.include "${SRCTOP}/lib/clang/llvm.pre.mk" 24 25CFLAGS+= -I${LLD_SRCS}/ELF 26CFLAGS+= -I${LLD_SRCS}/include 27CFLAGS+= -I${.OBJDIR} 28CFLAGS+= -I${OBJTOP}/lib/clang/libllvm 29 30SRCDIR= lld 31SRCS+= Common/Args.cpp 32SRCS+= Common/CommonLinkerContext.cpp 33SRCS+= Common/DWARF.cpp 34SRCS+= Common/ErrorHandler.cpp 35SRCS+= Common/Filesystem.cpp 36SRCS+= Common/Memory.cpp 37SRCS+= Common/Reproduce.cpp 38SRCS+= Common/Strings.cpp 39SRCS+= Common/TargetOptionsCommandFlags.cpp 40SRCS+= Common/Version.cpp 41SRCS+= ELF/AArch64ErrataFix.cpp 42SRCS+= ELF/ARMErrataFix.cpp 43SRCS+= ELF/Arch/AArch64.cpp 44SRCS+= ELF/Arch/AMDGPU.cpp 45SRCS+= ELF/Arch/ARM.cpp 46SRCS+= ELF/Arch/AVR.cpp 47SRCS+= ELF/Arch/Hexagon.cpp 48SRCS+= ELF/Arch/MSP430.cpp 49SRCS+= ELF/Arch/Mips.cpp 50SRCS+= ELF/Arch/MipsArchTree.cpp 51SRCS+= ELF/Arch/PPC.cpp 52SRCS+= ELF/Arch/PPC64.cpp 53SRCS+= ELF/Arch/RISCV.cpp 54SRCS+= ELF/Arch/SPARCV9.cpp 55SRCS+= ELF/Arch/X86.cpp 56SRCS+= ELF/Arch/X86_64.cpp 57SRCS+= ELF/CallGraphSort.cpp 58SRCS+= ELF/DWARF.cpp 59SRCS+= ELF/Driver.cpp 60SRCS+= ELF/DriverUtils.cpp 61SRCS+= ELF/EhFrame.cpp 62SRCS+= ELF/ICF.cpp 63SRCS+= ELF/InputFiles.cpp 64SRCS+= ELF/InputSection.cpp 65SRCS+= ELF/LTO.cpp 66SRCS+= ELF/LinkerScript.cpp 67SRCS+= ELF/MapFile.cpp 68SRCS+= ELF/MarkLive.cpp 69SRCS+= ELF/OutputSections.cpp 70SRCS+= ELF/Relocations.cpp 71SRCS+= ELF/ScriptLexer.cpp 72SRCS+= ELF/ScriptParser.cpp 73SRCS+= ELF/SymbolTable.cpp 74SRCS+= ELF/Symbols.cpp 75SRCS+= ELF/SyntheticSections.cpp 76SRCS+= ELF/Target.cpp 77SRCS+= ELF/Thunks.cpp 78SRCS+= ELF/Writer.cpp 79SRCS+= tools/lld/lld.cpp 80 81.include "${SRCTOP}/lib/clang/llvm.build.mk" 82 83LIBDEPS+= llvm 84 85.for lib in ${LIBDEPS} 86DPADD+= ${OBJTOP}/lib/clang/lib${lib}/lib${lib}.a 87LDADD+= ${OBJTOP}/lib/clang/lib${lib}/lib${lib}.a 88.endfor 89 90INCFILE= Options.inc 91TDFILE= ${LLD_SRCS}/ELF/Options.td 92GENOPT= -gen-opt-parser-defs 93${INCFILE}: ${TDFILE} 94 ${LLVM_TBLGEN} ${GENOPT} -I ${LLVM_SRCS}/include -d ${.TARGET:C/$/.d/} \ 95 -o ${.TARGET} ${TDFILE} 96TGHDRS+= ${INCFILE} 97 98DEPENDFILES+= ${TGHDRS:C/$/.d/} 99DPSRCS+= ${TGHDRS} 100CLEANFILES+= ${TGHDRS} ${TGHDRS:C/$/.d/} 101 102.if ${.MAKE.OS} == "FreeBSD" || !defined(BOOTSTRAPPING) 103LIBADD+= execinfo 104LIBADD+= tinfow 105.endif 106LIBADD+= pthread 107LIBADD+= z 108 109.include <bsd.prog.mk> 110