summaryrefslogtreecommitdiffstats
path: root/make/build-gluegen.xml
diff options
context:
space:
mode:
authorKenneth Russel <[email protected]>2003-07-14 05:34:51 +0000
committerKenneth Russel <[email protected]>2003-07-14 05:34:51 +0000
commit32350278dd07c95bec7e8adcf19ca1601dd6c6b4 (patch)
tree1e33a3c50e9c5173a2f8b08270e0cb4a1b692192 /make/build-gluegen.xml
parent4f936be964c9e8613a5e43e1d88490ff7f550ec9 (diff)
Added Ant build support, contributed by Rob Grzywinski and Artur
Biesiadowski. Modified their original build.xml to understand dependencies between build phases (to avoid full rebuilds each time) and to invoke the C compiler without requiring an external Makefile. At this point the old Makefile/Makefile2 pair is obsolete and will be deleted shortly, as soon as the Ant build has been tested on Linux and Mac OS X. Additionally, Cygwin is no longer needed for the build; the documentation will be updated to reflect this. Refactored some of the stub_includes files to be common between platforms, yielding a build process cleanup. Fixed bugs in Javadocs. git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@19 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'make/build-gluegen.xml')
-rw-r--r--make/build-gluegen.xml174
1 files changed, 174 insertions, 0 deletions
diff --git a/make/build-gluegen.xml b/make/build-gluegen.xml
new file mode 100644
index 000000000..f0236811b
--- /dev/null
+++ b/make/build-gluegen.xml
@@ -0,0 +1,174 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ - Ant build for JOGL's GlueGen and corresponding ANT task. This build
+ - should not be called directly. It is invoked from the main "build.xml"
+ - file and relies on the properties set therein.
+ -
+ - The optional.jar that contains the optional ANT tasks must be in the ANT
+ - classpath (typically the ant/lib directory).
+ -
+ - This build has been tested with ANT 1.5.3 and JOGL 1.1.1.1.
+ -
+ - Public targets:
+ - all: clean and build GlueGen and GlueGen Ant task
+ - clean: clean all built
+ -->
+<project name="JOGL.GlueGen" default="all">
+ <!-- ================================================================== -->
+ <!--
+ - Declare all paths and user defined variables.
+ -->
+ <target name="declare" description="Declare properties">
+
+ <!-- Create the classpath for ANTLR. This requires the user-defined
+ - "antlr.jar" property. -->
+ <path id="antlr.classpath">
+ <pathelement location="${antlr.jar}" />
+ </path>
+
+ <!-- The location of the GlueGen source and the C grammar files. -->
+ <property name="gluegen" value="${src}/net/java/games/gluegen" />
+ <property name="c.grammar" value="${gluegen}/cgram" />
+
+ <!-- The resulting location of the generated Java files from the
+ - C grammar via ANTLR. -->
+ <property name="gluegen.build" value="${src.generated.java}/net/java/games/gluegen" />
+ <property name="generated.java.from.grammar" value="${gluegen.build}/cgram" />
+
+ </target>
+
+ <!-- ================================================================== -->
+ <!--
+ - Build GlueGen.
+ -->
+ <target name="build.gluegen" depends="declare">
+ <!-- Generate the Java files from the C grammar using ANTLR. -->
+ <antcall target="generate.c.grammar">
+ <param name="target" value="${c.grammar}/StdCParser.g" />
+ <param name="output.dir" value="${generated.java.from.grammar}" />
+ </antcall>
+ <antcall target="generate.c.grammar.glib">
+ <param name="target" value="${c.grammar}/GnuCParser.g" />
+ <param name="glib" value="${c.grammar}/StdCParser.g" />
+ <param name="output.dir" value="${generated.java.from.grammar}" />
+ </antcall>
+ <antcall target="generate.c.grammar">
+ <param name="target" value="${c.grammar}/GnuCTreeParser.g" />
+ <param name="output.dir" value="${generated.java.from.grammar}" />
+ </antcall>
+ <antcall target="generate.c.grammar.glib">
+ <param name="target" value="${c.grammar}/GnuCEmitter.g" />
+ <param name="glib" value="${c.grammar}/GnuCTreeParser.g" />
+ <param name="output.dir" value="${generated.java.from.grammar}" />
+ </antcall>
+ <antcall target="generate.c.grammar.glib">
+ <param name="target" value="${c.grammar}/HeaderParser.g" />
+ <param name="glib" value="${c.grammar}/GnuCTreeParser.g" />
+ <param name="output.dir" value="${generated.java.from.grammar}" />
+ </antcall>
+
+ <!-- Ensure that the output classes directory exists. -->
+ <mkdir dir="${classes}" />
+
+ <!-- Build GlueGen using the generated Java files along with the
+ - original source.
+ - NOTE: GlueGenTask is NOT built at this time. It is done in
+ - a separate task. -->
+ <javac destdir="${classes}" includes="**/gluegen/**" excludes="**/GlueGenTask.java"
+ source="1.4">
+ <src path="${src}" />
+ <src path="${src.generated.java}" />
+ <classpath refid="antlr.classpath" />
+ </javac>
+
+ <!-- Inform the user that GlueGen has been successfully built. -->
+ <echo message="" />
+ <echo message="GlueGen has been built successfully." />
+ </target>
+
+ <!--
+ - Using ANTLR generate the specified Java files.
+ -
+ - @param target the grammar file to process
+ - @param output.dir the directory to write the generated files to. If
+ - the directory does not exist, it will be created.
+ -->
+ <target name="generate.c.grammar" depends="declare">
+ <!-- Ensure that the output directory exists.
+ - NOTE: this will ignore silently if the directory already exists. -->
+ <mkdir dir="${output.dir}" />
+
+ <!-- Generate the Java files -->
+ <antlr target="${target}" outputdirectory="${output.dir}">
+ <classpath refid="antlr.classpath" />
+ </antlr>
+ </target>
+
+ <!--
+ - Using ANTLR generate the specified Java files with an overridden
+ - grammar file.
+ -
+ - @param target the grammar file to process
+ - @param glib the overridding grammar file
+ - @param output.dir the directory to write the generated files to. If
+ - the directory does not exist, it will be created.
+ -->
+ <target name="generate.c.grammar.glib" depends="declare">
+ <!-- Ensure that the output directory exists.
+ - NOTE: this will ignore silently if the directory already exists. -->
+ <mkdir dir="${output.dir}" />
+
+ <!-- Generate the Java files -->
+ <antlr target="${target}" glib="${glib}" outputdirectory="${output.dir}">
+ <classpath refid="antlr.classpath" />
+ </antlr>
+ </target>
+
+ <!-- ================================================================== -->
+ <!--
+ - Build the GlueGen ANT task.
+ -->
+ <target name="build.gluegen.task" depends="declare">
+ <!-- Ensure that the output classes directory exists. -->
+ <mkdir dir="${classes}" />
+
+ <!-- Build the GlueGen ANT task.
+ - NOTE: ONLY the GlueGenTask is built at this time. GlueGen
+ - itself is built in a separate task. -->
+ <javac destdir="${classes}" includes="**/GlueGenTask.java" source="1.4">
+ <src path="${src}" />
+ <classpath refid="antlr.classpath" />
+ </javac>
+
+ <!-- Inform the user that the GlueGen ANT task has been successfully
+ built. -->
+ <echo message="" />
+ <echo message="GlueGen ANT task has been built successfully." />
+ </target>
+
+ <!-- ================================================================== -->
+ <!--
+ - Clean up all that is built.
+ - NOTE: this is a bit heavy-handed as it may delete more than just
+ - what is built with this build.
+ -->
+ <target name="clean" depends="declare">
+ <delete includeEmptyDirs="true" quiet="true">
+ <fileset dir="${src.generated.java}" />
+ <fileset dir="${classes}" />
+ </delete>
+ </target>
+
+ <!-- ================================================================== -->
+ <!--
+ - Build GlueGen and the GlueGen ANT task.
+ -->
+ <target name="all" depends="declare">
+ <!-- Build GlueGen -->
+ <antcall target="build.gluegen" />
+
+ <!-- Build the GlueGen ANT task -->
+ <antcall target="build.gluegen.task" />
+ </target>
+
+</project> \ No newline at end of file