Index: greenstone3/trunk/build.xml
===================================================================
--- greenstone3/trunk/build.xml	(revision 15183)
+++ greenstone3/trunk/build.xml	(revision 15185)
@@ -307,6 +307,9 @@
     description="Configure the installation. Includes setting up config files. Should be re-run if you change the build.properties file."/>
 
-  <target name="clean" depends="init,clean-packages,clean-core,clean-gs2building"
+  <target name="clean" depends="init,clean-packages,clean-core,clean-gs2building,clean-gdbm"
     description="Remove all old compiled code. Includes core, packages and gs2building if necessary"/>
+  
+  <target name="distclean" depends="init,distclean-packages,clean-core,distclean-gs2building,distclean-gdbm"
+    description="Remove all compiled code and also any Makefiles etc generated during configure-c++. Includes core, packages, gs2building as necessary"/>
   
   <target name="compile" depends="init,compile-web,compile-packages,compile-core,compile-gs2building"
@@ -314,5 +317,5 @@
   
   <target name="update" depends="init,svnupdate,clean,configure,configure-c++,compile" 
-    description="Update (thru Subversion) all the source (including core, packages and gs2building), then clean, configure and recompile."/>
+    description="Update (thru Subversion) all the source (including core, packages and gs2building), then clean, configure and recompile. To do this without any SVN updates, run it like 'ant -Dnosvn.mode=yes update'"/>
 
   <target name="start" depends="init,start-tomcat"
@@ -368,15 +371,4 @@
   </target>
 
-  <!--  <target name="check-cvsroot">
-  <condition property="svnroot.notset">
-  <or>
-  <not>
-  <isset property="env.CVSROOT"/>
-			</not>
-  <equals arg1="" arg2="${env.CVSROOT}"/>
-      </or>
-    </condition>
-  <fail if="cvsroot.notset" message="You need to set the CVSROOT variable"/>
-  </target> -->
 
   <!-- this sets up some initial properties -->
@@ -817,5 +809,5 @@
   <!-- core targets refer to the core gsdl3 java src -->
   
-  <target name="prepare-core" unless="nocvs.mode">
+  <target name="prepare-core" unless="nosvn.mode">
     <!-- just get rid of empty directories-->
     <svn>
@@ -829,5 +821,5 @@
     description="Update only the Greenstone core" />
   
-  <target name="svnupdate-core" unless="nocvs.mode">
+  <target name="svnupdate-core" unless="nosvn.mode">
 
     <svn>
@@ -936,6 +928,5 @@
   <target name="prepare-packages" depends="init,prepare-indexers"/>
   
-  <target name="checkout-indexers" depends="init" if="independent-indexers" unless="nocvs.mode">
-    <!--  <target name="checkout-indexers" depends="check-svnroot,init" if="independent-indexers" unless="nocvs.mode"> -->
+  <target name="checkout-indexers" depends="init" if="independent-indexers" unless="nosvn.mode">
     <svn>
       <checkout url="${svn.root}/indexers/${branch.path}" dest="${src.packages.home}/indexers" revision="${branch.revision}"/>
@@ -950,5 +941,5 @@
     description="Update only the source packages"/>
 
-  <target name="svnupdate-packages" unless="nocvs.mode"> 
+  <target name="svnupdate-packages" unless="nosvn.mode"> 
     <svn>
       <update dir="${src.packages.home}"/>
@@ -1009,4 +1000,24 @@
 
   </target>
+  <target name="distclean-packages" depends="init,distclean-javagdbm,distclean-indexers" description="Distclean only the packages"/>
+
+  <target name="distclean-javagdbm" depends="init">
+    <exec executable="make" os="${os.unix}"
+      dir="${javagdbm.home}">
+      <arg value="distclean"/>
+    </exec>
+  </target>
+  
+  <target name="distclean-indexers" depends="init" if="independent-indexers">
+    <exec executable="make" os="${os.unix}"
+      dir="${indexers.home}">
+      <arg value="distclean"/>
+    </exec>
+    <exec executable="${indexers.home}/winMake.bat" os="${os.windows}"
+      dir="${indexers.home}">
+      <arg value="clean"/>
+    </exec>
+
+  </target>
   
   <target name="compile-packages" description="Compile only the source packages">
@@ -1091,8 +1102,8 @@
     description="Update only the Greenstone 2 building components"/>
 
