Index: src/Makefile.global.in
===================================================================
RCS file: /projects/cvsroot/pgsql-server/src/Makefile.global.in,v
retrieving revision 1.161
diff -p -u -r1.161 Makefile.global.in
--- src/Makefile.global.in	2003/04/04 20:42:11	1.161
+++ src/Makefile.global.in	2003/04/19 21:11:53
@@ -177,6 +177,9 @@ ifeq ($(GCC), yes)
   CFLAGS += -Wall -Wmissing-prototypes -Wmissing-declarations
 endif
 
+ANT_JAVAC =
+
+
 # Kind-of compilers
 
 YACC = @YACC@
Index: src/interfaces/jdbc/Makefile
===================================================================
RCS file: /projects/cvsroot/pgsql-server/src/interfaces/jdbc/Makefile,v
retrieving revision 1.38
diff -p -u -r1.38 Makefile
--- src/interfaces/jdbc/Makefile	2003/02/12 06:13:04	1.38
+++ src/interfaces/jdbc/Makefile	2003/04/19 21:11:53
@@ -8,6 +8,10 @@
 #
 #-------------------------------------------------------------------------
 
+# Specify the ant target so it can be overridden.
+TARGET	= all
+
+
 subdir = src/interfaces/jdbc
 top_builddir = ../../..
 include $(top_builddir)/src/Makefile.global
@@ -15,8 +19,14 @@ include $(top_builddir)/src/Makefile.glo
 majorversion:= $(shell echo $(VERSION) | sed 's/^\([0-9][0-9]*\)\..*$$/\1/')
 minorversion:= $(shell echo $(VERSION) | sed 's/^[0-9][0-9]*\.\([0-9][0-9]*\).*$$/\1/')
 
+
 build.properties: $(top_builddir)/src/Makefile.global
+ifeq "$(ANT_JAVAC)" ""
 	@echo "# This file was created by 'make build.properties'." > build.properties
+else
+	@echo "# This file was created by 'make build.properties'." > build.properties
+	@echo build.compiler=$(ANT_JAVAC) >> build.properties
+endif
 	@echo major=$(majorversion) >> build.properties
 	@echo minor=$(minorversion) >> build.properties
 	@echo fullversion=$(VERSION) >> build.properties
@@ -24,7 +34,18 @@ build.properties: $(top_builddir)/src/Ma
 	@echo enable_debug=$(enable_debug) >> build.properties
 
 all: build.properties
-	$(ANT) -buildfile $(srcdir)/build.xml all
+	$(ANT) -emacs -buildfile $(srcdir)/build.xml
+
+
+jdbc_v1: build.properties
+	$(ANT) -emacs -buildfile $(srcdir)/build.xml jdbc_v1
+
+jdbc_v2: build.properties
+	$(ANT) -emacs -buildfile $(srcdir)/build.xml jdbc_v2
+
+jdbc_v3: build.properties
+	$(ANT) -emacs -buildfile $(srcdir)/build.xml jdbc_v3
+
 
 install: installdirs build.properties
 	$(ANT) -buildfile $(srcdir)/build.xml install \
Index: src/interfaces/jdbc/build.xml
===================================================================
RCS file: /projects/cvsroot/pgsql-server/src/interfaces/jdbc/build.xml,v
retrieving revision 1.32
diff -p -u -r1.32 build.xml
--- src/interfaces/jdbc/build.xml	2003/02/27 05:45:43	1.32
+++ src/interfaces/jdbc/build.xml	2003/04/19 21:11:53
@@ -15,7 +15,7 @@
 ]>
 
 <project name="postgresqlJDBC" default="all" basedir=".">
-
+    
   <!-- set global properties for this build -->
   <property name="srcdir"  value="." />
   <property name="jardir"  value="jars" />
@@ -73,21 +73,32 @@
 
 
   <!-- default target -->
-  <target name="all">
-    <antcall target="jar" />
+  <target name="all" depends="check_versions">
+    <antcall target="jdbc1_dependant" />
+    <antcall target="jdbc2_dependant" />
+    <antcall target="jdbc3_dependant" />
   </target>
 
+  <target name="jdbc1_dependant" depends="jdbc_v1, examples" if="jdbc1">
+  </target>    
+
+  <target name="jdbc2_dependant" depends="jdbc_v2, examples" if="jdbc2">
+  </target>    
+
+  <target name="jdbc3_dependant" depends="jdbc_v3, examples" if="jdbc3">
+  </target>    
+
 
   <!-- create the jar file -->
-  <target name="jar" depends="compile,examples">
+  <target name="jar">
     <jar jarfile="${jardir}/postgresql.jar" whenempty="fail">
       <fileset dir="${builddir}">
-        <include name="${package}/**/*.class" />
-        <exclude name="${package}/test/**" />
+        <include name="org/postgresql/**/*.class" />
+        <exclude name="org/postgresql/test/**" />
       </fileset>
 
       <fileset dir="${srcdir}">
-        <include name="${package}/*.properties" />
+        <include name="org/postgresql/*.properties" />
       </fileset>
     </jar>
 
@@ -103,22 +114,70 @@
   </target>
 
 
-  <!-- This is the core of the driver.  It is common for all three versions. -->
-  <target name="compile" depends="prepare,check_versions,driver">
-    <javac srcdir="${srcdir}" destdir="${builddir}" debug="${debug}">
-      <include name="${package}/**" />
+  <!-- Compile tasks -->
 
