summaryrefslogtreecommitdiff
path: root/devel/antlr/Makefile
blob: ad6ccf173d6cb007d43f8c36941f4ad6b70a958f (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
# New ports collection makefile for:	antlr
# Date created:		5 July 2002
# Whom:			Geoffrey Mainland <mainland@apeiron.net>
#
# $FreeBSD$
#

PORTNAME=	antlr
PORTVERSION=	2.7.1
CATEGORIES=	devel java
MASTER_SITES=	http://www.ANTLR.org/nirvana/
DISTNAME=	antlr-${PORTVERSION}
DIST_SUBDIR=	antlr
EXTRACT_ONLY=	antlr-${PORTVERSION}.tar.gz

MAINTAINER=	mainland@apeiron.net
COMMENT=	ANTLR: ANother Tool for Language Recognition

BUILD_DEPENDS=	${LOCALBASE}/bin/javavm:${PORTSDIR}/java/javavmwrapper
RUN_DEPENDS=	${LOCALBASE}/bin/javavm:${PORTSDIR}/java/javavmwrapper

USE_GMAKE=	yes

.if defined(WITH_PARSEVIEW)
DISTFILES+=	ParseView.zip
BUILD_DEPENDS+= ${LOCALBASE}/bin/unzip:${PORTSDIR}/archivers/unzip

PLIST_SUB+=	PARSEVIEW=""
.else
PLIST_SUB+=	PARSEVIEW="@comment "
.endif

ALL_TARGET=	antlr

.include <bsd.port.pre.mk>

.if !exists(${DISTDIR}/${DIST_SUBDIR}/antlr-${PORTVERSION}${EXTRACT_SUFX})
IGNORE=	You must manually fetch the source distribution (antlr-${PORTVERSION}${EXTRACT_SUFX}) from http://www.jguru.com/jguru/download/view.jsp?EID=201927 (registration required), place it in ${DISTDIR}/${DIST_SUBDIR} and then run make again
.endif

.if defined(WITH_PARSEVIEW)
post-extract:
	(cd ${WRKSRC} && unzip -o ${DISTDIR}/${DIST_SUBDIR}/ParseView.zip)
.endif

post-configure:
	(cd ${WRKSRC}/lib/cpp && ./configure --prefix=${PREFIX})

do-build:
	(cd ${WRKSRC}/lib/cpp && ${GMAKE})

do-install:
	@${SED} "s|%%ANTLR_JAR_PATH%%|${PREFIX}/share/antlr|" ${FILESDIR}/antlr.sh >${WRKDIR}/antlr.sh
	@${MKDIR} ${PREFIX}/share/antlr
	@${INSTALL_SCRIPT} ${WRKDIR}/antlr.sh ${PREFIX}/bin/antlr
	(cd ${WRKSRC}/lib/cpp && ${GMAKE} install)
	(cd ${WRKSRC} && (${TAR} cf - antlr doc examples/cpp examples/java | ${TAR} xf - -C ${PREFIX}/share/antlr))

.include <bsd.port.post.mk>