-  <target name="svnupdate-gs2building" if="collection.building.enabled" depends="init,svnupdate-gs2build,svnupdate-gli" unless="nocvs.mode">
-  </target>
-
-  <target name="svnupdate-gs2build" if="collection.building.enabled" depends="init" unless="nocvs.mode">
+  <target name="svnupdate-gs2building" if="collection.building.enabled" depends="init,svnupdate-gs2build,svnupdate-gli" unless="nosvn.mode">
+  </target>
+
+  <target name="svnupdate-gs2build" if="collection.building.enabled" depends="init" unless="nosvn.mode">
     <!-- please keep this function in sync with checkout-gs2build -->
 
@@ -1168,5 +1179,5 @@
   </target>
   
-  <target name="svnupdate-gli" if="collection.building.enabled" depends="init" unless="nocvs.mode">
+  <target name="svnupdate-gli" if="collection.building.enabled" depends="init" unless="nosvn.mode">
     <svn>
       <update dir="${gli.home}" revision="${branch.revision}"/>
@@ -1176,5 +1187,5 @@
   <target name="prepare-gs2building" depends="init,prepare-gs2build,prepare-gli" if="collection.building.enabled">
   </target>
-  <target name="checkout-gs2build" depends="init" if="collection.building.enabled" unless="nocvs.mode">
+  <target name="checkout-gs2build" depends="init" if="collection.building.enabled" unless="nosvn.mode">
     <!-- please keep this function in sync with update-gs2build -->
     <echo>checking out gs2build</echo>
@@ -1264,5 +1275,5 @@
 
   <target name="checkout-winbin" depends="init" if="current.os.iswindows" 
-    unless="nocvs.mode">
+    unless="nosvn.mode">
     <svn>
       <checkout url="${svn.root}/other-projects/trunk/winbin" destPath="${basedir}/winbin" revision="${branch.revision}"/>
@@ -1270,5 +1281,5 @@
   </target>
 
-  <target name="update-winbin" depends="init" if="current.os.iswindows" unless="nocvs.mode">
+  <target name="update-winbin" depends="init" if="current.os.iswindows" unless="nosvn.mode">
     <svn>
       <update dir="winbin"/>
@@ -1359,6 +1370,5 @@
   </target>
   
-  <!--  <target name="checkout-gli" depends="check-cvsroot,init" if="collection.building.enabled" unless="nocvs.mode"> -->
-  <target name="checkout-gli" depends="init" if="collection.building.enabled" unless="nocvs.mode">
+  <target name="checkout-gli" depends="init" if="collection.building.enabled" unless="nosvn.mode">
     <echo>checking out gli</echo>
     <svn>
@@ -1411,11 +1421,12 @@
   </target>
   
+  <target name="distclean-gs2building" depends="init,clean-gli,clean-gs2build,distclean-gs2build" 
+    description="Distclean only the Greenstone 2 building components" 
+    if="collection.building.enabled"/>
+
   <target name="distclean-gs2build" depends="init" if="collection.building.enabled">
-    <!-- gs2build -->
-    <!--linux:  -->
     <exec executable="make" os="${os.unix}" dir="${gs2build.home}">
       <arg value="distclean"/>
     </exec>
-    <!-- windows: -->    
   </target>
   
@@ -1523,11 +1534,13 @@
     </echo>
   </target>
+
+  <!-- ======================== FLAX Targets ========================= -->
   <target name="prepare-flax" description="check out flax source code from another repository" if="install.flax">
     <echo>checking out flax ...</echo>
     <mkdir dir="${basedir}/src/java/org/flax"/>
     <mkdir dir="${basedir}/src/java/org/greenstone/gsdl3/flax"/>
-    <mkdir dir="${basedir}/web/WEB-INF/classes/flax"/>
-    <mkdir dir="${basedir}/web/interfaces/flax"/>
-    <mkdir dir="${basedir}/web/sites/flax"/>
+    <mkdir dir="${web.home}/WEB-INF/classes/flax"/>
+    <mkdir dir="${web.home}/interfaces/flax"/>
+    <mkdir dir="${web.home}/sites/flax"/>
     <mkdir dir="${basedir}/flax-resources"/>
     <mkdir dir="${basedir}/flax-lib"/>
@@ -1538,9 +1551,9 @@
 	destPath="${basedir}/src/java/org/greenstone/gsdl3/flax"/>
       <checkout url="${flax.svn.root}/flax1.0/trunk/web/WEB-INF/classes/flax/" 
-	destPath="${basedir}/web/WEB-INF/classes/flax"/>
+	destPath="${web.home}/WEB-INF/classes/flax"/>
       <checkout url="${flax.svn.root}/flax1.0/trunk/web/interfaces/flax/" 
