-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.xml
89 lines (79 loc) · 3.05 KB
/
build.xml
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
<project name="liboo" default="dist" basedir=".">
<description>firm object-orientation support library</description>
<property name="build" location="${basedir}/classes"/>
<property name="src" location="${basedir}/src"/>
<property name="lib" location="${basedir}/lib"/>
<property name="jar" value="liboo.jar"/>
<property name="jfirm.jar" value="jfirm.jar"/>
<property name="jfirm.location" value="${basedir}/../jFirm"/>
<property name="libfirm.location" value="${basedir}/../libfirm"/>
<property name="make.exe" value="make"/>
<property name="liboo.location" value="${x10.home}/liboo"/>
<condition property="buildvariant" value="${VARIANT}" else="debug">
<isset property="VARIANT"/>
</condition>
<path id="project.classpath">
<path refid="jfirm.classpath"/>
</path>
<path id="jfirm.classpath">
<pathelement location="${jfirm.location}/classes"/>
<pathelement location="${jfirm.location}/lib/jna.jar"/>
</path>
<target name="init">
<mkdir dir="${build}"/>
<available property="libfirm.exists" file="${basedir}/../libfirm"/>
<available property="config.mak.exists" file="${basedir}/config.mak"/>
</target>
<target name="c-build-init" if="libfirm.exists" unless="config.mak.exists">
<echo file="${basedir}/config.mak">
FIRM_HOME = ../libfirm
LIBFIRM_CPPFLAGS = -I$(FIRM_HOME)/include -I$(FIRM_HOME)/build/gen/include/libfirm
LIBFIRM_LFLAGS = -L$(FIRM_HOME)/build/$(variant) -lfirm
</echo>
</target>
<target name="clean" depends="clean-default, clean-target">
<delete dir="${build}" failonerror="false"/>
</target>
<target name="clean-default" unless="TARGET">
<exec executable="${make.exe}" failonerror="false" dir="${basedir}">
<arg value="clean"/>
<arg value="variant=${buildvariant}"/>
</exec>
</target>
<target name="clean-target" if="TARGET">
<exec executable="${make.exe}" failonerror="false" dir="${basedir}">
<arg line="TARGET=${TARGET} clean"/>
<arg value="variant=${buildvariant}"/>
</exec>
</target>
<target name="c-build" depends="c-build-default, c-build-target"/>
<target name="c-build-default" depends="c-build-init" unless="TARGET">
<exec executable="${make.exe}" failonerror="true" dir="${basedir}">
<arg value="variant=${buildvariant}"/>
</exec>
</target>
<target name="c-build-target" depends="c-build-init" if="TARGET">
<exec executable="${make.exe}" failonerror="true" dir="${basedir}">
<arg value="TARGET=${TARGET}"/>
<arg value="variant=${buildvariant}"/>
</exec>
</target>
<target name="build" depends="init">
<depend destdir="${build}" srcdir="${src}" cache="${build}/depends" closure="yes"/>
<javac destdir="${build}" source="1.5" target="1.5" debug="on" includeantruntime="false">
<src path="${src}"/>
<classpath refid="project.classpath"/>
</javac>
</target>
<target name="jar" depends="build">
<jar jarfile="${build}/${jar}">
<fileset dir="${build}" excludes="${jar}"/>
</jar>
</target>
<target name="dist" depends="jar,c-build">
<mkdir dir="${lib}"/>
<copy todir="${lib}">
<fileset dir="${build}" includes="${jar}"/>
</copy>
</target>
</project>