aboutsummaryrefslogtreecommitdiffstats
path: root/lang/cyclone/Makefile
blob: 2ee65c8db935a7fe9636cf76b644d6cb64ba60ab (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
# ex:ts=8
#
# New ports collection makefile for:    cyclone
# Date created:     2002/01/06
# Whom:         alane <alane@FreeBSD.org> et al
#
# $FreeBSD$
#

PORTNAME=   cyclone
PORTVERSION=    0.2
CATEGORIES= lang
MASTER_SITES=   http://www.cs.cornell.edu/projects/cyclone/software/
#   XXX When this port is upgaded to 0.3, uncomment the following
#   line, etc.
#       http://www.research.att.com/projects/cyclone/software/
DISTFILES=  ${PORTNAME}-${PORTVERSION}.tar.gz \
        ${PORTNAME}-${PORTVERSION}-docs.tar.gz

MAINTAINER= ports@FreeBSD.org
COMMENT=    A safe dialect of C from Cornell and AT&T Research

USE_GMAKE=  yes
NO_PACKAGE= 'Neither CC nor CFLAGS safe.'
WRKSRC=     ${WRKDIR}/${PORTNAME}
CYCBINDIR=  ${PREFIX}/bin
CYCINCDIR=  ${PREFIX}/include/cyclone
CYCLIBDIR=  ${PREFIX}/lib/cyclone
ALL_TARGET= build
PLIST_SUB+= DOCSDIR=${DOCSDIR:S/^${PREFIX}\///}

pre-everything::
    @${ECHO_MSG} '>>>'
    @${ECHO_MSG} '>>> You can enable extra optimizations by defining WITH_OPTIMIZED_CFLAGS.'
    @${ECHO_MSG} '>>>'

post-patch:
.ifndef(WITH_OPTIMIZED_CFLAGS)
    @${FIND} ${WRKSRC} -name Makefile | ${XARGS} ${PERL} -pi -e \
        's/-O3/-O/'
.endif

do-configure:
    @cd ${CONFIGURE_WRKSRC} && ${ECHO_CMD} y | ./configure ${CONFIGURE_ARGS}

post-build:
.for target in cyclone_src update build test
    @cd ${WRKSRC} && ${MAKE_ENV} ${GMAKE} ${target}
.endfor

post-install:
.for prog in cyclone cycbison cyclex cycflex
    @${CHOWN} ${BINOWN}:${BINGRP} ${CYCBINDIR}/${prog}
    @${CHMOD} ${BINMODE} ${CYCBINDIR}/${prog}
.endfor
    @${RANLIB} ${CYCLIBDIR}/*.a
    @${CHOWN} -R ${INCOWN}:${INCGRP} ${CYCINCDIR}
    @${CHOWN} -R ${LIBOWN}:${LIBGRP} ${CYCLIBDIR}
    @${CHMOD} -R ${INCMODE} ${CYCINCDIR}
    @${CHMOD} -R ${LIBMODE} ${CYCLIBDIR}
    @${FIND} ${CYCINCDIR} ${CYCLIBDIR} -type d | ${XARGS} ${CHMOD} +x
.if !defined(NOPORTDOCS)
    @${MKDIR} ${DOCSDIR} ${DOCSDIR}/online-manual
    @${INSTALL_DATA} ${WRKDIR}/*.pdf ${DOCSDIR}
    @${INSTALL_DATA} ${WRKDIR}/online-manual/* ${DOCSDIR}/online-manual
.endif

.include <bsd.port.pre.mk>

.if exists(${LOCALBASE}/bin/bash) || !exists(${LOCALBASE}/bin/ksh)
BUILD_DEPENDS+= bash:${PORTSDIR}/shells/bash2

CONFIGURE_ARGS= -sh ${LOCALBASE}/bin/bash
.else
BUILD_DEPENDS+= ksh:${PORTSDIR}/shells/pdksh

CONFIGURE_ARGS= -sh ${LOCALBASE}/bin/ksh
.endif

CONFIGURE_ARGS+=    -prefix ${PREFIX} \
        -incdir ${CYCINCDIR} -bindir ${CYCBINDIR} -libdir ${CYCLIBDIR}

.include <bsd.port.post.mk>