File: build.xml

package info (click to toggle)
titanion 0.3.dfsg1-7
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster
  • size: 6,632 kB
  • sloc: xml: 68; makefile: 28
file content (101 lines) | stat: -rw-r--r-- 3,241 bytes parent folder | download | duplicates (7)
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
<!-- Ant build.xml for the D Programming Language           -->
<!-- Apache Ant             : http://ant.apache.org/        -->
<!-- D Programming Language : http://www.digitalmars.com/d/ -->

<project name="d_build" default="all" basedir=".">
	<!-- Target program name -->
	<property name="name" value="ttn"/>
	<!-- Libraries -->
	<property name="libsdir" value="lib\"/>
	<property name="libs" value="${libsdir}SDL.lib ${libsdir}SDL_d.lib ${libsdir}SDL_mixer.lib ${libsdir}opengl32.lib ${libsdir}glu32.lib"/>
	<!-- Program file name -->
	<property name="prog" value="${name}.exe"/>
	<!-- Imported .d files directory -->
	<property name="import" location="import"/>
	<property name="builtimport" value="SDL_mixer.d"/>
	<!-- 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="all" depends="cleanpart, compile, link"/>
	<target name="rebuild" depends="clean, compile, link"/>
	<target name="compile">
		<apply executable="dmd" dir="${src}" dest="${src}" parallel="true" failonerror="true" skipemptyfilesets="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"/>
<!--
			<arg value="-debug"/>
			<arg value="-g"/>
-->
			<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="-g"/>
			<arg value="-L/MAP"/>
-->
			<arg value="${prog}"/>
			<arg value="${libs}"/>
			<srcfile/>
		</apply>
	</target>

	<!-- Clean a program file and obj files -->
	<target name="clean">
		<delete file="${prog}"/>
		<delete file="${name}.map"/>
		<delete>
			<fileset dir="${src}" includes="**/*.obj"/>
		</delete>
	</target>

	<!-- To avoid the template instance forward reference problem -->
	<target name="cleanpart">
		<delete>
			<fileset dir="${src}" includes="**/boot.obj"/>
		</delete>
	</target>

	<!-- Run the target -->
	<target name="run">
		<exec executable="${name}" dir=".">
		</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="${builtimport}"/>
			<arg value="-c"/>
			<arg value="-I${import}"/>
			<arg value="-op"/>
			<srcfile/>
		</apply>
	</target>
</project>