xref: /minix3/external/bsd/llvm/link.mk (revision 4684ddb6aab0b36791c8099bc705d6140b3d05d0)
1f4a2713aSLionel Sambuc#	$NetBSD: link.mk,v 1.5 2013/09/29 12:11:59 joerg Exp $
2f4a2713aSLionel Sambuc
3f4a2713aSLionel Sambuc.include <bsd.own.mk>
4f4a2713aSLionel Sambuc
5f4a2713aSLionel Sambuc.if defined(HOSTPROG)
6f4a2713aSLionel SambucLIB_BASE=	${NETBSDSRCDIR}/tools/llvm-lib
7f4a2713aSLionel Sambuc.else
8f4a2713aSLionel SambucLIB_BASE=	${LLVM_TOPLEVEL}/lib
9f4a2713aSLionel Sambuc.endif
10f4a2713aSLionel Sambuc
11f4a2713aSLionel Sambuc.for l in ${MCLINKER_LIBS}
12f4a2713aSLionel SambucMCLINKER_OBJDIR.${l}!=	cd ${LIB_BASE}/libMCLinker${l} && ${PRINTOBJDIR}
13f4a2713aSLionel SambucLDADD+=	-L${MCLINKER_OBJDIR.${l}} -lMCLinker${l}
14f4a2713aSLionel SambucDPADD+=	${MCLINKER_OBJDIR.${l}}/libMCLinker${l}.a
15f4a2713aSLionel Sambuc.endfor
16f4a2713aSLionel Sambuc
17f4a2713aSLionel Sambuc.for l in ${LLDB_LIBS}
18f4a2713aSLionel SambucLLDB_OBJDIR.${l}!=	cd ${LIB_BASE}/liblldb${l} && ${PRINTOBJDIR}
19f4a2713aSLionel SambucLDADD+=	-L${LLDB_OBJDIR.${l}} -llldb${l}
20f4a2713aSLionel SambucDPADD+=	${LLDB_OBJDIR.${l}}/liblldb${l}.a
21f4a2713aSLionel Sambuc.endfor
22f4a2713aSLionel Sambuc
23f4a2713aSLionel Sambuc.for l in ${CLANG_LIBS}
24f4a2713aSLionel SambucCLANG_OBJDIR.${l}!=	cd ${LIB_BASE}/lib${l} && ${PRINTOBJDIR}
25f4a2713aSLionel SambucLDADD+=	-L${CLANG_OBJDIR.${l}} -l${l}
26f4a2713aSLionel SambucDPADD+=	${CLANG_OBJDIR.${l}}/lib${l}.a
27f4a2713aSLionel Sambuc.endfor
28f4a2713aSLionel Sambuc
29f4a2713aSLionel Sambuc.for l in ${LLD_LIBS}
30f4a2713aSLionel SambucLLD_OBJDIR.${l}!=	cd ${LIB_BASE}/lib${l} && ${PRINTOBJDIR}
31f4a2713aSLionel SambucLDADD+=	-L${LLD_OBJDIR.${l}} -l${l}
32f4a2713aSLionel SambucDPADD+=	${LLD_OBJDIR.${l}}/lib${l}.a
33f4a2713aSLionel Sambuc.endfor
34f4a2713aSLionel Sambuc
35f4a2713aSLionel Sambuc.for l in ${LLVM_LIBS}
36f4a2713aSLionel SambucLLVM_OBJDIR.${l}!=	cd ${LIB_BASE}/libLLVM${l} && ${PRINTOBJDIR}
37f4a2713aSLionel SambucLDADD+=	-L${LLVM_OBJDIR.${l}} -lLLVM${l}
38f4a2713aSLionel SambucDPADD+=	${LLVM_OBJDIR.${l}}/libLLVM${l}.a
39f4a2713aSLionel Sambuc.endfor
40f4a2713aSLionel Sambuc
41f4a2713aSLionel Sambuc.if defined(HOSTPROG)
42f4a2713aSLionel SambucLDADD_NEED_DL=		cat ${LLVM_TOOLCONF_OBJDIR}/need-dl 2> /dev/null
43f4a2713aSLionel SambucLDADD_NEED_TERMINFO=	cat ${LLVM_TOOLCONF_OBJDIR}/need-terminfo 2> /dev/null
44f4a2713aSLionel SambucLDADD+=	${LDADD_NEED_DL:sh} ${LDADD_NEED_TERMINFO:sh}
45f4a2713aSLionel Sambuc.else
46f4a2713aSLionel SambucLDADD+=	-lterminfo
47f4a2713aSLionel SambucDPADD+=	${LIBTERMINFO}
48f4a2713aSLionel Sambuc.endif
49f4a2713aSLionel Sambuc
50*4684ddb6SLionel Sambuc.if defined(__MINIX) && defined(HOSTPROG) && ${HOST_OSTYPE:C/\-.*//} != "Minix"
51f4a2713aSLionel SambucLDADD+=	-lpthread
52*4684ddb6SLionel Sambuc.else
53*4684ddb6SLionel SambucLDADD+= -lc++ -lmthread
54*4684ddb6SLionel Sambuc.endif # defined(__MINIX)
55