-      <exclude name="${package}/jdbc1/**" unless="jdbc1"/>
-      <exclude name="${package}/jdbc2/**" unless="jdbc2"/>
-      <exclude name="${package}/jdbc3/**" unless="jdbc3"/>
+  <target name="jdbc_v1" depends="jdbc_v1_compile">
+    <antcall target="jar"/>
+  </target>
 
-      <exclude name="${package}/jdbc2/optional/**" unless="jdbc2" />
-      <exclude name="${package}/jdbc2/optional/**" unless="datasource" />
+  <target name="jdbc_v2" depends="jdbc_v2_compile">
+    <antcall target="jar"/>
+  </target>
 
-      <exclude name="${package}/test/**"/>
+  <target name="jdbc_v3" depends="jdbc_v3_compile">
+    <antcall target="jar"/>
+  </target>
+
+  <target name="jdbc_v1_compile" depends="prepare">
+    <antcall target="driver">
+      <param name="connectclass" value="org.postgresql.jdbc1.Jdbc1Connection"/>
+      <param name="edition" value="jdbc version 1"/>
+    </antcall>
+    <javac srcdir="${srcdir}" destdir="${builddir}" debug="${debug}">
+      <include name="org/postgresql/*" />
+      <include name="org/postgresql/core/*" />
+      <include name="org/postgresql/jdbc1/*"/>
+      <include name="org/postgresql/fastpath/*" />
+      <include name="org/postgresql/largeobject/*" />
+      <include name="org/postgresql/util/*" />
     </javac>
   </target>
 
+  <target name="jdbc_v2_compile" depends="prepare">
+    <antcall target="driver">
+      <param name="connectclass" value="org.postgresql.jdbc2.Jdbc2Connection"/>
+      <param name="edition" value="jdbc version 2"/>
+    </antcall>
+    <javac srcdir="${srcdir}" destdir="${builddir}" debug="${debug}">
+      <include name="org/postgresql/*" />
+      <include name="org/postgresql/core/*" />
+      <include name="org/postgresql/jdbc1/Abstract*"/>
+      <include name="org/postgresql/jdbc2/*"/>
+      <exclude name="org/postgresql/jdbc2/optional/**" />
+      <include name="org/postgresql/fastpath/*" />
+      <include name="org/postgresql/largeobject/*" />
+      <include name="org/postgresql/util/*" />
+    </javac>    
+  </target>
+  
+  <target name="jdbc_v3_compile" depends="prepare">
+    <antcall target="driver">
+      <param name="connectclass" value="org.postgresql.jdbc3.Jdbc3Connection"/>
+      <param name="edition" value="jdbc version 3"/>
+    </antcall>
+    <javac srcdir="${srcdir}" destdir="${builddir}" debug="${debug}">
+      <include name="org/postgresql/*" />
+      <include name="org/postgresql/core/*" />
+      <include name="org/postgresql/jdbc1/Abstract*"/>
+      <include name="org/postgresql/jdbc2/Abstract*"/>
+      <include name="org/postgresql/jdbc3/*"/>
+      <include name="org/postgresql/fastpath/*" />
+      <include name="org/postgresql/largeobject/*" />
+      <include name="org/postgresql/util/*" />
+      <exclude name="org/postgresql/jdbc2/optional/**" if="datasource" />
+    </javac>    
+  </target>
+
   <target name="check_driver">
     <uptodate targetfile="${package}/Driver.java" property="driver.uptodate">
       <srcfiles dir=".">
@@ -132,35 +191,7 @@
     This generates Driver.java from Driver.java.in
     It's required for importing the driver version properties
   -->
-  <target name="driver" depends="prepare,check_versions,check_driver"
-          unless="driver.uptodate">
-    <!-- determine the edition text -->
-    <condition property="edition" value="JDBC1">
-        <equals arg1="${jdbc1}" arg2="true"/>
-    </condition>
-    <condition property="edition" value="JDBC2">
-        <equals arg1="${jdbc2}" arg2="true"/>
-    </condition>
-    <condition property="edition" value="JDBC3">
-        <equals arg1="${jdbc3}" arg2="true"/>
-    </condition>
-    <condition property="edition" value="JDBC2 Enterprise">
-      <and>
-        <available classname="javax.sql.DataSource" />
-        <equals arg1="${jdbc2}" arg2="true"/>
-      </and>
-    </condition>
-
-    <!-- determine the connection class -->
-    <condition property="connectclass" value="org.postgresql.jdbc1.Jdbc1Connection">
-        <equals arg1="${jdbc1}" arg2="true"/>
-    </condition>
-    <condition property="connectclass" value="org.postgresql.jdbc2.Jdbc2Connection">
-        <equals arg1="${jdbc2}" arg2="true"/>
-    </condition>
-    <condition property="connectclass" value="org.postgresql.jdbc3.Jdbc3Connection">
-        <equals arg1="${jdbc3}" arg2="true"/>
-    </condition>
+  <target name="driver" depends="check_driver" unless="driver.uptodate">
 
     <!-- determine the ssl status -->
     <condition property="ssl_config" value="">
@@ -216,7 +247,7 @@
 
 
   <!-- This builds the examples -->
-  <target name="examples" depends="compile">
+  <target name="examples">
     <javac srcdir="${srcdir}" destdir="${builddir}" debug="${debug}">
       <include name="example/**" />
       <exclude name="example/corba/**"/>
@@ -330,6 +361,5 @@
       </classpath>
     </java>
   </target>
-
 
 </project>
