--- /dev/null
+<project name="gdx-natives" basedir="." default="link">\r
+ <!-- include the environment -->\r
+ <property environment="env"/> \r
+ \r
+ <!-- defined build directory where object files and shared lib will be placed in -->\r
+ <property name="builddir" value="../linux"/>\r
+ <property name="libname" value="libgdx.so"/>\r
+ <property name="jni-platform" value="linux"/>\r
+ \r
+ <!-- define g++ compiler, options and files to compile -->\r
+ <property name="g++" value="g++"/>\r
+ <property name="g++-opts" value="-c -Wall -O2 -mfpmath=sse -msse2 -DFIXED_POINT -fmessage-length=0 -fPic"/>\r
+ <fileset id="g++-files" dir="./">\r
+ <include name="**/*.cpp"/>\r
+ <exclude name="Mpg123Decoder.cpp"/>\r
+ <exclude name="mpg123/**"/>\r
+ </fileset>\r
+ \r
+ <!-- define gcc compiler, options and files to compile -->\r
+ <property name="gcc" value="g++"/> \r
+ <property name="gcc-opts" value="${g++-opts}"/>\r
+ <fileset id="gcc-files" dir="./"> \r
+ <include name="**/*.c"/> \r
+ <exclude name="mpg123/**"/>\r
+ </fileset>\r
+\r
+ <!-- define linker and options -->\r
+ <property name="linker" value="g++"/>\r
+ <property name="linker-opts" value="-shared"/>\r
+ \r
+ <!-- cleans the build directory, removes all object files and shared libs -->\r
+ <target name="clean">\r
+ <delete includeemptydirs="true">\r
+ <fileset dir="${builddir}" includes="**/*" excludes="**/.svn"/>\r
+ </delete>\r
+ </target>\r
+\r
+ <!-- compiles all C and C++ files to object files in the build directory -->\r
+ <target name="compile">\r
+ <apply failonerror="true" executable="${g++}" dest="${builddir}" verbose="true">\r
+ <arg line="${g++-opts}"/>\r
+ <arg value="-I${env.JAVA_HOME}/include"/>\r
+ <arg value="-I${env.JAVA_HOME}/include/${jni-platform}"/>\r
+ <arg value="-I./"/>\r
+ <srcfile/>\r
+ <arg value="-o"/>\r
+ <targetfile/>\r
+ <fileset refid="g++-files"/>\r
+ <chainedmapper>\r
+ <flattenmapper/>\r
+ <mapper type="glob" from="*.cpp" to="*.o"/>\r
+ </chainedmapper>\r
+ </apply>\r
+ <apply failonerror="true" executable="${gcc}" dest="${builddir}" verbose="true">\r
+ <arg line="${gcc-opts}"/>\r
+ <arg value="-I${env.JAVA_HOME}/include"/>\r
+ <arg value="-I${env.JAVA_HOME}/include/${jni-platform}"/>\r
+ <arg value="-I./"/>\r
+ <srcfile/>\r
+ <arg value="-o"/>\r
+ <targetfile/>\r
+ <fileset refid="gcc-files"/>\r
+ <chainedmapper>\r
+ <flattenmapper/>\r
+ <mapper type="glob" from="*.c" to="*.o"/>\r
+ </chainedmapper>\r
+ </apply>\r
+ </target> \r
+\r
+ <!-- links the shared library based on the previously compiled object files -->\r
+ <target name="link" depends="compile">\r
+ <exec executable="${linker}" dir="${builddir}">\r
+ <arg line="${linker-opts} -o ${libname} *.o"/>\r
+ </exec> \r
+ </target>\r
+</project>
\ No newline at end of file