Tweak configure.sh script to pick up newest version of configure classes.
[jnode:svn-mirror.git] / core / build.xml
1 <project name="JNode-Core" default="all" basedir=".">
2
3   <typedef file="${basedir}/../all/lib/jnode.xml"/>
4                 
5   <property name="my-build.dir" value="${basedir}/build"/>
6   <property name="my-gen.dir" value="${my-build.dir}/gen"/>
7   <property name="my-gen-plan.dir" value="${my-build.dir}/gen-plan"/>
8   <property name="my-classes.dir" value="${my-build.dir}/classes"/>
9   <property name="my-classes-plan.dir" value="${my-build.dir}/classes-plan"/>
10   <property name="my-src.dir" value="${basedir}/src"/>
11   <property name="my-non-resources" value="**/*.java,**/package.html"/>
12         
13   <!-- Subproject specific classpath -->
14   <path id="my-cp">
15     <path refid="cp"/>
16         <pathelement location="${mmtk.jar}"/>
17         <pathelement location="${mauve.jar}"/>
18   </path>
19
20   <!-- the sources that we have to compile -->
21   <path id="classpath-sources">
22         <pathelement location="${my-src.dir}/classpath/gnu"/>
23         <pathelement location="${my-src.dir}/classpath/java"/>
24         <pathelement location="${my-src.dir}/classpath/javax"/>
25         <pathelement location="${my-src.dir}/classpath/ext"/>
26         <pathelement location="${my-src.dir}/classpath/vm"/>            
27         <pathelement location="${my-src.dir}/classpath/tools"/>
28         <pathelement location="${my-src.dir}/openjdk/java"/>
29         <pathelement location="${my-src.dir}/openjdk/javax"/>
30         <pathelement location="${my-src.dir}/openjdk/org"/>
31         <pathelement location="${my-src.dir}/openjdk/com"/>
32         <pathelement location="${my-src.dir}/openjdk/sun"/>
33         <pathelement location="${my-src.dir}/openjdk/vm"/>
34   </path>
35   <path id="my-sources1">
36         <path refid="classpath-sources"/>
37         <pathelement location="${my-src.dir}/core"/>
38         <pathelement location="${my-src.dir}/endorsed/nanoxml"/>
39         <pathelement location="${my-src.dir}/vmmagic"/>
40         <pathelement location="${my-src.dir}/mmtk-vm"/>
41         <pathelement location="${my-src.dir}/driver"/>
42         <pathelement location="${my-src.dir}/icedtea"/>
43         <pathelement location="${my-src.dir}/test"/>
44   </path>
45   <path id="my-sources">
46         <path refid="my-sources1"/>
47         <pathelement location="${my-gen.dir}"/>
48   </path>
49                 
50   <macrodef name="ExpandTest">
51     <attribute name="classname"/>
52     <attribute name="type"/>
53     <attribute name="template" default="${my-src.dir}/test/org/jnode/test/PrimitiveTest.jtemplate"/>
54     <sequential>
55       <copy tofile="${my-gen.dir}/org/jnode/test/@{classname}.java" file="@{template}">
56         <filterset>
57           <filter token="classname" value="@{classname}"/>
58           <filter token="type" value="@{type}"/>
59         </filterset>
60       </copy>
61     </sequential>
62   </macrodef>
63
64   <macrodef name="CreatePlan">
65     <attribute name="package"/>
66     <sequential>
67       <copy tofile="${my-gen-plan.dir}/@{package}/org/mmtk/vm/Plan.java" 
68             file="${my-src.dir}/mmtk-vm/org/mmtk/vm/Plan.template">
69         <filterset>
70           <filter token="PKG" value="@{package}"/>
71         </filterset>
72       </copy>
73       <copy tofile="${my-gen-plan.dir}/@{package}/org/mmtk/vm/PlanConstants.java" 
74             file="${my-src.dir}/mmtk-vm/org/mmtk/vm/PlanConstants.template">
75         <filterset>
76           <filter token="PKG" value="@{package}"/>
77         </filterset>
78       </copy>
79       <mkdir dir="${my-classes-plan.dir}/@{package}/"/>
80       <jnode.compile destdir="${my-classes-plan.dir}/@{package}/">
81         <src path="${my-gen-plan.dir}/@{package}/"/>
82         <classpath>
83                 <pathelement location="${jnode-code.jar}"/>
84                 <pathelement location="${mmtk.jar}"/>
85         </classpath>
86       </jnode.compile>
87     </sequential>
88   </macrodef>
89
90   <!-- Initialize all subproject directories -->
91   <target name="prepare">
92     <mkdir dir="${my-classes.dir}"/>
93     <mkdir dir="${my-gen.dir}"/>
94         <jnode.copy-descriptors/>
95
96         <copy todir="${my-classes.dir}">
97       <fileset dir="${my-src.dir}/classpath/gnu" includes="**/*.properties"/>
98       <fileset dir="${my-src.dir}/classpath/java" includes="**/*.properties"/>
99       <fileset dir="${my-src.dir}/classpath/vm" includes="**/*.security"/>
100       <fileset dir="${my-src.dir}/classpath/tools" includes="**/*.jav"/>
101       <fileset dir="${my-src.dir}/openjdk/java" includes="**/*.jav"/>
102       <fileset dir="${my-src.dir}/openjdk/javax" includes="**/*.jav"/>
103       <fileset dir="${my-src.dir}/openjdk/org" includes="**/*.jav"/>
104       <fileset dir="${my-src.dir}/openjdk/com" includes="**/*.jav"/>
105       <fileset dir="${my-src.dir}/openjdk/sun" includes="**/*.jav"/>
106       <fileset dir="${my-src.dir}/openjdk/vm" includes="**/*.jav"/>
107     </copy>
108     <ExpandTest classname="PrimitiveIntTest" type="int"/>
109     <ExpandTest classname="PrimitiveLongTest" type="long"/>
110     <ExpandTest classname="PrimitiveFloatTest" type="float"/>
111     <ExpandTest classname="PrimitiveDoubleTest" type="double"/>
112   </target>
113
114   <!-- Compile all subproject java files -->
115   <target name="compile" depends="prepare">
116     <jnode.compile>
117       <bootclasspath>
118         <pathelement location="${classpath-sources}" />
119                 <pathelement location="${mx4j.jar}"/> <!-- should be in GNU Classpath since java 5.0 -->
120       </bootclasspath>
121       <src refid="my-sources" />
122       <classpath refid="my-cp"/>
123     </jnode.compile>
124     <!-- Copy all non java files to class dir -->
125     <copy todir="${my-classes.dir}">
126             <fileset dir="${my-src.dir}/classpath/gnu" excludes="${my-non-resources}"/>
127             <fileset dir="${my-src.dir}/classpath/java" excludes="${my-non-resources}"/>
128             <fileset dir="${my-src.dir}/classpath/javax" excludes="${my-non-resources}"/>
129             <fileset dir="${my-src.dir}/classpath/ext" excludes="${my-non-resources}"/>
130             <fileset dir="${my-src.dir}/classpath/vm" excludes="${my-non-resources}"/>
131             <fileset dir="${my-src.dir}/classpath/tools" excludes="${my-non-resources}"/>
132             <fileset dir="${my-src.dir}/openjdk/java" excludes="${my-non-resources}"/>
133             <fileset dir="${my-src.dir}/openjdk/javax" excludes="${my-non-resources}"/>
134             <fileset dir="${my-src.dir}/openjdk/org" excludes="${my-non-resources}"/>
135             <fileset dir="${my-src.dir}/openjdk/com" excludes="${my-non-resources}"/>
136             <fileset dir="${my-src.dir}/openjdk/sun" excludes="${my-non-resources}"/>
137             <fileset dir="${my-src.dir}/openjdk/vm" excludes="${my-non-resources}"/>
138             <fileset dir="${my-src.dir}/icedtea" excludes="${my-non-resources}"/>
139             <fileset dir="${my-src.dir}/core" excludes="${my-non-resources}"/>
140             <fileset dir="${my-src.dir}/endorsed/nanoxml" excludes="${my-non-resources}"/>
141             <fileset dir="${my-src.dir}/vmmagic" excludes="${my-non-resources}"/>
142             <fileset dir="${my-src.dir}/mmtk-vm" excludes="${my-non-resources}"/>
143             <fileset dir="${my-src.dir}/driver" excludes="${my-non-resources}"/>
144             <fileset dir="${my-src.dir}/test" excludes="${my-non-resources}"/>
145     </copy>
146         
147         <!-- Create & compile plan classes -->
148         <CreatePlan package="org.jnode.vm.memmgr.mmtk.genrc"/>
149         <CreatePlan package="org.jnode.vm.memmgr.mmtk.ms"/>
150         <CreatePlan package="org.jnode.vm.memmgr.mmtk.nogc"/>
151   </target>
152         
153   <!-- Assemble the jarfile -->
154   <target name="assemble" depends="compile">
155   </target>
156
157   <!-- Do it all -->
158   <target name="all" depends="assemble"/>
159
160   <!-- Clean everything -->
161   <target name="clean">
162         <jnode.clean/>
163   </target>
164
165 </project>
166
167