1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
|
<!-- Ant build.xml for the D Programming Language -->
<project name="d_build" default="all" basedir=".">
<!-- Build target program name -->
<property name="name" value="tf"/>
<!-- Libraries -->
<property name="libsdir" value="lib\"/>
<property name="libs" value="${libsdir}SDL.lib ${libsdir}SDL_mixer.lib ${libsdir}opengl32.lib ${libsdir}bulletml.lib"/>
<property name="prog" value="${name}.exe"/>
<!-- Imported .d files directory -->
<property name="import" location="import"/>
<!-- Source files directory -->
<property name="src" location="src"/>
<!-- Resource(icon) files directory -->
<property name="resource" location="resource"/>
<!-- Build all -->
<target name="all" depends="compile, link"/>
<target name="rebuild" depends="clean, compile, link"/>
<target name="compile">
<apply executable="dmd" dir="${src}" dest="${src}" parallel="false" failonerror="true">
<mapper type="glob" from="*.d" to="*.obj"/>
<fileset dir="${src}" includes="**/*.d"/>
<arg value="-c"/>
<arg value="-I${import}"/>
<arg value="-op"/>
<arg value="-O"/>
<arg value="-release"/>
<arg value="-version=Win32_release"/>
<srcfile/>
</apply>
</target>
<target name="link">
<apply executable="dmd" dir="." parallel="true" failonerror="true">
<fileset dir="${src}" includes="**/*.obj"/>
<fileset dir="${import}" includes="**/*.obj"/>
<fileset dir="${resource}" includes="*.RES"/>
<fileset dir="${resource}" includes="*.def"/>
<arg value="${prog}"/>
<arg value="${libs}"/>
<srcfile/>
</apply>
</target>
<!-- Clean an exe file and obj files -->
<target name="clean">
<delete file="${prog}"/>
<delete>
<fileset dir="${src}" includes="**/*.obj"/>
</delete>
</target>
<!-- Run the target -->
<target name="run">
<exec executable="${name}" dir=".">
<arg value="-window"/>
<arg value="-nosound"/>
</exec>
</target>
<!-- Create a resource file(for an icon)(BCC55 required) -->
<target name="resource">
<apply executable="brcc32" dir="${resource}" parallel="false" failonerror="true">
<fileset dir="${resource}" includes="${name}.rc"/>
<srcfile/>
</apply>
</target>
<!-- Build libraries in the import directory -->
<target name="buildlib">
<apply executable="dmd" dir="${import}" dest="${import}" parallel="false" failonerror="false">
<mapper type="glob" from="*.d" to="*.obj"/>
<fileset dir="${import}" includes="**/*.d"/>
<arg value="-c"/>
<arg value="-I${import}"/>
<arg value="-op"/>
<srcfile/>
</apply>
</target>
</project>
|