lwjgl/build.xml

675 lines
29 KiB
XML
Raw Normal View History

2004-10-17 17:16:40 -04:00
<project name="LWJGL" default="compile" basedir=".">
2003-11-13 18:16:58 -05:00
<!-- ================================================================== -->
<!-- Global properties for build -->
2004-10-17 17:16:40 -04:00
<!-- ================================================================== -->
<property name="lwjgl.src" value="./src" />
<property name="lwjgl.src.native" value="${lwjgl.src}/native" />
<property name="lwjgl.src.headers" value="${lwjgl.src.native}/common" />
<property name="lwjgl.src.templates" value="${lwjgl.src}/templates" />
<property name="lwjgl.bin" value="./bin" />
<property name="lwjgl.lib" value="./libs" />
<property name="lwjgl.dist" value="./dist" />
<property name="lwjgl.docs" value="./doc" />
<property name="lwjgl.temp" value="./temp" />
<property name="lwjgl.res" value="./res" />
2005-08-17 18:05:15 -04:00
<property name="lwjgl.version" value="0.98" />
2004-10-17 17:16:40 -04:00
<!-- ================================================================== -->
<!-- Filesets used for targets -->
2003-11-13 18:16:58 -05:00
<!-- ================================================================== -->
2004-10-17 17:16:40 -04:00
2003-11-13 18:16:58 -05:00
<!-- Files to include in the lwjgl.jar file -->
<fileset id="lwjgl.fileset" dir="${lwjgl.bin}">
2004-10-17 17:16:40 -04:00
<include name="**" />
<exclude name="**.*" />
<exclude name="org/lwjgl/fmod3/**" />
<exclude name="org/lwjgl/test/**" />
<exclude name="org/lwjgl/util/**" />
2004-12-13 12:28:08 -05:00
<exclude name="org/lwjgl/devil/**" />
2004-10-17 17:16:40 -04:00
<exclude name="org/lwjgl/examples/**" />
</fileset>
2003-11-13 18:16:58 -05:00
<!-- Files to include in the lwjgl_test.jar file -->
<fileset id="lwjgl_test.fileset" dir="${lwjgl.bin}">
2004-10-17 17:16:40 -04:00
<exclude name="**.*" />
<include name="org/lwjgl/test/**" />
<include name="org/lwjgl/examples/**" />
</fileset>
<!-- More files to include in the lwjgl_test.jar file -->
<fileset id="lwjgl_test_extra.fileset" dir="${lwjgl.src}/java">
<exclude name="**.*" />
<include name="org/lwjgl/test/opengl/shaders/shaderFP.fp" />
<include name="org/lwjgl/test/opengl/shaders/shaderFP.vp" />
<include name="org/lwjgl/test/opengl/shaders/shaderFSH.fsh" />
<include name="org/lwjgl/test/opengl/shaders/shaderFSH.vsh" />
<include name="org/lwjgl/test/opengl/shaders/shaderVP.vp" />
<include name="org/lwjgl/test/opengl/shaders/shaderVSH.vsh" />
</fileset>
2004-10-17 17:16:40 -04:00
<!-- Files to include in the lwjgl_util.jar file -->
<fileset id="lwjgl_util.fileset" dir="${lwjgl.bin}">
2004-10-17 17:16:40 -04:00
<exclude name="**.*" />
<include name="org/lwjgl/util/**" />
</fileset>
2004-09-06 12:36:08 -04:00
2004-06-09 16:02:10 -04:00
<!-- Files to include in the lwjgl_fmod3.jar file -->
<fileset id="lwjgl_fmod3.fileset" dir="${lwjgl.bin}">
2004-10-17 17:16:40 -04:00
<exclude name="**.*" />
<include name="org/lwjgl/fmod3/**" />
</fileset>
<!-- Files to include in the lwjgl_devil.jar file -->
<fileset id="lwjgl_devil.fileset" dir="${lwjgl.bin}">
<exclude name="**.*"/>
<include name="org/lwjgl/devil/**"/>
</fileset>
2003-11-13 18:16:58 -05:00
<!-- Files to make Javadoc from -->
<fileset id="lwjgl.javadoc.fileset" dir="${lwjgl.src}/java">
<include name="**/*.java" />
2004-10-17 17:16:40 -04:00
<exclude name="org/lwjgl/test/**" />
2005-01-25 16:26:18 -05:00
<exclude name="org/lwjgl/examples/**" />
2005-03-30 12:51:02 -05:00
<exclude name="org/lwjgl/util/generator/**" />
2004-10-17 17:16:40 -04:00
</fileset>
<!-- Files to include in doc package -->
<patternset id="lwjgl-docs.fileset">
2004-10-17 17:16:40 -04:00
<include name="CREDITS" />
<include name="LICENSE" />
<include name="README" />
2004-12-13 12:11:37 -05:00
<include name="lwjgl_hidden_switches.text" />
<include name="3rdparty/*" />
2004-10-17 17:16:40 -04:00
</patternset>
2003-11-13 18:16:58 -05:00
<!-- Files to include in win32 package -->
<patternset id="lwjgl-win32.fileset">
2004-10-17 17:16:40 -04:00
<include name="lwjgl.dll" />
<include name="lwjgl-fmod3.dll" />
2004-12-13 12:28:08 -05:00
<include name="lwjgl-devil.dll" />
2004-10-17 17:16:40 -04:00
<include name="lwjglaudio.dll" />
<include name="DevIL.dll" />
<include name="ILU.dll" />
<include name="ILUT.dll" />
2005-08-18 09:48:18 -04:00
<include name="jinput-dxplugin.dll" />
2004-10-17 17:16:40 -04:00
</patternset>
2003-11-13 18:16:58 -05:00
<!-- Files to include in linux, glibc2.3 package -->
2003-11-25 17:34:07 -05:00
<patternset id="lwjgl-linux.fileset">
2004-10-17 17:16:40 -04:00
<include name="liblwjgl.so" />
<include name="liblwjgl-fmod3.so" />
2004-12-13 12:28:08 -05:00
<include name="liblwjgl-devil.so" />
2004-10-17 17:16:40 -04:00
<include name="libopenal.so" />
<include name="libIL.so" />
<include name="libILU.so" />
<include name="libILUT.so" />
2005-08-18 09:48:18 -04:00
<include name="libjinput-linux.so" />
2004-10-17 17:16:40 -04:00
</patternset>
2003-11-13 18:16:58 -05:00
<!-- Files to include in mac os x package -->
<patternset id="lwjgl-macosx.fileset">
2004-10-17 17:16:40 -04:00
<include name="liblwjgl.jnilib" />
<include name="liblwjgl-fmod3.jnilib" />
2004-12-13 12:28:08 -05:00
<include name="liblwjgl-devil.jnilib" />
2004-10-17 17:16:40 -04:00
<include name="openal.dylib" />
<include name="libIL.dylib" />
<include name="libILU.dylib" />
<include name="libILUT.dylib" />
2005-08-18 09:48:18 -04:00
<include name="libjinput.jnilib" />
2004-10-17 17:16:40 -04:00
</patternset>
2003-11-13 18:16:58 -05:00
<!-- Files to include in source distribution -->
<fileset id="lwjgl.source.fileset" dir=".">
2004-10-17 17:16:40 -04:00
<include name="build.xml" />
<include name="src/**" />
<include name="platform_build/win32_ms_cmdline/*.bat" />
2003-11-13 18:16:58 -05:00
</fileset>
<uptodate property="lwjgl.main.built" targetfile="${lwjgl.lib}/win32/lwjgl.dll" >
<srcfiles dir= "${lwjgl.src.native}/common" includes="*.c*"/>
<srcfiles dir= "${lwjgl.src.native}/common/arb" includes="*.c"/>
<srcfiles dir= "${lwjgl.src.native}/common/nv" includes="*.c"/>
<srcfiles dir= "${lwjgl.src.native}/common/ext" includes="*.c"/>
<srcfiles dir= "${lwjgl.src.native}/common/ati" includes="*.c"/>
<srcfiles dir= "${lwjgl.src.native}/win32" includes="*.cpp"/>
</uptodate>
<uptodate property="lwjgl.fmod.built" targetfile="${lwjgl.lib}/win32/lwjgl-fmod3.dll" >
<srcfiles dir= "${lwjgl.src.native}/common" includes="*.c"/>
<srcfiles dir= "${lwjgl.src.native}/common/fmod3" includes="*.c"/>
</uptodate>
<uptodate property="lwjgl.devil.built" targetfile="${lwjgl.lib}/win32/lwjgl-devil.dll" >
<srcfiles dir= "${lwjgl.src.native}/common" includes="*.c"/>
<srcfiles dir= "${lwjgl.src.native}/common/devil" includes="*.c"/>
</uptodate>
2003-11-13 18:16:58 -05:00
2004-10-17 17:16:40 -04:00
<!-- ================================================================== -->
<!-- Everything below this line is targets. -->
<!-- Do not modify, unless you know what you're doing -->
2004-10-17 17:16:40 -04:00
<!-- ================================================================== -->
<!-- ================================================================== -->
<!-- Initialize build -->
2004-10-17 17:16:40 -04:00
<!-- ================================================================== -->
2004-09-06 12:36:08 -04:00
<target name="-initialize">
2004-10-17 17:16:40 -04:00
<mkdir dir="${lwjgl.bin}" taskname="initialiazing bin folder" />
<mkdir dir="${lwjgl.lib}" taskname="initialiazing lib folder" />
<mkdir dir="${lwjgl.dist}" taskname="initialiazing dist folder" />
<mkdir dir="${lwjgl.docs}/javadoc" taskname="initialiazing docs folder" />
<mkdir dir="${lwjgl.res}" taskname="initialiazing res folder" />
<mkdir dir="${lwjgl.temp}" taskname="initialiazing temp folder" />
<mkdir dir="${lwjgl.temp}/jar" taskname="initialiazing temp folder" />
<mkdir dir="${lwjgl.temp}/doc" taskname="initialiazing temp folder" />
<mkdir dir="${lwjgl.temp}/res" taskname="initialiazing temp folder" />
<mkdir dir="${lwjgl.temp}/native" taskname="initialiazing temp folder" />
2003-11-22 17:30:37 -05:00
</target>
2004-10-17 17:16:40 -04:00
<!-- Cleans up any files created during the execution of this script -->
<target name="clean" description="Cleans the diectories controlled by this ant script">
<delete dir="${lwjgl.temp}" quiet="true" failonerror="false" taskname="cleaning temp folder" />
<delete dir="${lwjgl.docs}/javadoc" quiet="true" failonerror="false" taskname="cleaning javadoc folder" />
<delete dir="${lwjgl.bin}/org" quiet="true" failonerror="false" taskname="cleaning bin folder" />
<delete taskname="cleaning bin folder" failonerror="false">
<fileset dir="${lwjgl.bin}" includes="*.class" />
</delete>
</target>
<!-- Creates a distribution of LWJGL -->
<target name="release" description="Creates a distribution of LWJGL using supplied native binaries">
<!-- Warn user -->
<echo message="Before running the release target, please manually compile all platforms and place required files in ${lwjgl.lib}/win32, ${lwjgl.lib}/linux and ${lwjgl.lib}/macosx${line.separator}Missing files will result in a successfull built, but with incomplete release zips"/>
<input
message="All data in the ${lwjgl.dist} folder will be deleted. Continue? "
validargs="yes,no"
addproperty="do.delete"
/>
<condition property="do.abort">
<equals arg1="no" arg2="${do.delete}"/>
</condition>
<fail if="do.abort">Build aborted by user.</fail>
<!-- prepare -->
<delete dir="${lwjgl.dist}" quiet="true" failonerror="false" />
<antcall target="clean" />
<antcall target="-initialize" />
<!-- compile and create jars -->
<antcall target="compile" />
2004-10-17 17:16:40 -04:00
<antcall target="javadoc" />
<antcall target="-createjars" />
<!-- copy resources to res folder -->
<copy todir="${lwjgl.temp}/res">
<fileset dir="res"/>
</copy>
<!-- copy docs -->
<copy todir="${lwjgl.temp}/doc">
<fileset dir="${lwjgl.docs}">
<patternset refid="lwjgl-docs.fileset" />
</fileset>
</copy>
<!-- create distribution from files in libs/ and temp/ -->
2004-10-17 17:16:40 -04:00
<antcall target="-distribution_javadoc" />
<antcall target="-distribution_source" />
<antcall target="-distribute_win32" />
<antcall target="-distribute_linux" />
<antcall target="-distribute_macosx" />
2005-05-19 11:50:47 -04:00
</target>
<!-- Create ONLY the jar archives -->
<target name="jars" description="Creates the Java archives ONLY and places them in libs/" depends="clean, -initialize, compile, -createjars">
<move todir="libs/">
<fileset dir="${lwjgl.temp}/jar">
<include name="*.jar"/>
</fileset>
</move>
</target>
<!-- Packages the java files -->
<target name="-createjars">
<!-- Create lwjgl.jar -->
<jar destfile="${lwjgl.temp}/jar/lwjgl.jar" taskname="lwjgl.jar">
<fileset refid="lwjgl.fileset" />
</jar>
<!-- Create lwjgl_test.jar -->
<jar destfile="${lwjgl.temp}/jar/lwjgl_test.jar" taskname="lwjgl_test.jar">
<fileset refid="lwjgl_test.fileset" />
<fileset refid="lwjgl_test_extra.fileset" />
</jar>
<!-- Create lwjgl_util.jar -->
<jar destfile="${lwjgl.temp}/jar/lwjgl_util.jar" taskname="lwjgl_util.jar">
<fileset refid="lwjgl_util.fileset" />
</jar>
<!-- Create lwjgl_fmod.jar -->
<jar destfile="${lwjgl.temp}/jar/lwjgl_fmod3.jar" taskname="lwjgl_fmod3.jar">
<fileset refid="lwjgl_fmod3.fileset" />
</jar>
<!-- Create lwjgl_devil.jar -->
<jar destfile="${lwjgl.temp}/jar/lwjgl_devil.jar" taskname="lwjgl_devil.jar">
<fileset refid="lwjgl_devil.fileset" />
</jar>
2003-11-13 18:16:58 -05:00
</target>
<!-- Distributes win32 files -->
<target name="-distribute_win32">
<delete>
<fileset dir="${lwjgl.temp}/native/" includes="**/*"/>
</delete>
2005-08-18 09:48:18 -04:00
<copy file="${lwjgl.lib}/jinput.jar" todir="${lwjgl.temp}/jar"/>
<copy todir="${lwjgl.temp}/native">
<fileset dir="${lwjgl.lib}/win32">
<patternset refid="lwjgl-win32.fileset" />
</fileset>
</copy>
<zip destfile="${lwjgl.dist}/lwjgl-win32-${lwjgl.version}.zip">
<zipfileset dir="${lwjgl.temp}" prefix="lwjgl-win32-${lwjgl.version}/"/>
</zip>
</target>
<!-- Distributes linux files -->
<target name="-distribute_linux">
<delete>
<fileset dir="${lwjgl.temp}/native/" includes="**/*"/>
2005-08-18 09:48:18 -04:00
</delete>
<copy file="${lwjgl.lib}/jinput.jar" todir="${lwjgl.temp}/jar"/>
<copy todir="${lwjgl.temp}/native">
<fileset dir="${lwjgl.lib}/linux">
<patternset refid="lwjgl-linux.fileset" />
</fileset>
</copy>
<zip destfile="${lwjgl.dist}/lwjgl-linux-${lwjgl.version}.zip">
<zipfileset dir="${lwjgl.temp}" prefix="lwjgl-linux-${lwjgl.version}/"/>
</zip>
</target>
<!-- Distributes macosx files -->
<target name="-distribute_macosx">
<delete>
<fileset dir="${lwjgl.temp}/native/" includes="**/*"/>
2005-08-18 09:48:18 -04:00
</delete>
<copy file="${lwjgl.lib}/jinput.jar" todir="${lwjgl.temp}/jar"/>
<copy todir="${lwjgl.temp}/native">
<fileset dir="${lwjgl.lib}/macosx">
<patternset refid="lwjgl-macosx.fileset" />
</fileset>
</copy>
<zip destfile="${lwjgl.dist}/lwjgl-macosx-${lwjgl.version}.zip">
<zipfileset dir="${lwjgl.temp}" prefix="lwjgl-macosx-${lwjgl.version}/"/>
</zip>
</target>
<!-- Creates a versioned distribution of javadocs -->
<target name="-distribution_javadoc">
<zip destfile="${lwjgl.dist}/lwjgl-docs-${lwjgl.version}.zip" basedir="${lwjgl.docs}" includes="javadoc/**" />
</target>
<!-- Creates a versioned distribution of the source code -->
<target name="-distribution_source">
<zip destfile="${lwjgl.dist}/lwjgl-source-${lwjgl.version}.zip">
<fileset refid="lwjgl.source.fileset" />
</zip>
</target>
<!-- Compiles the Java source code -->
<target name="compile" description="Compiles the java source code">
<javac debug="yes" srcdir="${lwjgl.src}/java/" destdir="${lwjgl.bin}" includes="org/lwjgl/*.java" source="1.4" target="1.4" classpath="${lwjgl.lib}/jinput.jar" taskname="lwjgl" />
<javac debug="yes" srcdir="${lwjgl.src}/java/" destdir="${lwjgl.bin}" includes="org/lwjgl/input/**" source="1.4" target="1.4" taskname="input" />
<javac debug="yes" srcdir="${lwjgl.src}/java/" destdir="${lwjgl.bin}" includes="org/lwjgl/openal/**" source="1.4" target="1.4" taskname="openal" />
<javac debug="yes" srcdir="${lwjgl.src}/java/" destdir="${lwjgl.bin}" includes="org/lwjgl/opengl/**" source="1.4" target="1.4" taskname="opengl" />
<javac debug="yes" srcdir="${lwjgl.src}/java/" destdir="${lwjgl.bin}" includes="org/lwjgl/test/**" source="1.4" target="1.4" taskname="test" />
<javac debug="yes" srcdir="${lwjgl.src}/java/" destdir="${lwjgl.bin}" includes="org/lwjgl/examples/**" source="1.4" target="1.4" taskname="examples" />
<javac debug="yes" srcdir="${lwjgl.src}/java/" destdir="${lwjgl.bin}" includes="org/lwjgl/util/**" excludes="org/lwjgl/util/generator/**" source="1.4" target="1.4" taskname="util" />
<javac debug="yes" srcdir="${lwjgl.src}/java/" destdir="${lwjgl.bin}" includes="org/lwjgl/fmod3/**" source="1.4" target="1.4" taskname="fmod" />
<javac debug="yes" srcdir="${lwjgl.src}/java/" destdir="${lwjgl.bin}" includes="org/lwjgl/devil/**" source="1.4" target="1.4" taskname="devil"/>
</target>
<!-- Generates the native headers from source files -->
<target name="headers" description="invokes javah on java classes" depends="compile">
<!-- platform specific classes -->
<javah classpath="${lwjgl.bin}" destdir="${lwjgl.src.native}/linux" force="yes">
<class name="org.lwjgl.opengl.LinuxDisplay" />
<class name="org.lwjgl.opengl.LinuxPeerInfo" />
<class name="org.lwjgl.opengl.LinuxPbufferPeerInfo" />
<class name="org.lwjgl.opengl.LinuxDisplayPeerInfo" />
<class name="org.lwjgl.opengl.LinuxAWTGLCanvasPeerInfo" />
<class name="org.lwjgl.opengl.LinuxContextImplementation" />
<class name="org.lwjgl.opengl.LinuxCanvasImplementation" />
</javah>
<javah classpath="${lwjgl.bin}" destdir="${lwjgl.src.native}/win32" force="yes">
<class name="org.lwjgl.opengl.Win32PbufferPeerInfo" />
<class name="org.lwjgl.opengl.Win32Display" />
<class name="org.lwjgl.opengl.Win32Registry" />
<class name="org.lwjgl.NativeSysImplementation" />
<class name="org.lwjgl.opengl.Win32AWTGLCanvasPeerInfo" />
<class name="org.lwjgl.opengl.Win32PeerInfo" />
<class name="org.lwjgl.opengl.Win32DisplayPeerInfo" />
<class name="org.lwjgl.opengl.Win32ContextImplementation" />
</javah>
<javah classpath="${lwjgl.bin}" destdir="${lwjgl.src.native}/macosx" force="yes">
<class name="org.lwjgl.opengl.MacOSXCanvasPeerInfo" />
<class name="org.lwjgl.opengl.MacOSXPeerInfo" />
<class name="org.lwjgl.opengl.MacOSXPbufferPeerInfo" />
<class name="org.lwjgl.opengl.MacOSXDisplay" />
<class name="org.lwjgl.opengl.MacOSXContextImplementation" />
</javah>
<!-- lwjgl -->
<javah classpath="${lwjgl.bin}" destdir="${lwjgl.src.headers}" force="yes">
<class name="org.lwjgl.opengl.AWTSurfaceLock" />
<class name="org.lwjgl.DefaultSysImplementation" />
<class name="org.lwjgl.input.Cursor" />
<class name="org.lwjgl.input.Keyboard" />
<class name="org.lwjgl.input.Mouse" />
<class name="org.lwjgl.openal.ALC" />
<class name="org.lwjgl.openal.AL" />
<class name="org.lwjgl.opengl.GLContext" />
<class name="org.lwjgl.opengl.Pbuffer" />
</javah>
<!-- fmod -->
<javah classpath="${lwjgl.bin}" destdir="${lwjgl.src.headers}/fmod3" force="yes">
<class name="org.lwjgl.fmod3.FMOD" />
<class name="org.lwjgl.fmod3.FMusic" />
<class name="org.lwjgl.fmod3.FSound" />
</javah>
<!-- devil -->
<javah classpath="${lwjgl.bin}" destdir="${lwjgl.src.headers}/devil" force="yes">
<class name="org.lwjgl.devil.IL"/>
<class name="org.lwjgl.devil.ILU"/>
<class name="org.lwjgl.devil.ILUT"/>
</javah>
</target>
<!-- Creates the Javadoc -->
<target name="javadoc" description="Creates javadoc from java source code">
<javadoc destdir="${lwjgl.docs}/javadoc" author="true" version="true" use="true" source="1.4" windowtitle="LWJGL API">
<fileset refid="lwjgl.javadoc.fileset" />
<doctitle><![CDATA[<h1>Lightweight Java Game Toolkit</h1>]]></doctitle>
<bottom><![CDATA[<i>Copyright &#169; 2002-2005 lwjgl.org. All Rights Reserved.</i>]]></bottom>
</javadoc>
2003-11-13 18:16:58 -05:00
</target>
<!-- Compiles the Java source code -->
<target name="generators" description="Compiles the native method generators">
2005-02-20 14:57:06 -05:00
<javac debug="yes" srcdir="${lwjgl.src}/java/" destdir="${lwjgl.bin}" includes="org/lwjgl/util/generator/**.java" source="1.5" target="1.5" taskname="generator">
<compilerarg value="-Xlint:all"/>
</javac>
</target>
<target name="generate-all" depends="generate-openal, generate-opengl, generate-opengl-capabilities, generate-opengl-references" description="Generates java and native source"/>
<target name="generate-openal" depends="generators" description="Generates java and native source for AL">
<!-- Generate OpenAL -->
<apply executable="apt" parallel="true">
<arg value="-nocompile"/>
<arg value="-factory"/>
2005-02-20 14:57:06 -05:00
<arg value="org.lwjgl.util.generator.GeneratorProcessorFactory"/>
<arg value="-cp"/>
2005-02-15 06:44:36 -05:00
<arg path="${lwjgl.src}/java:${lwjgl.src.templates}:${lwjgl.bin}:${java.class.path}"/>
<arg value="-s"/>
2005-02-15 06:44:36 -05:00
<arg path="${lwjgl.src}/java"/>
<arg value="-d"/>
2005-02-15 06:44:36 -05:00
<arg path="${lwjgl.src.headers}"/>
2005-02-20 14:57:06 -05:00
<arg value="-Atypemap=org.lwjgl.util.generator.ALTypeMap"/>
<arg value="-Ageneratechecks"/>
<fileset dir="${lwjgl.src.templates}" includes="org/lwjgl/openal/AL10.java"/>
</apply>
</target>
<target name="-generate-opengl-from-template" depends="generators" description="Generates java and native source for a GL function set">
<!-- there's no apt task in ant yet, so we'll just invoke it manually for now -->
<apply executable="apt" parallel="true">
<arg value="-nocompile"/>
<arg value="-factory"/>
2005-02-20 14:57:06 -05:00
<arg value="org.lwjgl.util.generator.GeneratorProcessorFactory"/>
<arg value="-cp"/>
2005-02-15 06:44:36 -05:00
<arg path="${lwjgl.src}/java:${lwjgl.src.templates}:${lwjgl.bin}:${java.class.path}"/>
<arg value="-s"/>
2005-02-15 06:44:36 -05:00
<arg path="${lwjgl.src}/java"/>
<arg value="-d"/>
2005-02-15 06:44:36 -05:00
<arg path="${lwjgl.src.headers}"/>
<arg value="-Acontextspecific"/>
2005-02-20 14:57:06 -05:00
<arg value="-Atypemap=org.lwjgl.util.generator.GLTypeMap"/>
<fileset dir="${lwjgl.src.templates}" includes="${template-pattern}"/>
2005-02-15 15:02:24 -05:00
</apply>
</target>
<target name="generate-opengl" depends="generators" description="Generates java and native source for GL">
<antcall target="-generate-opengl-from-template">
<param name="template-pattern" value="org/lwjgl/opengl/GL*.java"/>
</antcall>
<antcall target="-generate-opengl-from-template">
<param name="template-pattern" value="org/lwjgl/opengl/ARB*.java"/>
</antcall>
<antcall target="-generate-opengl-from-template">
<param name="template-pattern" value="org/lwjgl/opengl/ATI*.java"/>
</antcall>
<antcall target="-generate-opengl-from-template">
<param name="template-pattern" value="org/lwjgl/opengl/EXT*.java"/>
</antcall>
<antcall target="-generate-opengl-from-template">
<param name="template-pattern" value="org/lwjgl/opengl/NV*.java"/>
</antcall>
<antcall target="-generate-opengl-from-template">
<param name="template-pattern" value="org/lwjgl/opengl/HP*.java"/>
</antcall>
<antcall target="-generate-opengl-from-template">
<param name="template-pattern" value="org/lwjgl/opengl/IBM*.java"/>
</antcall>
<antcall target="-generate-opengl-from-template">
<param name="template-pattern" value="org/lwjgl/opengl/SUN*.java"/>
</antcall>
</target>
<target name="generate-opengl-references" depends="generators" description="Generates java and native source for GL">
<!-- Generate context capabilities -->
<apply executable="apt" parallel="true">
<arg value="-nocompile"/>
<arg value="-factory"/>
<arg value="org.lwjgl.util.generator.ReferencesGeneratorProcessorFactory"/>
<arg value="-cp"/>
<arg path="${lwjgl.src}/java:${lwjgl.src.templates}:${lwjgl.bin}:${java.class.path}"/>
<arg value="-s"/>
<arg path="${lwjgl.src}/java"/>
<fileset dir="${lwjgl.src.templates}" includes="org/lwjgl/opengl/*.java"/>
</apply>
</target>
<target name="generate-opengl-capabilities" depends="generators" description="Generates java and native source for GL">
<!-- Generate context capabilities -->
<apply executable="apt" parallel="true">
<arg value="-nocompile"/>
<arg value="-factory"/>
2005-02-20 14:57:06 -05:00
<arg value="org.lwjgl.util.generator.ContextGeneratorProcessorFactory"/>
<arg value="-cp"/>
<arg path="${lwjgl.src}/java:${lwjgl.src.templates}:${lwjgl.bin}:${java.class.path}"/>
<arg value="-s"/>
<arg path="${lwjgl.src}/java"/>
<arg value="-Acontextspecific"/>
<fileset dir="${lwjgl.src.templates}" includes="org/lwjgl/opengl/*.java"/>
</apply>
</target>
2004-10-17 17:16:40 -04:00
2003-11-13 18:16:58 -05:00
<!-- Compiles the native files -->
2004-10-17 17:16:40 -04:00
<target name="compile_native" depends="headers" description="Compiles the native files">
2003-11-13 18:16:58 -05:00
<!-- check each platform, and run their build target -->
2004-10-17 17:16:40 -04:00
<condition property="lwjgl.platform.windows">
<os family="windows" />
</condition>
<antcall target="-compile_native_win32" />
<condition property="lwjgl.platform.linux">
<os name="Linux" />
</condition>
<antcall target="-compile_native_linux" />
<condition property="lwjgl.platform.mac">
<os name="Mac OS X" />
</condition>
<antcall target="-compile_native_mac" />
</target>
2003-11-13 18:16:58 -05:00
<!-- Compiles LWJGL on Win32 platforms -->
2004-09-06 12:36:08 -04:00
<target name="-compile_native_win32" if="lwjgl.platform.windows">
2004-10-17 17:16:40 -04:00
<echo>Compiling Win32 LWJGL version</echo>
<!-- check for required properties -->
<property environment="env"/>
<fail message="Missing PLTSDKHOME path environment property" unless="env.PLTSDKHOME"/>
<fail message="Missing ALHOME path environment property" unless="env.ALHOME"/>
<fail message="Missing JAVA_HOME path environment property" unless="env.JAVA_HOME"/>
<fail message="Missing CHOME path environment property" unless="env.CHOME"/>
<fail message="Missing DXHOME path environment property" unless="env.DXHOME"/>
<fail message="Missing FMODHOME path environment property" unless="env.FMODHOME"/>
<antcall target="-compile_native_win32_main" />
<antcall target="-compile_native_win32_fmod" />
<antcall target="-compile_native_win32_devil" />
</target>
<target name="-compile_native_win32_main" unless="lwjgl.main.built">
2004-09-06 12:36:08 -04:00
<!-- build main -->
<exec dir="platform_build/win32_ms_cmdline" executable="cmd.exe" failonerror="true">
2004-10-17 17:16:40 -04:00
<arg line="/c build.bat" />
2004-09-06 12:36:08 -04:00
</exec>
<move file="platform_build/win32_ms_cmdline/lwjgl.dll" tofile="${lwjgl.lib}/win32/lwjgl.dll"/>
</target>
2004-10-17 17:16:40 -04:00
<target name="-compile_native_win32_fmod" unless="lwjgl.fmod.built">
2004-09-06 12:36:08 -04:00
<!-- build fmod -->
<exec dir="platform_build/win32_ms_cmdline" executable="cmd.exe" failonerror="true">
2004-10-17 17:16:40 -04:00
<arg line="/c build-fmod.bat" />
2004-09-06 12:36:08 -04:00
</exec>
<move file="platform_build/win32_ms_cmdline/lwjgl-fmod3.dll" tofile="${lwjgl.lib}/win32/lwjgl-fmod3.dll"/>
</target>
<target name="-compile_native_win32_devil" unless="lwjgl.devil.built">
<!-- build devil -->
<exec dir="platform_build/win32_ms_cmdline" executable="cmd.exe" failonerror="true">
<arg line="/c build-devil.bat"/>
</exec>
<move file="platform_build/win32_ms_cmdline/lwjgl-devil.dll" tofile="${lwjgl.lib}/win32/lwjgl-devil.dll"/>
</target>
2004-09-06 12:36:08 -04:00
<!-- Compiles LWJGL on Linux platforms -->
<target name="-compile_native_linux" if="lwjgl.platform.linux">
2003-11-13 18:16:58 -05:00
<echo>Compiling Linux LWJGL version</echo>
<!-- check for required properties -->
<property environment="env"/>
<fail message="Missing JAVA_HOME path environment property" unless="env.JAVA_HOME"/>
<fail message="Missing FMOD path environment property" unless="env.FMOD"/>
<exec executable="make" dir="${lwjgl.src.native}/linux"/>
2005-05-18 16:41:28 -04:00
<exec executable="make" dir="${lwjgl.src.native}/common/devil">
<arg line="-f Makefile.linux"/>
</exec>
<exec executable="make" dir="${lwjgl.src.native}/common/fmod3">
<arg line="-f Makefile.linux"/>
</exec>
<move file="${lwjgl.src.native}/linux/liblwjgl.so" tofile="${lwjgl.lib}/linux/liblwjgl.so" />
<move file="${lwjgl.src.native}/common/devil/liblwjgl-devil.so" tofile="${lwjgl.lib}/linux/liblwjgl-devil.so" />
<move file="${lwjgl.src.native}/common/fmod3/liblwjgl-fmod3.so" tofile="${lwjgl.lib}/linux/liblwjgl-fmod3.so" />
2004-10-17 17:16:40 -04:00
</target>
2003-11-13 18:16:58 -05:00
<!-- Compiles LWJGL on Mac OS X platforms -->
2005-01-25 15:50:44 -05:00
<target name="-compile_native_mac" if="lwjgl.platform.mac">
<!-- check for required properties -->
<property environment="env"/>
<fail message="Missing AL path environment property" unless="env.AL"/>
<fail message="Missing FMOD path environment property" unless="env.FMOD"/>
2005-05-18 16:57:57 -04:00
<exec executable="make" dir="${lwjgl.src.native}/macosx" failonerror="true"/>
<exec executable="make" dir="${lwjgl.src.native}/common/devil">
<arg line="-f Makefile.macosx"/>
</exec>
<exec executable="make" dir="${lwjgl.src.native}/common/fmod3">
<arg line="-f Makefile.macosx"/>
</exec>
<move file="${lwjgl.src.native}/macosx/liblwjgl.jnilib" tofile="${lwjgl.lib}/macosx/liblwjgl.jnilib" />
<move file="${lwjgl.src.native}/common/devil/liblwjgl-devil.jnilib" tofile="${lwjgl.lib}/macosx/liblwjgl-devil.jnilib" />
<move file="${lwjgl.src.native}/common/fmod3/liblwjgl-fmod3.jnilib" tofile="${lwjgl.lib}/macosx/liblwjgl-fmod3.jnilib" />
</target>
2003-11-13 18:16:58 -05:00
<!-- Creates a build of LWJGL directly from CVS -->
2004-09-06 12:36:08 -04:00
<target name="cvsbuild" description="Builds lwjgl from cvs">
2003-11-13 18:16:58 -05:00
<!-- Check that files do not exist BEFORE doing the CVS build -->
2004-10-17 17:16:40 -04:00
<available file="LWJGL/build.xml" property="lwjgl.preexistingfiles" />
<available file="${lwjgl.src}/java/org/lwjgl/Sys.java" property="lwjgl.preexistingfiles" />
<fail if="lwjgl.preexistingfiles" message="Cannot perform webbuild from nonempty folder" />
2003-11-13 18:16:58 -05:00
<!-- checkout files and build using checked out buildfiles 'all' target -->
2004-10-17 17:16:40 -04:00
<cvs command="export -D 'now'" compressionlevel="3" cvsRoot=":pserver:anonymous@cvs.sf.net:/cvsroot/java-game-lib" package="LWJGL/build.xml" dest="." />
<cvs command="export -D 'now'" compressionlevel="3" cvsRoot=":pserver:anonymous@cvs.sf.net:/cvsroot/java-game-lib" package="LWJGL/src" dest="." />
<cvs command="export -D 'now'" compressionlevel="3" cvsRoot=":pserver:anonymous@cvs.sf.net:/cvsroot/java-game-lib" package="LWJGL/doc" dest="." />
<ant dir="LWJGL" target="compile_native" />
<ant dir="LWJGL" target="release" />
</target>
2005-05-19 18:30:35 -04:00
<!-- -->
<target name="sign" description="Using relased files, creates the nescesarry files used for jnlp demos">
<!-- delete existing temp -->
<delete dir="${lwjgl.temp}"/>
<!-- unzip common files -->
<unzip src="${lwjgl.dist}/lwjgl-win32-${lwjgl.version}.zip" dest="${lwjgl.temp}/jnlp/temp" overwrite="true"/>
<unzip src="${lwjgl.dist}/lwjgl-linux-${lwjgl.version}.zip" dest="${lwjgl.temp}/jnlp/temp" overwrite="true"/>
<unzip src="${lwjgl.dist}/lwjgl-macosx-${lwjgl.version}.zip" dest="${lwjgl.temp}/jnlp/temp" overwrite="true"/>
<!-- move relevant files to root -->
<move todir="${lwjgl.temp}/jnlp" flatten="true">
<fileset dir="${lwjgl.temp}/jnlp/temp">
<include name="**/**.jar"/>
</fileset>
</move>
<!-- create native jars -->
<jar destfile="${lwjgl.temp}/jnlp/native_win32.jar" basedir="${lwjgl.temp}/jnlp/temp/lwjgl-win32-${lwjgl.version}/native/"/>
<jar destfile="${lwjgl.temp}/jnlp/native_linux.jar" basedir="${lwjgl.temp}/jnlp/temp/lwjgl-linux-${lwjgl.version}/native/"/>
<jar destfile="${lwjgl.temp}/jnlp/native_macosx.jar" basedir="${lwjgl.temp}/jnlp/temp/lwjgl-macosx-${lwjgl.version}/native/"/>
<!-- create media jar -->
<jar destfile="${lwjgl.temp}/jnlp/media.jar" basedir="${lwjgl.res}"/>
<!-- sign 'em -->
<input message="Please enter store password:" addproperty="store.pwd" />
2005-08-18 09:48:18 -04:00
<signjar jar="${lwjgl.temp}/jnlp/lwjgl.jar" alias="matzon" storepass="${store.pwd}"/>
2005-05-19 18:30:35 -04:00
<signjar jar="${lwjgl.temp}/jnlp/lwjgl_devil.jar" alias="matzon" storepass="${store.pwd}"/>
<signjar jar="${lwjgl.temp}/jnlp/lwjgl_fmod3.jar" alias="matzon" storepass="${store.pwd}"/>
2005-08-18 09:48:18 -04:00
<signjar jar="${lwjgl.temp}/jnlp/lwjgl_test.jar" alias="matzon" storepass="${store.pwd}"/>
<signjar jar="${lwjgl.temp}/jnlp/lwjgl_util.jar" alias="matzon" storepass="${store.pwd}"/>
<signjar jar="${lwjgl.temp}/jnlp/media.jar" alias="matzon" storepass="${store.pwd}"/>
2005-05-19 18:30:35 -04:00
<signjar jar="${lwjgl.temp}/jnlp/native_linux.jar" alias="matzon" storepass="${store.pwd}"/>
<signjar jar="${lwjgl.temp}/jnlp/native_macosx.jar" alias="matzon" storepass="${store.pwd}"/>
<signjar jar="${lwjgl.temp}/jnlp/native_win32.jar" alias="matzon" storepass="${store.pwd}"/>
2005-08-18 09:48:18 -04:00
<signjar jar="${lwjgl.temp}/jnlp/jinput.jar" alias="matzon" storepass="${store.pwd}"/>
2005-05-19 18:30:35 -04:00
</target>
<target name="changelog">
<cvschangelog destfile="changelog.xml"/>
<style in="changelog.xml" out="changelog.html" style="${ant.home}/etc/changelog.xsl">
<param name="title" expression="LWJGL ChangeLog"/>
<param name="module" expression="LWJGL"/>
<param name="cvsweb" expression="http://cvs.sourceforge.net/viewcvs.py/java-game-lib/"/>
</style>
</target>
2003-12-15 07:18:15 -05:00
</project>