1 <project name="gdx-bullet-IOS-32" basedir="." default="postcompile">
\r
2 <!-- include the environment -->
\r
3 <property environment="env"/>
\r
4 <!-- output directory for temporary object files -->
\r
5 <property name="buildDir" value="target/ios32" />
\r
6 <!-- output directory for the shared library -->
\r
7 <property name="libsDir" value="../libs/ios32" />
\r
8 <!-- the name of the shared library -->
\r
9 <property name="libName" value="libgdx-bullet.a"/>
\r
10 <!-- the jni header jniPlatform to use -->
\r
11 <property name="jniPlatform" value="mac"/>
\r
12 <!-- the compilerPrefix for the C & C++ compilers -->
\r
13 <property name="compilerPrefix" value=""/>
\r
14 <property name="iphoneos-platform" value="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin"/>
\r
15 <property name="iphoneos-sdk" value="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/"/>
\r
16 <property name="iphonesimulator-platform" value="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin"/>
\r
17 <property name="iphonesimulator-sdk" value="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk/"/>
\r
19 <!-- define gcc compiler, options and files to compile -->
\r
20 <property name="gcc" value="${compilerPrefix}gcc"/>
\r
21 <property name="gcc-opts" value="-c -Wall -O2 -miphoneos-version-min=5.1"/>
\r
22 <fileset id="gcc-files" dir="./">
\r
23 <exclude name="target/"/>
\r
24 <include name="memcpy_wrap.c"/>
\r
25 <include name="**/*.c"/>
\r
27 <exclude name="src/bullet/BulletMultiThreaded/GpuSoftBodySolvers/**"/>
\r
31 <!-- define g++ compiler, options and files to compile -->
\r
32 <property name="g++" value="${compilerPrefix}g++"/>
\r
33 <property name="g++-opts" value="-c -Wall -O2 -miphoneos-version-min=5.1 -fno-strict-aliasing -fno-rtti -DBT_NO_PROFILE"/>
\r
34 <fileset id="g++-files" dir="./">
\r
35 <exclude name="target/"/>
\r
36 <include name="**/*.cpp"/>
\r
38 <exclude name="src/bullet/BulletMultiThreaded/GpuSoftBodySolvers/**"/>
\r
42 <!-- define linker and options -->
\r
43 <property name="linker" value="${compilerPrefix}ar"/>
\r
44 <property name="linker-opts" value="rcs"/>
\r
45 <property name="libraries" value=""/>
\r
47 <!-- cleans the build directory, removes all object files and shared libs -->
\r
48 <target name="clean">
\r
49 <delete includeemptydirs="true" quiet="true">
\r
50 <fileset dir="${buildDir}"/>
\r
51 <fileset dir="${libsDir}" includes="**/*" excludes="**/.svn"/>
\r
55 <target name="clean-objfiles">
\r
57 <fileset dir="${buildDir}">
\r
58 <include name="**/*.o"/>
\r
63 <target name="create-build-dir">
\r
64 <!-- FIXME this is pretty nasty :/ -->
\r
65 <copy todir="${buildDir}">
\r
66 <fileset refid="g++-files"/>
\r
67 <fileset refid="gcc-files"/>
\r
70 <fileset dir="${buildDir}">
\r
72 <exclude name="*.o"/>
\r
77 <!-- compiles all C and C++ files to object files in the build directory, for 386 builds-->
\r
78 <target name="compile-386" depends="clean,create-build-dir">
\r
79 <mkdir dir="${buildDir}"/>
\r
80 <apply failonerror="true" executable="${iphonesimulator-platform}/${g++}" dest="${buildDir}" verbose="true">
\r
81 <arg line="-isysroot ${iphonesimulator-sdk} -arch i386 ${g++-opts}"/>
\r
82 <arg value="-Ijni-headers"/>
\r
83 <arg value="-Ijni-headers/${jniPlatform}"/>
\r
85 <arg value="-Isrc/bullet/"/>
\r
86 <arg value="-Isrc/custom/"/>
\r
87 <arg value="-Isrc/extras/Serialize/"/>
\r
92 <fileset refid="g++-files"/>
\r
94 <mapper type="glob" from="*.cpp" to="*.o"/>
\r
95 <mapper type="glob" from="*.mm" to="*.o"/>
\r
98 <apply failonerror="true" executable="${iphonesimulator-platform}/${gcc}" dest="${buildDir}" verbose="true">
\r
99 <arg line="-isysroot ${iphonesimulator-sdk} -arch i386 ${gcc-opts}"/>
\r
100 <arg value="-Ijni-headers"/>
\r
101 <arg value="-Ijni-headers/${jniPlatform}"/>
\r
103 <arg value="-Isrc/bullet/"/>
\r
104 <arg value="-Isrc/custom/"/>
\r
105 <arg value="-Isrc/extras/Serialize/"/>
\r
110 <fileset refid="gcc-files"/>
\r
112 <mapper type="glob" from="*.c" to="*.o"/>
\r
117 <!-- links the shared library based on the previously compiled object files -->
\r
118 <target name="link-386" depends="compile-386">
\r
119 <fileset dir="${buildDir}" id="objFileSet">
\r
121 <include name="**/*.o" />
\r
124 <pathconvert pathsep=" " property="objFiles" refid="objFileSet" />
\r
125 <mkdir dir="${libsDir}" />
\r
126 <exec executable="${iphonesimulator-platform}/${linker}" failonerror="true" dir="${buildDir}">
\r
127 <arg line="${linker-opts}" />
\r
128 <arg path="${libsDir}/${libName}.386" />
\r
129 <arg line="${objFiles}"/>
\r
130 <arg line="${libraries}" />
\r
134 <!-- compiles all C and C++ files to object files in the build directory, for 386 builds-->
\r
135 <target name="compile-arm" depends="create-build-dir,clean-objfiles">
\r
136 <mkdir dir="${buildDir}"/>
\r
137 <apply failonerror="true" executable="${iphoneos-platform}/${g++}" dest="${buildDir}" verbose="true">
\r
138 <arg line="-isysroot ${iphoneos-sdk} -arch armv7 ${g++-opts}"/>
\r
139 <arg value="-Ijni-headers"/>
\r
140 <arg value="-Ijni-headers/${jniPlatform}"/>
\r
142 <arg value="-Isrc/bullet/"/>
\r
143 <arg value="-Isrc/custom/"/>
\r
144 <arg value="-Isrc/extras/Serialize/"/>
\r
149 <fileset refid="g++-files"/>
\r
151 <mapper type="glob" from="*.cpp" to="*.o"/>
\r
152 <mapper type="glob" from="*.mm" to="*.o"/>
\r
155 <apply failonerror="true" executable="${iphoneos-platform}/${gcc}" dest="${buildDir}" verbose="true">
\r
156 <arg line="-isysroot ${iphoneos-sdk} -arch armv7 ${gcc-opts}"/>
\r
157 <arg value="-Ijni-headers"/>
\r
158 <arg value="-Ijni-headers/${jniPlatform}"/>
\r
160 <arg value="-Isrc/bullet/"/>
\r
161 <arg value="-Isrc/custom/"/>
\r
162 <arg value="-Isrc/extras/Serialize/"/>
\r
167 <fileset refid="gcc-files"/>
\r
169 <mapper type="glob" from="*.c" to="*.o"/>
\r
174 <!-- links the shared library based on the previously compiled object files -->
\r
175 <target name="link-arm" depends="compile-arm">
\r
176 <fileset dir="${buildDir}" id="objFileSet">
\r
178 <include name="**/*.o" />
\r
181 <pathconvert pathsep=" " property="objFiles" refid="objFileSet" />
\r
182 <mkdir dir="${libsDir}" />
\r
183 <exec executable="${iphoneos-platform}/${linker}" failonerror="true" dir="${buildDir}">
\r
184 <arg line="${linker-opts}" />
\r
185 <arg path="${libsDir}/${libName}.armv7" />
\r
186 <arg line="${objFiles}"/>
\r
187 <arg line="${libraries}" />
\r
191 <target name="link-fat">
\r
192 <exec executable="lipo" failonerror="true" dir="${libsDir}">
\r
193 <arg line="-create -output ${libName} ${libName}.386 ${libName}.armv7"/>
\r
197 <target name="postcompile" depends="link-386,link-arm,link-fat">
\r