summaryrefslogtreecommitdiff
path: root/devel/xtoolchain-llvm-devel/Makefile
blob: 310c4d2fd57db2ad58be42f921ebe0416080097d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58

PORTNAME=	xtoolchain
.ifndef NO_LLD_LINK
PORTVERSION=	0.1
.else
PORTVERSION=	0.2
.endif
CATEGORIES=	devel
MASTER_SITES=	# none
DISTFILES=	# none
PKGNAMESUFFIX?=	-llvm${LLVM_SUFFIX}

MAINTAINER?=	brooks@FreeBSD.org
COMMENT=	Pre seeded toolchain to cross build FreeBSD base

LLVM_SUFFIX?=	-devel

.if ${LLVM_SUFFIX} == "-devel"
IGNORE=	Subsumed into devel/llvm-devel
.endif

NO_BUILD=	yes

XCC?=		clang${LLVM_SUFFIX}
XCXX?=		clang++${LLVM_SUFFIX}
XCPP?=		clang-cpp${LLVM_SUFFIX}
XLD?=		${LOCALBASE}/llvm${LLVM_SUFFIX}/bin/ld.lld
X_COMPILER_TYPE?=	clang

RUN_DEPENDS?=	${XCC}:devel/llvm${LLVM_SUFFIX}

SUB_FILES=	xtoolchain.mk
SUB_LIST=	XCC=${XCC} \
		XCXX=${XCXX} \
		XCPP=${XCPP} \
		XLD=${XLD} \
		X_COMPILER_TYPE=${X_COMPILER_TYPE}

PLIST_FILES=	share/toolchains/llvm${LLVM_SUFFIX}.mk
.ifndef NO_LLD_LINK
PLIST_FILES+=	llvm${LLVM_SUFFIX}/bin/ld
.endif

do-install:
	@${MKDIR} ${STAGEDIR}${PREFIX}/share/toolchains/
	@${INSTALL_DATA} ${WRKDIR}/xtoolchain.mk \
		${STAGEDIR}${PREFIX}/share/toolchains/llvm${LLVM_SUFFIX}.mk

.ifndef NO_LLD_LINK
# XXX: would be better to add -fuse-ld=lld to LDFLAGS, but there isn't
# yet a mechansim for that.  Link added here, not in devel/llvm* to avoid
# forcing lld on all users.
post-install:
	@${MKDIR} ${STAGEDIR}${LOCALBASE}/llvm${LLVM_SUFFIX}/bin
	@${LN} -s ld.lld ${STAGEDIR}${LOCALBASE}/llvm${LLVM_SUFFIX}/bin/ld
.endif

.include <bsd.port.mk>