44# Makefile for Java JDBC interface
55#
66# IDENTIFICATION
7- # $Header: /cvsroot/pgsql/src/interfaces/jdbc/Attic/Makefile,v 1.14 1999/06/23 05:56:17 peter Exp $
7+ # $Header: /cvsroot/pgsql/src/interfaces/jdbc/Attic/Makefile,v 1.15 1999/09/14 05:50:27 peter Exp $
88#
99# -------------------------------------------------------------------------
1010
1111FIND = find
1212IDL2JAVA = idltojava -fno-cpp -fno-tie
1313JAR = jar
1414JAVA = java
15- JAVAC = javac
15+ JAVAC = javac -g
1616JAVADOC = javadoc
1717RM = rm -f
1818TOUCH = touch
@@ -22,12 +22,26 @@ TOUCH= touch
2222$(JAVAC ) $<
2323
2424.SUFFIXES :.class .java
25- .PHONY :all clean doc examples
25+ .PHONY :all clean doc examples msg
2626
2727# In 6.5, the all rule builds the makeVersion class which then calls make using
2828# the jdbc1 or jdbc2 rules
29- all :makeVersion.class
30- make$$($(JAVA ) makeVersion)
29+ all :
30+ @echo ------------------------------------------------------------
31+ @echo Due to problems with some JVMs that dontreturn a meaningful
32+ @echo version number, we have had to make the choice of what jdbc
33+ @echo version is built as a compiletime option.
34+ @echo
35+ @echo If you are using JDK1.1.x, you will need the JDBC1.2 driver.
36+ @echo To compile, type:
37+ @echo" make jdbc1"
38+ @echo
39+ @echo" If you are using JDK1.2 (aka Java2) you need the JDBC2."
40+ @echo To compile, type:
41+ @echo" make jdbc2"
42+ @echo ------------------------------------------------------------
43+
44+ msg :
3145@echo ------------------------------------------------------------
3246@echo The JDBC driver has now been built. To make it available to
3347@echo other applications, copy the postgresql.jar file to a public
@@ -107,34 +121,29 @@ OBJ_JDBC2=postgresql/jdbc2/ResultSet.class \
107121postgresql/jdbc2/ResultSetMetaData.class\
108122postgresql/jdbc2/Statement.class
109123
110- # This rule should never occur, but will be called when makeVersion fails to
111- # understand the java.version property correctly.
112- jdbc0 :
113- @echo
114- @echo FATAL ERROR!
115- @echo
116- @echo makeVersion has not been able to determine what version of
117- @echo the JDK you are using, and hence what version of the driver
118- @echo to compile.
119- @echo
120- @echo There are two versions available, one that conforms to the
121- @echo JDBC 1 specification, and one to the JDBC 2 specification.
122- @echo
123- @echo To build the driverfor JDBC 1 (usuallyfor JDK 1.1 thru 1.1.7)
124- @echothen type: make jdbc1
125- @echo
126- @echo To build the driverfor JDBC 2 (usuallyfor JDK 1.2 and later)
127- @echothen type: make jdbc2
128- @echo
129- @echo If you still have problems,then please email the interfaces
130- @echo or bugs lists, or better still to me direct (peter@retep.org.uk)
131- @echo
132-
133124# This rule builds the JDBC1 compliant driver
134- jdbc1 :$(OBJ_COMMON ) $(OBJ_JDBC1 ) postgresql.jar
125+ jdbc1 :
126+ (echo" package postgresql;" ; \
127+ echo " public class DriverClass {" ; \
128+ echo " public static String connectClass=\" postgresql.jdbc1.Connection\" ;" ; \
129+ echo " }" \
130+ )> postgresql/DriverClass.java
131+ @$(MAKE ) jdbc1real
132+
133+ jdbc2real : postgresql/DriverClass.class\
134+ $(OBJ_COMMON ) $(OBJ_JDBC2 ) postgresql.jar msg
135135
136136# This rule builds the JDBC2 compliant driver
137- jdbc2 :$(OBJ_COMMON ) $(OBJ_JDBC2 ) postgresql.jar
137+ jdbc2 :
138+ (echo" package postgresql;" ; \
139+ echo " public class DriverClass {" ; \
140+ echo " public static String connectClass=\" postgresql.jdbc2.Connection\" ;" ; \
141+ echo " }" \
142+ )> postgresql/DriverClass.java
143+ @$(MAKE ) jdbc2real
144+
145+ jdbc2real : postgresql/DriverClass.class\
146+ $(OBJ_COMMON ) $(OBJ_JDBC2 ) postgresql.jar msg
138147
139148# If you have problems with this rule, replace the $( ) with ` ` as some
140149# shells (mainly sh under Solaris) doesn't recognise $( )
@@ -143,7 +152,7 @@ jdbc2:$(OBJ_COMMON) $(OBJ_JDBC2) postgresql.jar
143152# directory. We use this later for compiling the dual-mode driver.
144153#
145154postgresql.jar :$(OBJ ) $(OBJ_COMMON )
146- $(JAR ) -c0f$@ $$( $( FIND ) postgresql -name "*.class" -print) \
155+ $(JAR ) -c0f$@ ` $( FIND) postgresql -name" *.class" -print` \
147156$(wildcard postgresql/* .properties)
148157
149158# This rule removes any temporary and compiled files from the source tree.