-	destPath="${basedir}/web/interfaces/flax"/>
+	destPath="${web.home}/interfaces/flax"/>
       <checkout url="${flax.svn.root}/flax1.0/trunk/web/sites/flax/" 
-	destPath="${basedir}/web/sites/flax"/>
+	destPath="${web.home}/sites/flax"/>
       <checkout url="${flax.svn.root}/flax1.0/trunk/flax-resources"
 	destPath="${basedir}/flax-resources"/>
@@ -1549,5 +1562,5 @@
     </svn>
     <echo>prepare flax files...</echo>
-    <move file="${basedir}/web/WEB-INF/web.xml" tofile="${basedir}/web/WEB-INF/web.xml.greenstone3backup"/>
+    <move file="${web.home}/WEB-INF/web.xml" tofile="${web.home}/WEB-INF/web.xml.greenstone3backup"/>
     <antcall target="flax-copy-files" />
     <antcall target="unzip-flax-collections" />
@@ -1560,7 +1573,7 @@
       <update dir="${basedir}/src/java/org/flax"/>
       <update dir="${basedir}/src/java/org/greenstone/gsdl3/flax"/>
-      <update dir="${basedir}/web/WEB-INF/classes/flax"/>
-      <update dir="${basedir}/web/interfaces/flax"/>
-      <update dir="${basedir}/web/sites/flax"/>
+      <update dir="${web.home}/WEB-INF/classes/flax"/>
+      <update dir="${web.home}/interfaces/flax"/>
+      <update dir="${web.home}/sites/flax"/>
     </svn>
     <antcall target="flax-copy-files" />
@@ -1569,5 +1582,5 @@
 
   <target name="unzip-flax-collections" >
-    <property name="coll.dir" value="${basedir}/web/sites/flax/collect"/>
+    <property name="coll.dir" value="${web.home}/sites/flax/collect"/>
     <unzip dest="${coll.dir}">  
       <fileset dir="${coll.dir}">
@@ -1581,5 +1594,5 @@
 
   <target name="unzip-flax-resources" >
-    <property name="classes.dir" value="${basedir}/web//WEB-INF/classes/flax"/>
+    <property name="classes.dir" value="${web.home}/WEB-INF/classes/flax"/>
     <unzip dest="${classes.dir}">  
       <fileset dir="${classes.dir}">
@@ -1594,13 +1607,14 @@
   <target name="flax-copy-files" description="copy some flax files into the appropriate greenstone3 directories">
     <echo>copying flax files ...</echo>
-    <copy file="${basedir}/web/WEB-INF/classes/flax/web.xml" todir="${basedir}/web/WEB-INF" overwrite="true" />
+    <copy file="${web.home}/WEB-INF/classes/flax/web.xml" todir="${web.home}/WEB-INF" overwrite="true" />
     <!-- A configuration file containing web service binding information for the axis engine -->
-    <copy file="${basedir}/web/WEB-INF/classes/flax/server-config.wsdd" todir="${basedir}/web/WEB-INF" overwrite="true" />
+    <copy file="${web.home}/WEB-INF/classes/flax/server-config.wsdd" todir="${web.home}/WEB-INF" overwrite="true" />
     <copy file="${basedir}/flax-resources/flax-build.xml" todir="${basedir}" overwrite="true" />
-    <copy file="${basedir}/flax-lib/opennlp-tools-1.3.0.jar" todir="${basedir}/web/WEB-INF/lib" overwrite="true" />    
-  </target>
-  <!--install gdbm stuff -->
-
-  <!-- downloads the gdbm library -->
+    <copy file="${basedir}/flax-lib/opennlp-tools-1.3.0.jar" todir="${web.home}/WEB-INF/lib" overwrite="true" />    
+  </target>
+
+
+  <!-- ======================== GDBM Targets ========================= -->
+
   <target name="prepare-gdbm" depends="init" if="install.gdbm">
     <get src="http://www.greenstone.org/gs3files/gdbm-1.8.3.tar.gz"
@@ -1629,4 +1643,11 @@
   </target> 
 
+  <target name="distclean-gdbm" depends="init"  if="install.gdbm">   
+    <echo>distclean GDBM</echo>
+    <exec executable="make" os="${os.unix},${os.mac}" dir="${gdbm.home}" >
+      <arg value="distclean"/>
+    </exec>
+  </target> 
+
   <target name="compile-gdbm" depends="init"  if="install.gdbm">   
     <echo>compile GDBM</echo>
@@ -1637,6 +1658,4 @@
   </target> 
 
-
-
 </project>
 
