Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 58eeb82

Browse files
author
Dave Cramer
committed
Mike Beachy's build patch to allow ant builds without make
1 parent a905eaa commit 58eeb82

File tree

3 files changed

+40
-17
lines changed

3 files changed

+40
-17
lines changed

src/interfaces/jdbc/Makefile

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,31 @@
44
#
55
# Copyright (c) 2001, PostgreSQL Global Development Group
66
#
7-
# $Header: /cvsroot/pgsql/src/interfaces/jdbc/Attic/Makefile,v 1.36 2002/10/20 02:55:50 barry Exp $
7+
# $Header: /cvsroot/pgsql/src/interfaces/jdbc/Attic/Makefile,v 1.37 2002/12/11 12:27:47 davec Exp $
88
#
99
#-------------------------------------------------------------------------
1010

1111
subdir = src/interfaces/jdbc
1212
top_builddir = ../../..
1313
include $(top_builddir)/src/Makefile.global
1414

15-
majorversion := $(shell echo $(VERSION) | sed 's/^\([0-9][0-9]*\)\..*$$/\1/')
16-
minorversion := $(shell echo $(VERSION) | sed 's/^[0-9][0-9]*\.\([0-9][0-9]*\).*$$/\1/')
15+
majorversion:= $(shell echo $(VERSION) | sed 's/^\([0-9][0-9]*\)\..*$$/\1/')
16+
minorversion:= $(shell echo $(VERSION) | sed 's/^[0-9][0-9]*\.\([0-9][0-9]*\).*$$/\1/')
1717

18-
properties := -Dmajor=$(majorversion) -Dminor=$(minorversion) \
19-
-Dfullversion=$(VERSION) \
20-
-Ddef_pgport=$(DEF_PGPORT) \
21-
-Denable_debug=$(enable_debug)
18+
build.properties: $(top_builddir)/src/Makefile.global
19+
echo "# This file was created by 'make build.properties'." > build.properties
20+
echo major=$(majorversion) >> build.properties
21+
echo minor=$(minorversion) >> build.properties
22+
echo fullversion=$(VERSION) >> build.properties
23+
echo def_pgport=$(DEF_PGPORT) >> build.properties
24+
echo enable_debug=$(enable_debug) >> build.properties
2225

23-
all:
24-
$(ANT) -buildfile $(srcdir)/build.xml all \
25-
$(properties)
26+
all: build.properties
27+
$(ANT) -buildfile $(srcdir)/build.xml all
2628

27-
install: installdirs
29+
install: installdirs build.properties
2830
$(ANT) -buildfile $(srcdir)/build.xml install \
29-
-Dinstall.directory=$(javadir) $(properties)
31+
-Dinstall.directory=$(javadir)
3032

3133
installdirs:
3234
$(mkinstalldirs) $(javadir)
@@ -36,7 +38,7 @@ uninstall:
3638
-Dinstall.directory=$(javadir)
3739

3840
clean distclean maintainer-clean:
39-
$(ANT) -buildfile $(srcdir)/build.xml clean
41+
$(ANT) -buildfile $(srcdir)/build.xml clean_all
4042

41-
check: all
42-
$(ANT) -buildfile $(srcdir)/build.xml test $(properties)
43+
check: build.properties
44+
$(ANT) -buildfile $(srcdir)/build.xml test

src/interfaces/jdbc/README

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ the directory PREFIX/share/java.
3232

3333
That jar file will contain the driver for _your_ version of the JDK.
3434

35+
If you would like to use ANT directly, first invoke 'make build.properties'
36+
after running the configure script with the java option. This will create a
37+
needed Java properties file from the configured information.
38+
3539
REMEMBER: Once you have compiled the driver, it will work on ALL platforms
3640
that support that version of the API. You don't need to build it for each
3741
platform.

src/interfaces/jdbc/build.xml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
77
This file now requires Ant 1.4.1. 2002-04-18
88
9-
$Header: /cvsroot/pgsql/src/interfaces/jdbc/Attic/build.xml,v 1.30 2002/10/20 00:10:55 barry Exp $
9+
$Header: /cvsroot/pgsql/src/interfaces/jdbc/Attic/build.xml,v 1.31 2002/12/11 12:27:47 davec Exp $
1010
1111
-->
1212

@@ -23,6 +23,8 @@
2323
<property name="package" value="org/postgresql" />
2424
<property name="debug" value="on" />
2525

26+
<property file="build.properties"/>
27+
2628
<!--
2729
This is a simpler method than utils.CheckVersion
2830
It defaults to jdbc1, but builds jdbc2 if the java.lang.Byte class is
@@ -115,12 +117,21 @@
115117
</javac>
116118
</target>
117119

120+
<target name="check_driver">
121+
<uptodate targetfile="${package}/Driver.java" property="driver.uptodate">
122+
<srcfiles dir=".">
123+
<include name="${package}/Driver.java.in"/>
124+
<include name="build.properties"/>
125+
</srcfiles>
126+
</uptodate>
127+
</target>
118128

119129
<!--
120130
This generates Driver.java from Driver.java.in
121131
It's required for importing the driver version properties
122132
-->
123-
<target name="driver" depends="prepare,check_versions">
133+
<target name="driver" depends="prepare,check_versions,check_driver"
134+
unless="driver.uptodate">
124135
<!-- determine the edition text -->
125136
<condition property="edition" value="JDBC1">
126137
<equals arg1="${jdbc1}" arg2="true"/>
@@ -158,6 +169,9 @@
158169

159170
<fail unless="major" message="'major' undefined. Please follow the directions in README."/>
160171
<fail unless="minor" message="'minor' undefined. Please follow the directions in README."/>
172+
<fail unless="fullversion" message="'fullversion' undefined. Please follow the directions in README."/>
173+
<fail unless="def_pgport" message="'def_pgport' undefined. Please follow the directions in README."/>
174+
<fail unless="enable_debug" message="'enable_debug' undefined. Please follow the directions in README."/>
161175

162176
<!-- Put a check for the current version here -->
163177

@@ -231,6 +245,9 @@
231245
<delete quiet="true" file="${package}/Driver.java" />
232246
</target>
233247

248+
<target name="clean_all" depends="clean">
249+
<delete quiet="true" file="build.properties" />
250+
</target>
234251

235252

236253
<!-- This compiles and executes the JUnit tests -->

0 commit comments

Comments
 (0)