aboutsummaryrefslogtreecommitdiff
path: root/devel/frama-c/Makefile
diff options
context:
space:
mode:
authorBrendan Fabeny <bf@FreeBSD.org>2011-09-18 15:38:25 +0000
committerBrendan Fabeny <bf@FreeBSD.org>2011-09-18 15:38:25 +0000
commit06f3130eee320cb576169f5b108f8e99d8666a6a (patch)
tree39eaf564265f4e9bd7b6df77d3d4ed9fdd46075a /devel/frama-c/Makefile
parent6ff56ae145bad1393a8d551f8392b87c9ac99314 (diff)
downloadports-06f3130eee320cb576169f5b108f8e99d8666a6a.tar.gz
ports-06f3130eee320cb576169f5b108f8e99d8666a6a.zip
Notes
Diffstat (limited to 'devel/frama-c/Makefile')
-rw-r--r--devel/frama-c/Makefile109
1 files changed, 109 insertions, 0 deletions
diff --git a/devel/frama-c/Makefile b/devel/frama-c/Makefile
new file mode 100644
index 000000000000..bad5747c2c7f
--- /dev/null
+++ b/devel/frama-c/Makefile
@@ -0,0 +1,109 @@
+# New ports collection makefile for: frama-c
+# Date created: 25 May 2011
+# Whom: b.f. <bf@FreeBSD.org>
+#
+# $FreeBSD$
+#
+
+PORTNAME= frama-c
+DISTVERSIONPREFIX= Carbon-
+DISTVERSION= 20110201
+CATEGORIES= devel
+MASTER_SITES= http://frama-c.com/download/ LOCAL/bf
+
+MAINTAINER= bf@FreeBSD.org
+COMMENT= Extensible platform for source-code analysis of C
+
+LICENSE= LGPL21
+
+BUILD_DEPENDS= ${LOCALBASE}/lib/ocaml/ocamlgraph/graph.a:${PORTSDIR}/math/ocaml-ocamlgraph
+RUN_DEPENDS= ${LOCALBASE}/lib/ocaml/ocamlgraph/graph.a:${PORTSDIR}/math/ocaml-ocamlgraph
+
+GNU_CONFIGURE= yes
+MAKE_ENV+= FRAMAC_LIBDIR="${PREFIX}/lib/frama-c"
+MAN1= frama-c.1 frama-c-gui.1
+OPTIONS= GUI "Build GUI" on \
+ PLUGINS "Build bundled plugins" on
+USE_GMAKE= yes
+USE_OCAML= yes
+
+.include <bsd.port.options.mk>
+
+.if defined(WITH_GUI)
+.if !defined(WITH_PLUGINS)
+IGNORE = requires WITH_PLUGINS for WITH_GUI
+.endif
+BUILD_DEPENDS += lablgtk2:${PORTSDIR}/x11-toolkits/ocaml-lablgtk2
+RUN_DEPENDS+= lablgtk2:${PORTSDIR}/x11-toolkits/ocaml-lablgtk2
+CONFIGURE_ARGS+= --enable-gui
+PLIST_SUB+= GUI=""
+.else
+CONFIGURE_ARGS+= --disable-gui
+PLIST_SUB+= GUI="@comment "
+.endif
+
+.if defined(WITH_PLUGINS)
+BUILD_DEPENDS += dot:${PORTSDIR}/graphics/graphviz \
+ ltl2ba:${PORTSDIR}/math/ltl2ba
+RUN_DEPENDS+= dot:${PORTSDIR}/graphics/graphviz \
+ ltl2ba:${PORTSDIR}/math/ltl2ba
+PLIST_SUB+= PLUGINS=""
+.else
+CONFIGURE_ARGS+= --with-no-plugin
+PLIST_SUB+= PLUGINS="@comment "
+.endif
+
+post-patch:
+ @${MKDIR} ${WRKSRC}/tests/occurrence
+ @${REINPLACE_CMD} -e 's|@make |@${GMAKE} |' \
+ ${WRKSRC}/src/aorai/Makefile.in
+ @${GREP} -le 'make ' -r ${WRKSRC}/tests | ${XARGS} ${REINPLACE_CMD} \
+ -e 's|make |${GMAKE} |'
+ @${REINPLACE_CMD} \
+ -e 's|$$(CP)|${INSTALL_DATA}|' \
+ -e 's|add_prefix|addprefix|' \
+ ${WRKSRC}/share/Makefile.plugin
+ @${REINPLACE_CMD} \
+ -e '\|$$(CP) $$(TARGETS|s|$$(CP)|${INSTALL_DATA}|' \
+ -e '\|$$(CP) frama-c|s|$$(CP)|${INSTALL_SCRIPT}|' \
+ ${WRKSRC}/share/Makefile.dynamic
+ @${REINPLACE_CMD} -e '\|^# Installation|,\|^# File headers|{ \
+ \|$$(CP).*bin|s|$$(CP)|${INSTALL_SCRIPT}|; \
+ \|$$(CP) -R doc/manuals $$(FRAMAC_DATADIR)| \
+ s||${MKDIR} $$(FRAMAC_DATADIR)/manuals ; \
+ ${INSTALL_DATA} doc/manuals/* $$(FRAMAC_DATADIR)/manuals|; \
+ \|$$(CP).*man|s|$$(CP)\( -R\)*|${INSTALL_MAN}|; \
+ \|$$(CP).*share|s|$$(CP)\( -R\)*|${INSTALL_DATA}|; \
+ s|$$(CP)|${INSTALL_DATA}|; }' \
+ ${WRKSRC}/Makefile
+
+.if defined(WITH_GUI)
+pre-configure:
+ @(if [ ! -e ${LOCALBASE}/lib/ocaml/lablgtk2/gtkSourceView2.cmi -o \
+ ! -e ${LOCALBASE}/lib/ocaml/lablgtk2/gnomeCanvas.cmi ] ; then \
+ ${ECHO_MSG} "==> The WITH_GUI option for ${PKGNAME} requires" ; \
+ ${ECHO_MSG} "==> x11-toolkits/ocaml-lablgtk2 to be built" ; \
+ ${ECHO_MSG} "==> WITH_GNOMECANVAS and WITH_GTKSOURCEVIEW2" ; \
+ exit 1; fi)
+ @(if [ ! -e ${LOCALBASE}/lib/ocaml/ocamlgraph/dgraph.cmi ] ; then \
+ ${ECHO_MSG} "==> The WITH_GUI option for ${PKGNAME} requires" ; \
+ ${ECHO_MSG} "==> math/ocaml-ocamlgraph to be built WITH_GUI" ; \
+ exit 1; fi)
+
+.endif
+
+post-install:
+ @${TOUCH} ${PREFIX}/lib/frama-c/plugins/.keep_me \
+ ${PREFIX}/lib/frama-c/plugins/gui/.keep_me
+
+.if defined(MAINTAINER_MODE)
+check regression-test test: build
+ @(cd ${WRKSRC}; ${SETENV} ${MAKE_ENV} \
+ FRAMAC_LIB=${WRKSRC}/lib/fc \
+ FRAMAC_PLUGIN=${WRKSRC}/lib/plugins \
+ FRAMAC_SHARE=${WRKSRC}/share \
+ ${GMAKE} ${_MAKE_JOBS} ${MAKE_ARGS} tests)
+
+.endif
+
+.include <bsd.port.mk>