aboutsummaryrefslogtreecommitdiffstats
path: root/devel/llvm-devel/Makefile
blob: d1c3dce7f522e924df36e1be088989acc210ae2a (plain) (blame)
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# New ports collection makefile for:    llvm
# Date created:     20 Nov 2005
# Whom:         Hye-Shik Chang
#
# $FreeBSD$
#

PORTNAME=   llvm
DISTVERSION=    2.4.snap${SNAPDATE}
CATEGORIES= devel lang
MASTER_SITES=   ${MASTER_SITE_LOCAL}
MASTER_SITE_SUBDIR= brooks
PKGNAMESUFFIX=  -devel

MAINTAINER= brooks@FreeBSD.org
COMMENT=    Low Level Virtual Machine

.if defined(PACKAGE_BUILDING) || defined(MAINTAINER_MODE)
BUILD_DEPENDS=  runtest:${PORTSDIR}/misc/dejagnu
.endif
.if defined(MAINTAINER_MODE)
BUILD_DEPENDS+= f2c:${PORTSDIR}/lang/f2c
.endif

.if defined(BOOTSTRAP)
SVN_SNAPDATE!=  date -v-1d +%Y-%m-%d
.else
SVN_SNAPDATE=   2008-08-05
.endif

SNAPDATE=   ${SVN_SNAPDATE:S/-//g}

GNU_CONFIGURE=  yes
USE_GMAKE=  yes
USE_BZIP2=  yes
USE_PERL5_BUILD=yes

.if defined(MAINTAINER_MODE)
CONFIGURE_ARGS+=    --with-f2c=${LOCALBASE}
.else
CONFIGURE_ARGS+=    --enable-optimized
.endif

MAN1=       bugpoint.1 llc.1 lli.1 llvm-ar.1 \
        llvm-as.1 llvm-bcanalyzer.1 llvm-config.1 llvm-db.1 \
        llvm-dis.1 llvm-extract.1 llvm-ld.1 llvm-link.1 llvm-nm.1 \
        llvm-prof.1 llvm-ranlib.1 llvmgcc.1 \
        llvmgxx.1 opt.1 tblgen.1

.if defined(BOOTSTRAP)
FETCH_DEPENDS+= svn:${PORTSDIR}/devel/subversion

do-fetch:
    ${MKDIR} ${WRKDIR}
    svn export http://llvm.org/svn/llvm-project/llvm/trunk ${WRKSRC}
    svn export http://llvm.org/svn/llvm-project/cfe/trunk ${WRKSRC}/tools/clang
    cd ${WRKDIR}; tar cvfy ${DISTDIR}/${DISTNAME}.tar.bz2 ${DISTNAME}
.endif

post-patch:
    ${REINPLACE_CMD} -e 's,\(PROJ_docsdir.*:=\).*$$,\1${DOCSDIR},g' \
        ${WRKSRC}/Makefile.config.in
    ${REINPLACE_CMD} -e 's,\(PROJ_mandir.*:=\).*$$,\1${MANPREFIX}/man,g' \
        ${WRKSRC}/Makefile.config.in
    ${REINPLACE_CMD} -e 's|%%DATADIR%%|${DATADIR}|g' \
        ${WRKSRC}/tools/clang/utils/scan-build

post-build:
    cd ${WRKSRC}/tools/clang; ${GMAKE}

post-install:
    @${INSTALL_PROGRAM} ${WRKSRC}/Release/bin/clang ${PREFIX}/bin
    @${INSTALL_SCRIPT} ${WRKSRC}/tools/clang/utils/ccc \
        ${PREFIX}/bin
    @${INSTALL_SCRIPT} ${WRKSRC}/tools/clang/utils/ccc-analyzer \
        ${PREFIX}/bin
    @${INSTALL_SCRIPT} ${WRKSRC}/tools/clang/utils/scan-build \
        ${PREFIX}/bin
    @${MKDIR} ${DATADIR}
    @${INSTALL_DATA} ${WRKSRC}/tools/clang/utils/sorttable.js ${DATADIR}
    @${RM} ${PREFIX}/bin/.dir \
       ${PREFIX}/lib/.dir

regression-test: ${BUILD_COOKIE}
    (cd ${WRKSRC}/test; ${SETENV} ${MAKE_ENV} ${GMAKE} check)

.include <bsd.port.mk>