diff options
author | edwin <edwin@FreeBSD.org> | 2008-05-24 14:39:32 +0800 |
---|---|---|
committer | edwin <edwin@FreeBSD.org> | 2008-05-24 14:39:32 +0800 |
commit | c0ca465c1e788a9f5da618f78b7350be1c977247 (patch) | |
tree | ed506eaf0fdac87fc66d6ab639ee230defa2f6bf /devel/asdlgen/Makefile | |
parent | 003f6a28311451248e98833809ecf7dfef38b725 (diff) | |
download | freebsd-ports-gnome-c0ca465c1e788a9f5da618f78b7350be1c977247.tar.gz freebsd-ports-gnome-c0ca465c1e788a9f5da618f78b7350be1c977247.tar.zst freebsd-ports-gnome-c0ca465c1e788a9f5da618f78b7350be1c977247.zip |
New port: devel/asdlgen generate serializers for C,C++,Haskell,Icon,Java,ML
asdlGen generates data structure and serializer code from ASDL
specifications [1]. It is especially helpful for exchanging
tree like data structures between different programming languages.
Currently C, C++, Haskell, Java, Icon, OCaml and SML are supported.
Although the asdlGen project itself seems no longer actively
maintained, ASDL is "alive" as it is used (at least) in the
Moby [2] and Python [3,4] compilers.
The port optionally installs a simple usage example [5] for all
seven programming languages. I developed it primarily to test the
port, but it could be helpful to users of asdlGen to get a quicker
start, especially if a less familiar programming language is
involved in their project. Reviewers/committers can easily make
use of it via the "test-demo" target.
PR: ports/117703
Submitted by: Johannes 5 Joemann <joemann@beefree.free.de>
Diffstat (limited to 'devel/asdlgen/Makefile')
-rw-r--r-- | devel/asdlgen/Makefile | 123 |
1 files changed, 123 insertions, 0 deletions
diff --git a/devel/asdlgen/Makefile b/devel/asdlgen/Makefile new file mode 100644 index 000000000000..bcf5b6871ab8 --- /dev/null +++ b/devel/asdlgen/Makefile @@ -0,0 +1,123 @@ +# New ports collection makefile for: asdlgen +# Date created: 5 October 2007 +# Whom: Johannes 5 Joemann <joemann@beefree.free.de> +# +# $FreeBSD$ +# + +PORTNAME= asdlgen +PORTVERSION= 2.0.b20060323 +CATEGORIES= devel haskell java +MASTER_SITES= http://moby.cs.uchicago.edu/downloads/ \ + ftp://mirror.free.de/http/moby.cs.uchicago.edu/downloads/ +DISTNAME= asdlGen + +MAINTAINER= joemann@beefree.free.de +COMMENT= Interoperable serializers for C,C++,Haskell,Icon,Java,ML + +BUILD_DEPENDS= smlnj-devel>=110.65:${PORTSDIR}/lang/sml-nj-devel +.if !defined(NOPORTDOCS) +BUILD_DEPENDS+= sgmlfmt:${PORTSDIR}/textproc/sgmlformat +.endif + +USE_DOS2UNIX= src/icon/libasdl.icn + +OPTIONS= CII "Install libcii for use by generated C and C++ code" on \ + EXAMPLES "Install the simple 'arithexp' usage example" off + +.include <bsd.port.pre.mk> + +.if defined(WITH_CII) +RUN_DEPENDS+= libcii>=1.1:${PORTSDIR}/devel/libcii +.endif + +.if defined(WITH_EXAMPLES) +DEMOVERSION= 20071030 +DEMOARCHIVE= asdlgen-demo.${DEMOVERSION}.tar.gz +DEMODIR= arithexp +MASTER_SITES+= ftp://offshore.free.de/pub/dist/FreeBSD/ports/devel/:demo +DISTFILES+= ${DEMOARCHIVE}:demo +PLIST_SUB+= EXAMPLES="" DEMODIR=${DEMODIR} +.else +PLIST_SUB+= EXAMPLES="@comment " DEMODIR=${DEMODIR} +.endif + +WRKSRC= ${WRKDIR}/asdlGen +HAS_CONFIGURE= yes +CONFIGURE_ENV+= SMLNJ_DEVEL=yes +ALL_TARGET= build +MAKE_ENV+= SMLNJ_DEVEL=yes + +# Nowadays Java package names must be all lowercase, says JDK1.5. Cf. +# http://java.sun.com/docs/books/tutorial/java/package/namingpkgs.html +pre-patch: +.for dir in StdPkl StdPrims StdTypes + cd ${WRKSRC}/src/java/asts && [ -d ${dir} ] && ${MV} ${dir} ${dir:L} +.endfor + +post-build: + cd ${WRKSRC}/src/sml && heap2exec asdlGen.*-bsd asdlGen +.if !defined(NOPORTDOCS) +.for format in ascii html ps + @${MKDIR} ${WRKSRC}/doc-build/README + cd ${WRKSRC}/doc-build/README && \ + sgmlfmt -f ${format} ${WRKSRC}/README.sgml + @${MKDIR} ${WRKSRC}/doc-build/manual + cd ${WRKSRC}/doc-build/manual && \ + sgmlfmt -f ${format} ${WRKSRC}/src/doc/manual.sgml +.endfor +.endif + +do-install: + ${INSTALL_PROGRAM} ${WRKSRC}/src/sml/asdlGen ${PREFIX}/bin + @${MKDIR} ${EXAMPLESDIR} + cd ${WRKSRC}/src/asdl/tests && ${COPYTREE_SHARE} \* ${EXAMPLESDIR} + ${INSTALL_DATA} -p ${WRKSRC}/src/asdl/std-types.asdl ${EXAMPLESDIR} +.if !defined(NOPORTDOCS) + @${MKDIR} ${DOCSDIR} + ${INSTALL_MAN} -p ${WRKSRC}/COPYRIGHT ${DOCSDIR} + cd ${WRKSRC}/doc-build && ${COPYTREE_SHARE} \* ${DOCSDIR} +.endif +.if defined(WITH_EXAMPLES) + cd ${WRKDIR}/${DEMODIR} && ${MAKE} clean + cd ${WRKDIR} && ${COPYTREE_SHARE} ${DEMODIR} ${EXAMPLESDIR} +.endif + +# The following test-* targets are used for maintaining this port but +# might be interesting for users exploring different target languages. + +.ifmake test-compile || test-demo +BUILD_DEPENDS+= libcii>=1.1:${PORTSDIR}/devel/libcii \ + hugs:${PORTSDIR}/lang/hugs \ + icont:${PORTSDIR}/lang/icon \ + javac:${PORTSDIR}/java/diablo-jdk15 \ + ocaml:${PORTSDIR}/lang/ocaml + +.ifmake test-compile +# This target runs the generate+compile tests from the asdlGen distribution +# for all supported languages. The "Test" structure is defined in +# ${WRKSRC}/src/sml/test/harness.sml . +test-compile: depends clean-depends build +.if defined(WITH_CII) + cd ${WRKSRC}/src/sml && export SMLNJ_DEVEL=yes && \ + ${ECHO_CMD} "Test.do_it ();" | sml -m sources.cm +.else + @${ECHO_CMD} "You have to set the CII option (make config)" + @${ECHO_CMD} "before you can use the test-compile target." + @exit 1 +.endif +.endif + +.ifmake test-demo +test-demo: clean depends clean-depends build +.if defined(WITH_CII) && defined(WITH_EXAMPLES) + cd ${WRKDIR}/${DEMODIR} && ${MAKE} ASDLGEN=${WRKSRC}/src/sml/asdlGen +.else + @${ECHO_CMD} "You have to set the CII and EXAMPLES options" + @${ECHO_CMD} "(make config) before you can use the test-demo target." + @exit 1 +.endif +.endif +.endif + +.include <bsd.port.post.mk> |