Peter Eisentraut avatar Peter Eisentraut committed 44f64dd

Makefile cleanup for interface tree. Now essentially with all the
standard targets and behaviour. Replaced Makefile.in's with
Makefile's and declared the respective variables in Makefile.global.

maintainer-clean target now available at top level, although it does
not work in the backend tree yet.

Cleanup pass over Makefile.shlib, renamed some targets and variables.
The shared library symlink tests are now done by make, not the shell.

ecpg: Remove one warning in sloppy flex output.

PL/Perl and Perl interface: the MakeMaker documentation is confusing,
the realclean target *does* "delete derived files", but it also
uninstalls them. Don't use that.

The submake targets in the various bin directories that update libpq
should `make all', not `make libpq.a'. That is a) unportable, and
b) doesn't build the shared library.

Comments (0)

Files changed (35)

 #
 # PostgreSQL top level makefile
 #
-# $Header: /cvsroot/pgsql/GNUmakefile.in,v 1.5 2000/06/14 18:17:24 petere Exp $
+# $Header: /cvsroot/pgsql/GNUmakefile.in,v 1.6 2000/06/28 18:29:11 petere Exp $
 #
 
-srcdir = @srcdir@
-VPATH = @srcdir@
-
-top_srcdir = @top_srcdir@
+subdir =
 top_builddir = .
-
+include src/Makefile.global
 
 all:
 	$(MAKE) -C src all
 	$(MAKE) -C src install
 	@cat $(srcdir)/register.txt
 
+installdirs uninstall:
+	$(MAKE) -C src $@
+
 clean:
 	$(MAKE) -C src clean
 
-distclean:
-	-$(MAKE) -C src distclean
+distclean maintainer-clean:
+	-$(MAKE) -C src $@
 	-rm -f config.cache config.log config.status GNUmakefile
 
 
-.PHONY: all install clean distclean
-
-
 GNUmakefile: GNUmakefile.in $(top_builddir)/config.status
 	CONFIG_FILES=$@ CONFIG_HEADERS= ./config.status
 
 
 
 
-for ac_prog in mawk gawk nawk awk
+for ac_prog in gawk mawk nawk awk
 do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 	src/bin/pgtclsh/mkMakefile.tcldefs.sh
 	src/bin/pgtclsh/mkMakefile.tkdefs.sh
 	src/include/version.h
-	src/interfaces/Makefile
-	src/interfaces/libpq/Makefile
-	src/interfaces/ecpg/lib/Makefile
-	src/interfaces/ecpg/preproc/Makefile
-	src/interfaces/perl5/GNUmakefile
-	src/interfaces/libpq++/Makefile
-	src/interfaces/libpgeasy/Makefile
-	src/interfaces/libpgtcl/Makefile
-	src/interfaces/odbc/GNUmakefile
-	src/interfaces/python/GNUmakefile
 	src/pl/tcl/mkMakefile.tcldefs.sh
 	src/test/regress/GNUmakefile
  src/include/config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
 	src/bin/pgtclsh/mkMakefile.tcldefs.sh
 	src/bin/pgtclsh/mkMakefile.tkdefs.sh
 	src/include/version.h
-	src/interfaces/Makefile
-	src/interfaces/libpq/Makefile
-	src/interfaces/ecpg/lib/Makefile
-	src/interfaces/ecpg/preproc/Makefile
-	src/interfaces/perl5/GNUmakefile
-	src/interfaces/libpq++/Makefile
-	src/interfaces/libpgeasy/Makefile
-	src/interfaces/libpgtcl/Makefile
-	src/interfaces/odbc/GNUmakefile
-	src/interfaces/python/GNUmakefile
 	src/pl/tcl/mkMakefile.tcldefs.sh
 	src/test/regress/GNUmakefile
 "}
 	src/bin/pgtclsh/mkMakefile.tcldefs.sh
 	src/bin/pgtclsh/mkMakefile.tkdefs.sh
 	src/include/version.h
-	src/interfaces/Makefile
-	src/interfaces/libpq/Makefile
-	src/interfaces/ecpg/lib/Makefile
-	src/interfaces/ecpg/preproc/Makefile
-	src/interfaces/perl5/GNUmakefile
-	src/interfaces/libpq++/Makefile
-	src/interfaces/libpgeasy/Makefile
-	src/interfaces/libpgtcl/Makefile
-	src/interfaces/odbc/GNUmakefile
-	src/interfaces/python/GNUmakefile
 	src/pl/tcl/mkMakefile.tcldefs.sh
 	src/test/regress/GNUmakefile
 )

src/GNUmakefile.in

 #
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/Attic/GNUmakefile.in,v 1.53 2000/06/27 00:30:48 petere Exp $
+#    $Header: /cvsroot/pgsql/src/Attic/GNUmakefile.in,v 1.54 2000/06/28 18:29:13 petere Exp $
 #
 #-------------------------------------------------------------------------
 
 	rm -f backend/port/Makefile backend/catalog/genbki.sh \
 		backend/utils/Gen_fmgrtab.sh \
 		backend/port/tas.s backend/port/dynloader.c
-	-$(MAKE) -C interfaces distclean
+	-$(MAKE) -C interfaces $@
 	-$(MAKE) -C bin $@
 	-$(MAKE) -C pl $@
 	-$(MAKE) -C test clean

src/Makefile.global.in

 #
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/Makefile.global.in,v 1.81 2000/06/27 00:30:48 petere Exp $
+#    $Header: /cvsroot/pgsql/src/Makefile.global.in,v 1.82 2000/06/28 18:29:13 petere Exp $
 #
 # NOTES
 #    Essentially all Postgres make files include this file and use the
 libdir = @libdir@
 includedir = @includedir@
 
+odbcinst_ini_dir = @odbcinst_ini_dir@
+
 # old variable names for installation directories
 
 POSTGRESDIR= $(prefix)
 #PROFILE= -p -non_shared
 
 
+with_CXX = @with_CXX@
 with_perl = @with_perl@
+enable_odbc = @enable_odbc@
+
+with_python = @with_python@
+PYTHON = @PYTHON@
+python_extmakefile = @python_extmakefile@
+python_moduledir = @python_moduledir@
 
 #
 # Please do not edit USE_TCL and USE_TK by hand.
 TAR= @tar@
 GZCAT= @GZCAT@
 PERL = @PERL@
+CXX=@CXX@
+CXXFLAGS=@CXXFLAGS@ @INCLUDES@
 
 
 ##############################################################################
 
 
 # substitute implementations of the C library
+INET_ATON = @INET_ATON@
 STRERROR = @STRERROR@
 STRERROR2 = @STRERROR2@
 SNPRINTF = @SNPRINTF@
 STRDUP = @STRDUP@
 
-.DEFAULT: all
 .PHONY: all install installdirs uninstall dep depend clean distclean maintainer-clean

src/Makefile.shlib

 # Copyright (c) 1998, Regents of the University of California
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/Makefile.shlib,v 1.20 2000/05/16 20:48:48 momjian Exp $
+#    $Header: /cvsroot/pgsql/src/Makefile.shlib,v 1.21 2000/06/28 18:29:13 petere Exp $
 #
 #-------------------------------------------------------------------------
 
-# This file should be included by any Postgres module Makefile that wants
-# to build a shared library (if possible for the current platform).
-# A static library is also built from the same object files.
-# RESTRICTION: only one library can be built per makefile...
-
-# Before including this file, the module Makefile must define these variables:
-# NAME				Name of library to build (no suffix nor "lib" prefix)
-# SO_MAJOR_VERSION	Major version number to use for shared library
-# SO_MINOR_VERSION	Minor version number to use for shared library
-# OBJS				List of object files to include in library
-# SHLIB_LINK		If shared library relies on other libraries, additional
-#					stuff to put in its link command
-# (If you want a patchlevel, include it in SO_MINOR_VERSION, eg, "6.2".)
+# This file should be included by any Postgres module Makefile that
+# wants to build a shared library (if possible for the current
+# platform). A static library is also built from the same object
+# files. Only one library can be built per makefile.
 #
-# The module Makefile must also include $(SRCDIR)/Makefile.global before
-# including this file (Makefile.global sets PORTNAME and other needed symbols).
+# Before including this file, the module Makefile must define these
+# variables:
 #
-# The first rule in this file is a rule for "all", which causes both the
-# static and shared libraries to be built (as well as all the object files).
-# If you have other files that need to be made before building object files
-# and libraries, put another rule for "all" before you include this file.
+# NAME                  Name of library to build (no suffix nor "lib" prefix)
+# SO_MAJOR_VERSION      Major version number to use for shared library
+# SO_MINOR_VERSION      Minor version number to use for shared library
+# OBJS                  List of object files to include in library
+# SHLIB_LINK            If shared library relies on other libraries,
+#                       additional stuff to put in its link command
+# (If you want a patchlevel, include it in SO_MINOR_VERSION, e.g., "6.2".)
 #
-# Your install rule should look like
+# The module Makefile must also include
+# $(top_builddir)/src/Makefile.global before including this file.
+# (Makefile.global sets PORTNAME and other needed symbols.)
 #
-#	install: install-headers install-lib $(install-shlib-dep)
+# This makefile provides the following (phony) targets:
 #
-# where install-headers is only needed if you have header files to install
-# (and, of course, it has to be provided by your makefile).  The rules
-# install-lib and install-shlib are provided by this makefile --- they
-# automatically install the plain and shared libraries into $(LIBDIR).
-# install-shlib-dep is a variable that expands to install-shlib if the
-# shared library needs to be installed, empty if not.
+# all-lib               build the static and shared (if applicable) libraries
+# install-lib           install the libraries into $(libdir)
+# uninstall-lib         remove the libraries from $(libdir)
+# clean-lib             delete the static and shared libraries from the build dir
 #
-# Got that?  Look at src/interfaces/libpq/Makefile.in for an example.
+# Since `all-lib' is the first rule in this file you probably want to
+# have the `all' target before including this file. In the most simple
+# case it would look like this:
+#
+#     all: all-lib
+#
+# Similarly, the install rule might look like
+#
+#     install: install-lib
+#
+# plus any additional things you want to install. Et cetera.
+#
+# Got that?  Look at src/interfaces/libpq/Makefile for an example.
 
 
-# shlib and install-shlib-dep default to empty, and stay that way if we're
-# on a platform where we don't know how to build a shared library.
+# shlib is empty by default. If we know how to build a shared library
+# it will contain the name of the file, otherwise it will remain
+# empty. Thus `ifdef shlib' could be used in the containing make file
+# to test whether shared libraries are available.
 shlib := 
-install-shlib-dep :=
 
-# For each platform we support shlibs on, set shlib and install-shlib-dep,
-# and update flags as needed to build a shared lib.  Note we depend on
-# Makefile.global (or really Makefile.port) to supply DLSUFFIX and other
-# symbols.
+# For each platform we support shared libraries on, set shlib and
+# update flags as needed to build a shared lib. Note we depend on
+# Makefile.global (or really Makefile.port) to supply DLSUFFIX and
+# other symbols.
 
 # Try to keep the sections in some kind of order, folks...
 
 ifeq ($(PORTNAME), aix)
-  install-shlib-dep	:= install-shlib
-  shlib				:= lib$(NAME)$(DLSUFFIX)
+  shlib			:= lib$(NAME)$(DLSUFFIX)
   SHLIB_LINK		+= -lc
 endif
 
 ifeq ($(PORTNAME), bsd)
   ifdef BSD_SHLIB
-    install-shlib-dep	:= install-shlib
     shlib		:= lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
     ifdef ELF_SYSTEM
       LDFLAGS_SL	:= -x -Bshareable -soname $(shlib)
 ifeq ($(PORTNAME), bsdi)
   ifdef BSD_SHLIB
     ifeq ($(DLSUFFIX), .so)
-      install-shlib-dep := install-shlib
       shlib			:= lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
       LDFLAGS_SL                += -shared -soname $(shlib)
       CFLAGS			+= $(CFLAGS_SL)
     endif
     ifeq ($(DLSUFFIX), .o)
-      install-shlib-dep	:= install-shlib
       shlib			:= lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
       LD			:= shlicc
       LDFLAGS_SL	 	+= -O $(LDREL)
 
 ifeq ($(PORTNAME), freebsd)
   ifdef BSD_SHLIB
-    install-shlib-dep	:= install-shlib
     ifdef ELF_SYSTEM
       shlib		:= lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION)
       LDFLAGS_SL	:= -x -shared -soname $(shlib)
 
 ifeq ($(PORTNAME), netbsd)
   ifdef BSD_SHLIB
-    install-shlib-dep	:= install-shlib
     soname		:= lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION)
     shlib		:= lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
     ifdef ELF_SYSTEM
       LD		:= $(CC)
       LDFLAGS_SL	:= -shared -Wl,-soname -Wl,$(soname)
       ifneq ($(SHLIB_LINK),)
-        LDFLAGS_SL	+= -Wl,-R$(LIBDIR)
+        LDFLAGS_SL	+= -Wl,-R$(libdir)
       endif
     else
       LDFLAGS_SL	:= -x -Bshareable -Bforcearchive
 endif
 
 ifeq ($(PORTNAME), hpux)
-  install-shlib-dep	:= install-shlib
 # HPUX doesn't believe in version numbers for shlibs
-  shlib				:= lib$(NAME)$(DLSUFFIX)
+  shlib			:= lib$(NAME)$(DLSUFFIX)
   LDFLAGS_SL		:= -b
-  CFLAGS			+= $(CFLAGS_SL)
+  CFLAGS		+= $(CFLAGS_SL)
 endif
 
 ifeq ($(PORTNAME), irix5)
-  install-shlib-dep := install-shlib
   shlib := lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION)
-  LDFLAGS_SL := -shared -rpath $(LIBDIR) -set_version sgi$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
+  LDFLAGS_SL := -shared -rpath $(libdir) -set_version sgi$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
   CFLAGS += $(CFLAGS_SL)
 endif
 
 ifeq ($(PORTNAME), linux)
-  install-shlib-dep	:= install-shlib
-  shlib				:= lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
+  shlib			:= lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
   LDFLAGS_SL		:= -Bdynamic -shared -soname $(shlib)
   LDFLAGS_ODBC		:= -Bsymbolic -lc -lm
   SHLIB_LINK		+= -lc
-  CFLAGS			+= $(CFLAGS_SL)
+  CFLAGS		+= $(CFLAGS_SL)
 endif
 
 ifeq ($(PORTNAME), solaris_i386)
-  install-shlib-dep	:= install-shlib
-  shlib				:= lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
+  shlib			:= lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
   LDFLAGS_SL		:= -G
   SHLIB_LINK		+= -ldl -lsocket -lresolv -lnsl -lm -lc
-  CFLAGS			+= $(CFLAGS_SL)
+  CFLAGS		+= $(CFLAGS_SL)
 endif
 
 ifeq ($(PORTNAME), solaris_sparc)
-  install-shlib-dep	:= install-shlib
-  shlib				:= lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
+  shlib			:= lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
   LDFLAGS_SL		:= -G
   SHLIB_LINK		+= -ldl -lsocket -lresolv -lnsl -lm -lc
-  CFLAGS			+= $(CFLAGS_SL)
+  CFLAGS		+= $(CFLAGS_SL)
 endif
 
 ifeq ($(PORTNAME), alpha)
-  install-shlib-dep	:= install-shlib
   shlib			:= lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
   LDFLAGS_SL		+= -shared -expect_unresolved '*'
 endif
 
 ifeq ($(PORTNAME), svr4)
-  install-shlib-dep	:= install-shlib
-  shlib				:= lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
+  shlib			:= lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
   LDFLAGS_SL		:= -G
-  CFLAGS			+= $(CFLAGS_SL)
+  CFLAGS		+= $(CFLAGS_SL)
 endif
 
 ifeq ($(PORTNAME), univel)
-  install-shlib-dep	:= install-shlib
-  shlib				:= lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
+  shlib			:= lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
   LDFLAGS_SL		:= -G -z text
-  CFLAGS			+= $(CFLAGS_SL)
+  CFLAGS		+= $(CFLAGS_SL)
   ifeq ($(CXX), CC)
     CXXFLAGS += -Xw
     COMPILE.cc = $(CXX) $(CXXFLAGS:ll,alloca=ll) $(CPPFLAGS) $(TARGET_ARCH) -c
 endif
 
 ifeq ($(PORTNAME), unixware)
-  install-shlib-dep	:= install-shlib
-  shlib				:= lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
+  shlib			:= lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
   LDFLAGS_SL		:= -G -z text
-  CFLAGS			+= $(CFLAGS_SL)
+  CFLAGS		+= $(CFLAGS_SL)
   ifeq ($(CXX), CC)
     CXXFLAGS += -Xw
     COMPILE.cc = $(CXX) $(CXXFLAGS:ll,alloca=ll) $(CPPFLAGS) $(TARGET_ARCH) -c
 endif
 
 ifeq ($(PORTNAME), win)
-  install-shlib-dep	:= install-shlib
-  shlib				:= $(NAME)$(DLSUFFIX)
+  shlib			:= $(NAME)$(DLSUFFIX)
 endif
 
-# Default target definition.  Note shlib is empty if not building a shlib.
 
-all: lib$(NAME).a $(shlib)
+# Note that in what follows, shlib is empty when not building a shared
+# library.
+
+
+##
+## BUILD
+##
+
+.PHONY: all-lib
+all-lib: lib$(NAME).a $(shlib)
 
 # Rules to build regular and shared libraries
 
 endif
 	$(RANLIB) $@
 
-endif
+endif # not win
 
-ifneq ($(shlib),)
+ifdef shlib
 ifneq ($(PORTNAME), win)
 ifneq ($(PORTNAME), aix)
 
 # Normal case
 $(shlib): $(OBJS)
 	$(LD) $(LDFLAGS_SL) -o $@ $(OBJS) $(SHLIB_LINK)
-	if [ "$(shlib)" != "lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION)" ]; then \
-		rm -f lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION); \
-		$(LN_S) $(shlib) lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION); \
-	fi
-	if [ "$(shlib)" != "lib$(NAME)$(DLSUFFIX)" ]; then \
-		rm -f lib$(NAME)$(DLSUFFIX); \
-		$(LN_S) $(shlib) lib$(NAME)$(DLSUFFIX); \
-	fi
+# If we're using major and minor versions, then make a symlink to major-version-only.
+ifneq ($(shlib), lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION))
+	rm -f lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION)
+	$(LN_S) $(shlib) lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION)
+endif
+# Make sure we have a link to a name without any version numbers
+ifneq ($(shlib), lib$(NAME)$(DLSUFFIX))
+	rm -f lib$(NAME)$(DLSUFFIX)
+	$(LN_S) $(shlib) lib$(NAME)$(DLSUFFIX)
+endif
 
-else
+else # PORTNAME == aix
 
 # AIX case
 $(shlib): lib$(NAME).a
-	$(MKLDEXPORT) lib$(NAME).a $(LIBDIR) > lib$(NAME)$(EXPSUFF)
-	$(LD) -H512 -bM:SRE -bI:$(SRCDIR)/backend/$(POSTGRES_IMP) -bE:lib$(NAME)$(EXPSUFF) -o $@ $< $(LDFLAGS) $(SHLIB_LINK)
+	$(MKLDEXPORT) lib$(NAME).a $(libdir) > lib$(NAME)$(EXPSUFF)
+	$(LD) -H512 -bM:SRE -bI:$(top_builddir)/src/backend/$(POSTGRES_IMP) -bE:lib$(NAME)$(EXPSUFF) -o $@ $< $(LDFLAGS) $(SHLIB_LINK)
 
-endif
+endif # PORTNAME == aix
 
-else
+else # PORTNAME == win
 
 # WIN case
-$(shlib) lib$(NAME).a: $(OBJS) $(SRCDIR)/utils/dllinit.o
+$(shlib) lib$(NAME).a: $(OBJS) $(top_builddir)/src/utils/dllinit.o
 	$(DLLTOOL) --export-all --output-def $(NAME).def $(OBJS)
-	$(DLLWRAP) -o $(shlib) --dllname $(shlib) --def $(NAME).def $(OBJS) $(SRCDIR)/utils/dllinit.o $(DLLINIT) $(SHLIB_LINK)
+	$(DLLWRAP) -o $(shlib) --dllname $(shlib) --def $(NAME).def $(OBJS) $(top_builddir)/src/utils/dllinit.o $(DLLINIT) $(SHLIB_LINK)
 	$(DLLTOOL) --dllname $(shlib) --def $(NAME).def --output-lib lib$(NAME).a
 
-$(SRCDIR)/utils/dllinit.o: $(SRCDIR)/utils/dllinit.c
-	$(MAKE) -C $(SRCDIR)/utils dllinit.o
+$(top_builddir)/src/utils/dllinit.o: $(top_srcdir)/src/utils/dllinit.c
+	$(MAKE) -C $(top_builddir)/src/utils dllinit.o
+
+endif # PORTNAME == win
+endif # shlib
 
-endif
-endif
 
-# Rules to install regular and shared libraries
+##
+## INSTALL
+##
 
-.PHONY: all install-lib install-shlib
+.PHONY: install-lib install-lib-static install-lib-shared
+install-lib: install-lib-static install-lib-shared
 
-install-lib: lib$(NAME).a
-	$(INSTALL) $(INSTL_LIB_OPTS) lib$(NAME).a $(LIBDIR)/lib$(NAME).a
+install-lib-static: lib$(NAME).a
+	$(INSTALL_DATA) $< $(libdir)/lib$(NAME).a
 
-install-shlib: $(shlib)
-	$(INSTALL) $(INSTL_SHLIB_OPTS) $(shlib) $(LIBDIR)/$(shlib)
+ifdef shlib
+install-lib-shared: $(shlib)
+	$(INSTALL_SHLIB) $< $(libdir)/$(shlib)
 ifneq ($(PORTNAME), win)
-	if [ "$(shlib)" != "lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION)" ]; then \
-		cd $(LIBDIR); \
-		rm -f lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION); \
-		$(LN_S) $(shlib) lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION); \
-	fi
-	if [ "$(shlib)" != "lib$(NAME)$(DLSUFFIX)" ]; then \
-		cd $(LIBDIR); \
-		rm -f lib$(NAME)$(DLSUFFIX); \
-		$(LN_S) $(shlib) lib$(NAME)$(DLSUFFIX); \
-	fi
+ifneq ($(shlib), lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION))
+	cd $(libdir) && \
+	rm -f lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION) && \
+	$(LN_S) $(shlib) lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION)
 endif
+ifneq ($(shlib), lib$(NAME)$(DLSUFFIX))
+	cd $(libdir) && \
+	rm -f lib$(NAME)$(DLSUFFIX) && \
+	$(LN_S) $(shlib) lib$(NAME)$(DLSUFFIX)
+endif
+
+endif # not win
+endif # shlib
+
+
+##
+## UNINSTALL
+##
+
+.PHONY: uninstall-lib
+uninstall-lib:
+	rm -f $(libdir)/lib$(NAME).a
+ifdef shlib
+	rm -f $(libdir)/lib$(NAME)$(DLSUFFIX) \
+	  $(libdir)/lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION) \
+	  $(libdir)/lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
+endif # shlib
 
-# Rule to delete shared library during "make clean"
 
-.PHONY: clean-shlib
+##
+## CLEAN
+##
 
-clean-shlib:
+.PHONY: clean-lib
+clean-lib:
+	rm -f lib$(NAME).a
 	rm -f $(shlib) lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION) lib$(NAME)$(DLSUFFIX)
 ifeq ($(PORTNAME), win)
 	rm -rf $(NAME).def

src/bin/pg_dump/Makefile

 #
 # Copyright (c) 1994, Regents of the University of California
 #
-# $Header: /cvsroot/pgsql/src/bin/pg_dump/Makefile,v 1.15 2000/06/27 00:31:12 petere Exp $
+# $Header: /cvsroot/pgsql/src/bin/pg_dump/Makefile,v 1.16 2000/06/28 18:29:16 petere Exp $
 #
 #-------------------------------------------------------------------------
 
 
 .PHONY: submake
 submake:
-	$(MAKE) -C $(LIBPQDIR) libpq.a
+	$(MAKE) -C $(LIBPQDIR) all
 
 install: all installdirs
 	$(INSTALL_PROGRAM) pg_dump$(X) $(bindir)/pg_dump$(X)

src/bin/pg_encoding/Makefile

 #
 # Copyright (c) 1998, PostgreSQL Global Development Group
 #
-# $Header: /cvsroot/pgsql/src/bin/pg_encoding/Attic/Makefile,v 1.8 2000/06/27 00:31:17 petere Exp $
+# $Header: /cvsroot/pgsql/src/bin/pg_encoding/Attic/Makefile,v 1.9 2000/06/28 18:29:21 petere Exp $
 #
 #-------------------------------------------------------------------------
 
 .PHONY: submake
 
 submake:
-	$(MAKE) -C $(LIBPQDIR) libpq.a
+	$(MAKE) -C $(LIBPQDIR) all
 
 install: all installdirs
 	$(INSTALL_PROGRAM) pg_encoding$(X) $(bindir)/pg_encoding$(X)

src/bin/pgaccess/Makefile

 #
 # Copyright (c) 1994, Regents of the University of California
 #
-# $Header: /cvsroot/pgsql/src/bin/pgaccess/Attic/Makefile,v 1.9 2000/06/27 00:31:34 petere Exp $
+# $Header: /cvsroot/pgsql/src/bin/pgaccess/Attic/Makefile,v 1.10 2000/06/28 18:29:22 petere Exp $
 #
 #-------------------------------------------------------------------------
 
 install: all installdirs
 	$(INSTALL_SCRIPT) pgaccess $(bindir)/pgaccess
 	$(INSTALL_SCRIPT) main.tcl $(pgaccessdir)
-	$(INSTALL_DATA) lib/*.tcl $(pgaccessdir)/lib
-	$(INSTALL_DATA) lib/help/*.hlp $(pgaccessdir)/lib/help
-	$(INSTALL_DATA) lib/languages/[a-z]* $(pgaccessdir)/lib/languages
-	$(INSTALL_DATA) images/*.gif $(pgaccessdir)/images
+	for i in lib/*.tcl; do $(INSTALL_DATA) $$i $(pgaccessdir)/lib || exit 1; done
+	for i in lib/help/*.hlp; do $(INSTALL_DATA) $$i $(pgaccessdir)/lib/help || exit 1; done
+	for i in lib/languages/[a-z]*; do $(INSTALL_DATA) $$i $(pgaccessdir)/lib/languages || exit 1; done
+	for i in images/*.gif; do $(INSTALL_DATA) $$i $(pgaccessdir)/images || exit 1; done
 
 installdirs:
 	$(mkinstalldirs) $(bindir) $(pgaccessdir)/lib/help $(pgaccessdir)/lib/languages $(pgaccessdir)/images

src/bin/psql/Makefile

 #
 # Copyright (c) 1994, Regents of the University of California
 #
-# $Header: /cvsroot/pgsql/src/bin/psql/Makefile,v 1.21 2000/06/27 00:31:41 petere Exp $
+# $Header: /cvsroot/pgsql/src/bin/psql/Makefile,v 1.22 2000/06/28 18:29:31 petere Exp $
 #
 #-------------------------------------------------------------------------
 
 .PHONY: submake
 
 submake:
-	$(MAKE) -C $(LIBPQDIR) libpq.a
+	$(MAKE) -C $(LIBPQDIR) all
 
 install: all installdirs
 	$(INSTALL_PROGRAM) psql$(X) $(bindir)/psql$(X)

src/interfaces/Makefile

+#-------------------------------------------------------------------------
+#
+# Makefile for src/interfaces
+#
+# Copyright (c) 1994, Regents of the University of California
+#
+# $Header: /cvsroot/pgsql/src/interfaces/Makefile,v 1.40 2000/06/28 18:29:35 petere Exp $
+#
+#-------------------------------------------------------------------------
+
+subdir = src/interfaces
+top_builddir = ../..
+include ../Makefile.global
+
+DIRS := libpq ecpg libpgeasy
+
+ALLDIRS := $(DIRS) odbc libpq++ libpgtcl perl5 python
+
+ifeq ($(enable_odbc), yes)
+DIRS += odbc
+endif
+
+ifeq ($(with_CXX), yes)
+DIRS += libpq++
+endif
+
+ifeq ($(USE_TCL), true)
+DIRS += libpgtcl
+endif
+
+ifeq ($(with_perl), yes)
+DIRS += perl5
+endif
+
+ifeq ($(with_python), yes)
+DIRS += python
+endif
+
+
+all install installdirs uninstall dep depend:
+	@for dir in $(DIRS); do $(MAKE) -C $$dir $@ || exit 1; done
+
+clean:
+	@for dir in $(DIRS); do $(MAKE) -C $$dir $@; done
+
+distclean maintainer-clean: clean
+	@for dir in $(ALLDIRS); do $(MAKE) -C $$dir $@; done

src/interfaces/Makefile.in

-#-------------------------------------------------------------------------
-#
-# Makefile for src/interfaces
-#
-# Copyright (c) 1994, Regents of the University of California
-#
-# $Header: /cvsroot/pgsql/src/interfaces/Attic/Makefile.in,v 1.4 2000/06/20 16:39:54 petere Exp $
-#
-#-------------------------------------------------------------------------
-
-srcdir = @srcdir@
-VPATH = @srcdir@
-
-top_srcdir = @top_srcdir@
-top_builddir = ../..
-subdir = src/interfaces
-
-USE_TCL = @USE_TCL@
-enable_odbc = @enable_odbc@
-with_CXX = @with_CXX@
-with_perl = @with_perl@
-with_python = @with_python@
-
-all install clean dep depend:
-	$(MAKE) -C libpq $@
-	$(MAKE) -C ecpg $@
-ifeq ($(with_CXX), yes)
-	$(MAKE) -C libpq++ $@
-endif
-	$(MAKE) -C libpgeasy $@
-ifeq ($(USE_TCL), true)
-	$(MAKE) -C libpgtcl $@
-endif
-ifeq ($(with_perl), yes)
-	$(MAKE) -C perl5 $@
-endif
-ifeq ($(with_python), yes)
-	$(MAKE) -C python $@
-endif
-ifeq ($(enable_odbc), yes)
-	$(MAKE) -C odbc $@
-endif
-
-distclean maintainer-clean: clean
-	-$(MAKE) -C perl5 $@
-	-$(MAKE) -C python $@
-	-$(MAKE) -C odbc $@
-	rm -f Makefile \
-	  libpq/Makefile \
-	  ecpg/lib/Makefile \
-	  ecpg/preproc/Makefile \
-	  libpq++/Makefile \
-	  libpgeasy/Makefile \
-	  libpgtcl/Makefile
-
-
-.PHONY: all install dep depend clean distclean maintainer-clean
-
-
-Makefile: Makefile.in $(top_builddir)/config.status
-	cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status
-
-$(top_builddir)/config.status: $(top_srcdir)/configure
-	cd $(top_builddir) && ./config.status --recheck

src/interfaces/ecpg/Makefile

-all install uninstall clean dep depend:
+subdir = src/interfaces/ecpg
+top_builddir = ../../..
+include ../../Makefile.global
+
+all install installdirs uninstall dep depend:
 	$(MAKE) -C include $@
 	$(MAKE) -C lib $@
 	$(MAKE) -C preproc $@
+
+clean distclean maintainer-clean:
+	-$(MAKE) -C include $@
+	-$(MAKE) -C lib $@
+	-$(MAKE) -C preproc $@

src/interfaces/ecpg/include/Makefile

-# Generated automatically from Makefile.in by configure.
-SRCDIR= ../../..
-include $(SRCDIR)/Makefile.global
+subdir = src/interfaces/ecpg/include
+top_builddir = ../../../..
+include ../../../Makefile.global
 
-all clean::
-	@echo Nothing to be done.
+install: all installdirs install-headers
 
-install::
-	$(INSTALL) $(INSTLOPTS) ecpgerrno.h $(HEADERDIR)	
-	$(INSTALL) $(INSTLOPTS) ecpglib.h $(HEADERDIR)	
-	$(INSTALL) $(INSTLOPTS) ecpgtype.h $(HEADERDIR)	
-	$(INSTALL) $(INSTLOPTS) sqlca.h $(HEADERDIR)	
-	$(INSTALL) $(INSTLOPTS) sql3types.h $(HEADERDIR)	
+.PHONY: install-headers
+ecpg_headers = ecpgerrno.h ecpglib.h ecpgtype.h sqlca.h sql3types.h
+install-headers: $(ecpg_headers)
+	for i in $^; do $(INSTALL_DATA) $$i $(includedir); done
 
-uninstall::
-	rm -f $(HEADERDIR)/ecpgerrno.h
-	rm -f $(HEADERDIR)/ecpglib.h
-	rm -f $(HEADERDIR)/ecpgtype.h
-	rm -f $(HEADERDIR)/sqlca.h
-	rm -f $(HEADERDIR)/sql3types.h
+installdirs:
+	$(mkinstalldirs) $(includedir)
 
-dep depend:
+uninstall:
+	rm -f $(addprefix $(includedir)/, $(ecpg_headers))

src/interfaces/ecpg/lib/Makefile

+#-------------------------------------------------------------------------
+#
+# Makefile for ecpg library
+#
+# Copyright (c) 1994, Regents of the University of California
+#
+# $Header: /cvsroot/pgsql/src/interfaces/ecpg/lib/Attic/Makefile,v 1.6 2000/06/28 18:29:39 petere Exp $
+#
+#-------------------------------------------------------------------------
+
+subdir = src/interfaces/ecpg/lib
+top_builddir = ../../../..
+include ../../../Makefile.global
+
+NAME= ecpg
+SO_MAJOR_VERSION= 3
+SO_MINOR_VERSION= 1.1
+
+CFLAGS+= -I$(top_srcdir)/src/interfaces/ecpg/include -I$(LIBPQDIR)
+
+
+OBJS= execute.o typename.o descriptor.o data.o error.o prepare.o memory.o \
+	connect.o misc.o
+
+SHLIB_LINK= $(LIBPQ)
+
+all: all-lib
+
+# Shared library stuff
+include $(top_srcdir)/src/Makefile.shlib
+
+install: all installdirs install-lib
+
+installdirs:
+	$(mkinstalldirs) $(libdir)
+
+uninstall: uninstall-lib
+
+clean distclean maintainer-clean: clean-lib
+	rm -f $(OBJS)
+
+depend dep:
+	$(CC) -MM $(CFLAGS) *.c >depend
+
+ifeq (depend,$(wildcard depend))
+include depend
+endif

src/interfaces/ecpg/lib/Makefile.in

-#-------------------------------------------------------------------------
-#
-# Makefile
-#    Makefile for ecpg library
-#
-# Copyright (c) 1994, Regents of the University of California
-#
-# IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/interfaces/ecpg/lib/Attic/Makefile.in,v 1.68 2000/06/17 00:09:59 petere Exp $
-#
-#-------------------------------------------------------------------------
-
-NAME= ecpg
-SO_MAJOR_VERSION= 3
-SO_MINOR_VERSION= 1.1
-
-SRCDIR= ../../..
-include $(SRCDIR)/Makefile.global
-
-CFLAGS+= -I../include -I$(LIBPQDIR)
-
-
-OBJS= execute.o typename.o descriptor.o data.o error.o prepare.o memory.o \
-	connect.o misc.o
-
-SHLIB_LINK= $(LIBPQ)
-
-# Shared library stuff, also default 'all' target
-include $(SRCDIR)/Makefile.shlib
-
-
-.PHONY: install
-
-install: install-lib $(install-shlib-dep)
-
-.PHONY: clean
-
-clean: clean-shlib
-	rm -f lib$(NAME).a $(OBJS)
-
-depend dep:
-	$(CC) -MM $(CFLAGS) *.c >depend
-
-ifeq (depend,$(wildcard depend))
-include depend
-endif

src/interfaces/ecpg/preproc/Makefile

+subdir = src/interfaces/ecpg/preproc
+top_builddir = ../../../..
+include ../../../Makefile.global
+
+MAJOR_VERSION=2
+MINOR_VERSION=7
+PATCHLEVEL=1
+
+CFLAGS+=-I../include -DMAJOR_VERSION=$(MAJOR_VERSION) \
+	-DMINOR_VERSION=$(MINOR_VERSION) -DPATCHLEVEL=$(PATCHLEVEL) \
+	-DINCLUDE_PATH=\"$(includedir)\" 
+
+OBJS=preproc.o pgc.o type.o ecpg.o ecpg_keywords.o output.o\
+    keywords.o c_keywords.o ../lib/typename.o descriptor.o variable.o
+
+all: ecpg
+
+ifdef SNPRINTF
+OBJS+=$(top_builddir)/src/backend/port/snprintf.o
+
+$(top_builddir)/src/backend/port/snprintf.o:
+	$(MAKE) -C $(top_builddir)/src/backend/port snprintf.o
+endif
+
+
+ecpg: $(OBJS)
+	$(CC) -o $@ $^ $(LDFLAGS)
+
+$(srcdir)/preproc.c $(srcdir)/preproc.h: preproc.y
+	$(YACC) -d $(YFLAGS) $<
+	mv y.tab.c $(srcdir)/preproc.c
+	mv y.tab.h $(srcdir)/preproc.h
+
+$(srcdir)/pgc.c: pgc.l
+	$(LEX) $(LFLAGS) $<
+	mv lex.yy.c $@
+
+install: all installdirs
+	$(INSTALL_PROGRAM) ecpg$(X) $(bindir)
+
+installdirs:
+	$(mkinstalldirs) $(bindir)
+
+uninstall:
+	rm -f $(bindir)/ecpg$(X)
+
+clean distclean:
+	rm -f *.o ecpg$(X)
+# garbage from partial builds
+	rm -f y.tab.c y.tab.h lex.yy.c
+# garbage from development
+	@rm -f core a.out *~ *.output *.tab.c
+
+# `make clean' does not remove preproc.c, preproc.h, or pgc.c since we
+# want to ship those files in the distribution for people with
+# inadequate tools.
+maintainer-clean: distclean
+	rm -f $(srcdir)/preproc.c $(srcdir)/preproc.h $(srcdir)/pgc.c
+
+
+depend dep: preproc.c pgc.c
+	$(CC) -MM $(CFLAGS) *.c >depend
+
+ifeq (depend,$(wildcard depend))
+include depend
+endif

src/interfaces/ecpg/preproc/Makefile.in

-SRCDIR= ../../..
-include $(SRCDIR)/Makefile.global
-
-MAJOR_VERSION=2
-MINOR_VERSION=7
-PATCHLEVEL=1
-
-CFLAGS+=-I../include -DMAJOR_VERSION=$(MAJOR_VERSION) \
-	-DMINOR_VERSION=$(MINOR_VERSION) -DPATCHLEVEL=$(PATCHLEVEL) \
-	-DINCLUDE_PATH=\"$(HEADERDIR)\" 
-
-OBJS=preproc.o pgc.o type.o ecpg.o ecpg_keywords.o output.o\
-    keywords.o c_keywords.o ../lib/typename.o descriptor.o variable.o
-
-all:: ecpg
-
-ifneq (@SNPRINTF@,)
-OBJS+=$(SRCDIR)/backend/port/snprintf.o
-
-$(SRCDIR)/backend/port/snprintf.o:
-	$(MAKE) -C $(SRCDIR)/backend/port snprintf.o
-endif
-
-# Rule that really do something.
-ecpg: $(OBJS)
-	$(CC) -o ecpg $(OBJS) $(LEXLIB) $(LDFLAGS)
-
-preproc.c preproc.h: preproc.y
-	$(YACC) -d $(YFLAGS) $<
-	mv y.tab.c preproc.c
-	mv y.tab.h preproc.h
-
-pgc.c: pgc.l
-	$(LEX) $(LFLAGS) $<
-	mv lex.yy.c pgc.c
-
-clean:
-	rm -f *.o core a.out ecpg$(X) *~ *.output *.tab.c
-# And the garbage that might have been left behind by partial build:
-	rm -f y.tab.c y.tab.h lex.yy.c
-# make clean does not remove preproc.c, preproc.h, pgc.c since we want
-# to ship those files in the distribution, for people with inadequate tools.
-
-install: all
-	$(INSTALL) $(INSTL_EXE_OPTS) ecpg$(X) $(BINDIR)
-
-uninstall:
-	rm -f $(BINDIR)/ecpg
-
-depend dep: preproc.c pgc.c
-	$(CC) -MM $(CFLAGS) *.c >depend
-
-ifeq (depend,$(wildcard depend))
-include depend
-endif

src/interfaces/ecpg/preproc/pgc.l

  *
  *
  * IDENTIFICATION
- *	  $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/pgc.l,v 1.59 2000/06/14 18:17:54 petere Exp $
+ *	  $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/pgc.l,v 1.60 2000/06/28 18:29:40 petere Exp $
  *
  *-------------------------------------------------------------------------
  */
 #undef yywrap
 #endif /* yywrap */
 
+#define YY_NO_UNPUT
+
 extern YYSTYPE yylval;
 
 /*

src/interfaces/libpgeasy/Makefile

+#-------------------------------------------------------------------------
+#
+# Makefile for src/interfaces/libpgeasy
+#
+# $Header: /cvsroot/pgsql/src/interfaces/libpgeasy/Attic/Makefile,v 1.1 2000/06/28 18:29:41 petere Exp $
+#
+#-------------------------------------------------------------------------
+
+subdir = src/interfaces/libpgeasy
+top_builddir = ../../..
+include ../../Makefile.global
+
+
+# shared library parameters
+NAME= pgeasy
+SO_MAJOR_VERSION= 2
+SO_MINOR_VERSION= 1
+
+CFLAGS+= -I$(LIBPQDIR)
+
+OBJS= libpgeasy.o halt.o
+
+SHLIB_LINK+= $(LIBPQ)
+
+# If crypt is a separate library, rather than part of libc, it may need
+# to be referenced separately to keep (broken) linkers happy.  (This is
+# braindead; users of libpq should not need to know what it depends on.)
+SHLIB_LINK+= $(findstring -lcrypt,$(LIBS))
+
+all: all-lib
+
+# Shared library stuff
+include $(top_srcdir)/src/Makefile.shlib
+
+install: all installdirs install-headers install-lib
+
+.PHONY: install-headers
+install-headers: libpgeasy.h
+	$(INSTALL_DATA) $< $(includedir)/libpgeasy.h
+
+installdirs:
+	$(mkinstalldirs) $(libdir) $(includedir)
+
+uninstall: uninstall-lib
+	rm -f $(includedir)/libpgeasy.h
+
+clean distclean maintainer-clean: clean-lib
+	rm -f $(OBJS)
+
+depend dep:
+	$(CC) -MM $(CFLAGS) *.c >depend
+
+ifeq (depend,$(wildcard depend))
+include depend
+endif

src/interfaces/libpgeasy/Makefile.in

-#-------------------------------------------------------------------------
-#
-# Makefile
-#    Makefile for pgeasy library
-#
-# IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/interfaces/libpgeasy/Attic/Makefile.in,v 1.8 2000/06/17 00:10:00 petere Exp $
-#
-#-------------------------------------------------------------------------
-
-NAME= pgeasy
-SO_MAJOR_VERSION= 2
-SO_MINOR_VERSION= 1
-
-SRCDIR= ../..
-include $(SRCDIR)/Makefile.global
-
-CFLAGS+= -I$(LIBPQDIR)
-
-OBJS= libpgeasy.o halt.o
-
-SHLIB_LINK+= $(LIBPQ)
-
-# If crypt is a separate library, rather than part of libc, it may need
-# to be referenced separately to keep (broken) linkers happy.  (This is
-# braindead; users of libpq should not need to know what it depends on.)
-SHLIB_LINK+= $(findstring -lcrypt,$(LIBS))
-
-# Shared library stuff, also default 'all' target
-include $(SRCDIR)/Makefile.shlib
-
-
-.PHONY: install install-headers
-
-install: install-headers install-lib $(install-shlib-dep)
-
-install-headers: libpgeasy.h
-	-@if [ ! -d $(HEADERDIR) ]; then mkdir $(HEADERDIR); fi
-	$(INSTALL) $(INSTLOPTS) libpgeasy.h $(HEADERDIR)/libpgeasy.h
-
-.PHONY: clean
-
-clean: clean-shlib
-	rm -f lib$(NAME).a $(OBJS)
-
-depend dep:
-	$(CC) -MM $(CFLAGS) *.c >depend
-
-ifeq (depend,$(wildcard depend))
-include depend
-endif

src/interfaces/libpgtcl/Makefile

+#-------------------------------------------------------------------------
+#
+# Makefile for libpgtcl library
+#
+# Copyright (c) 1994, Regents of the University of California
+#
+# $Header: /cvsroot/pgsql/src/interfaces/libpgtcl/Attic/Makefile,v 1.19 2000/06/28 18:29:43 petere Exp $
+#
+#-------------------------------------------------------------------------
+
+subdir = src/interfaces/libpgtcl
+top_builddir = ../../..
+include ../../Makefile.global
+
+NAME= pgtcl
+SO_MAJOR_VERSION= 2
+SO_MINOR_VERSION= 1
+
+CFLAGS+= -I$(LIBPQDIR)
+
+OBJS= pgtcl.o pgtclCmds.o pgtclId.o
+
+SHLIB_LINK+= $(LIBPQ)
+
+# If crypt is a separate library, rather than part of libc, it may need
+# to be referenced separately to keep (broken) linkers happy.  (This is
+# braindead; users of libpq should not need to know what it depends on.)
+SHLIB_LINK+= $(findstring -lcrypt,$(LIBS))
+
+all: all-lib
+
+# Shared library stuff
+include $(top_srcdir)/src/Makefile.shlib
+
+install: all installdirs install-headers install-lib
+
+.PHONY: install-headers
+install-headers: libpgtcl.h
+	$(INSTALL_DATA) $< $(includedir)/libpgtcl.h
+
+installdirs:
+	$(mkinstalldirs) $(libdir) $(includedir)
+
+uninstall: uninstall-lib
+	rm -f $(includedir)/libpgtcl.h
+
+clean distclean maintainer-clean: clean-lib
+	rm -f $(OBJS)
+
+depend dep:
+	$(CC) -MM $(CFLAGS) *.c >depend
+
+ifeq (depend,$(wildcard depend))
+include depend
+endif

src/interfaces/libpgtcl/Makefile.in

-#-------------------------------------------------------------------------
-#
-# Makefile
-#    Makefile for libpgtcl library
-#
-# Copyright (c) 1994, Regents of the University of California
-#
-# IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/interfaces/libpgtcl/Attic/Makefile.in,v 1.44 2000/06/17 00:10:05 petere Exp $
-#
-#-------------------------------------------------------------------------
-
-NAME= pgtcl
-SO_MAJOR_VERSION= 2
-SO_MINOR_VERSION= 1
-
-SRCDIR= ../..
-include $(SRCDIR)/Makefile.global
-
-CFLAGS+= -I$(LIBPQDIR)
-
-OBJS= pgtcl.o pgtclCmds.o pgtclId.o
-
-SHLIB_LINK+= $(LIBPQ)
-
-# If crypt is a separate library, rather than part of libc, it may need
-# to be referenced separately to keep (broken) linkers happy.  (This is
-# braindead; users of libpq should not need to know what it depends on.)
-SHLIB_LINK+= $(findstring -lcrypt,$(LIBS))
-
-# Shared library stuff, also default 'all' target
-include $(SRCDIR)/Makefile.shlib
-
-.PHONY: install beforeinstall-headers install-headers
-
-install: install-headers install-lib $(install-shlib-dep)
-
-install-headers: beforeinstall-headers libpgtcl.h
-	$(INSTALL) $(INSTLOPTS) libpgtcl.h $(HEADERDIR)/libpgtcl.h
-
-beforeinstall-headers:
-	-@if [ ! -d $(HEADERDIR) ]; then mkdir $(HEADERDIR); fi
-
-Makefile.tcldefs: mkMakefile.tcldefs.sh
-	/bin/sh mkMakefile.tcldefs.sh
-
-Makefile.tkdefs: mkMakefile.tkdefs.sh
-	/bin/sh mkMakefile.tkdefs.sh
-
-.PHONY: clean
-
-clean: clean-shlib
-	rm -f lib$(NAME).a $(OBJS)
-
-depend dep:
-	$(CC) -MM $(CFLAGS) *.c >depend
-
-ifeq (depend,$(wildcard depend))
-include depend
-endif

src/interfaces/libpq++/Makefile

+#-------------------------------------------------------------------------
+#
+# Makefile for libpq++ library
+#
+# Copyright (c) 1994, Regents of the University of California
+#
+# $Header: /cvsroot/pgsql/src/interfaces/libpq++/Attic/Makefile,v 1.22 2000/06/28 18:29:48 petere Exp $
+#
+#-------------------------------------------------------------------------
+
+subdir = src/interfaces/libpq++
+top_builddir = ../../..
+include ../../Makefile.global
+
+NAME= pq++
+SO_MAJOR_VERSION= 3
+SO_MINOR_VERSION= 1
+
+SRCHEADERDIR = $(top_srcdir)/src/include
+CXXFLAGS+= -I$(SRCHEADERDIR) -I$(LIBPQDIR)
+
+OBJS = pgconnection.o pgdatabase.o pgtransdb.o pgcursordb.o pglobject.o 
+
+ifeq ($(PORTNAME), win)
+SHLIB_LINK+= --driver-name g++ $(LIBPQ)
+else
+SHLIB_LINK= $(LIBPQ)
+endif
+
+# For CC on IRIX, must use CC as linker/archiver of C++ libraries
+ifeq ($(PORTNAME), irix5)
+  ifeq ($(CXX), CC)
+    AR = CC
+    AROPT = -ar -o
+    LD = CC
+  endif
+endif
+
+all: all-lib
+
+# Shared library stuff
+include $(top_builddir)/src/Makefile.shlib
+
+# Pull shared-lib CFLAGS into CXXFLAGS
+CXXFLAGS+= $(CFLAGS_SL)
+
+
+.PHONY: examples
+examples:
+	$(MAKE) -C examples all
+
+install: all installdirs install-headers install-lib
+
+libpqxx_includedir = $(includedir)/libpq++
+MAINHEADER = libpq++.h
+LIBPGXXHEADERS = pgconnection.h pgdatabase.h pgtransdb.h pgcursordb.h pglobject.h
+
+.PHONY: install-headers
+install-headers: $(MAINHEADER) $(LIBPGXXHEADERS)
+	$(INSTALL_DATA) $< $(includedir)
+	for i in $(LIBPGXXHEADERS); do $(INSTALL_DATA) $(srcdir)/$$i $(libpqxx_includedir) || exit 1; done
+
+installdirs:
+	$(mkinstalldirs) $(libdir) $(includedir) $(libpqxx_includedir)
+
+uninstall: uninstall-lib
+	rm -f $(includedir)/$(MAINHEADER)
+	rm -rf $(libpqxx_includedir)
+
+clean distclean maintainer-clean: clean-lib
+	rm -f $(OBJS)
+	-$(MAKE) -C examples clean
+
+
+dep depend:
+	$(CXX) -MM $(CXXFLAGS) *.cc >depend
+
+ifeq (depend,$(wildcard depend))
+include depend
+endif

src/interfaces/libpq++/Makefile.in

-#-------------------------------------------------------------------------
-#
-# Makefile
-#    Makefile for libpq++ library
-#
-# Copyright (c) 1994, Regents of the University of California
-#
-# IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/interfaces/libpq++/Attic/Makefile.in,v 1.27 2000/06/17 00:10:17 petere Exp $
-#
-#-------------------------------------------------------------------------
-
-NAME= pq++
-SO_MAJOR_VERSION= 3
-SO_MINOR_VERSION= 1
-
-SRCDIR= ../..
-include $(SRCDIR)/Makefile.global
-
-CXX=@CXX@
-CXXFLAGS=@CXXFLAGS@ @INCLUDES@
-
-SRCHEADERDIR = $(SRCDIR)/include
-LIBPQHEADERDIR = $(SRCHEADERDIR)/libpq
-
-CXXFLAGS+= -I$(SRCHEADERDIR) -I$(LIBPQDIR)
-
-OBJS = pgconnection.o pgdatabase.o pgtransdb.o pgcursordb.o pglobject.o 
-
-ifeq ($(PORTNAME), win)
-SHLIB_LINK+= --driver-name g++ $(LIBPQ)
-else
-SHLIB_LINK= $(LIBPQ)
-endif
-
-# For CC on IRIX, must use CC as linker/archiver of C++ libraries
-ifeq ($(PORTNAME), irix5)
-  ifeq ($(CXX), CC)
-    AR = CC
-    AROPT = -ar -o
-    LD = CC
-  endif
-endif
-
-# Shared library stuff, also default 'all' target
-include $(SRCDIR)/Makefile.shlib
-
-
-# Pull shared-lib CFLAGS into CXXFLAGS
-CXXFLAGS+= $(CFLAGS_SL)
-
-
-.PHONY: examples
-examples:
-	$(MAKE) -C examples all
-
-.PHONY: install beforeinstall-headers install-headers 
-
-install: install-headers install-lib $(install-shlib-dep)
-
-LIBPGXXDIR = libpq++
-LIBPGXXHEADERDIR = $(HEADERDIR)/$(LIBPGXXDIR)
-MAINHEADER = libpq++.h
-LIBPGXXHEADERS = pgconnection.h \
-		 pgdatabase.h \
-		 pgtransdb.h \
-		 pgcursordb.h \
-		 pglobject.h
-
-install-headers: beforeinstall-headers $(MAINHEADER)
-	@$(INSTALL) $(INSTLOPTS) $(MAINHEADER) $(HEADERDIR)/$(MAINHEADER)
-	@for i in ${LIBPGXXHEADERS}; do \
-		echo "Installing $(LIBPGXXHEADERDIR)/$$i."; \
-		$(INSTALL) $(INSTLOPTS) $$i $(LIBPGXXHEADERDIR)/$$i; \
-	done
-
-beforeinstall-headers:
-	-@if [ ! -d $(HEADERDIR) ]; then mkdir $(HEADERDIR); fi
-	-@if [ ! -d $(LIBPGXXHEADERDIR) ]; then mkdir $(LIBPGXXHEADERDIR); fi
-
-.PHONY: clean
-
-clean: clean-shlib
-	rm -f libpq++.a $(OBJS)
-	$(MAKE) -C examples clean
-
-dep depend:
-	$(CXX) -MM $(CXXFLAGS) *.cc >depend
-
-ifeq (depend,$(wildcard depend))
-include depend
-endif

src/interfaces/libpq/Makefile

+#-------------------------------------------------------------------------
+#
+# Makefile for src/interfaces/libpq library
+#
+# Copyright (c) 1994, Regents of the University of California
+#
+# $Header: /cvsroot/pgsql/src/interfaces/libpq/Makefile,v 1.39 2000/06/28 18:29:44 petere Exp $
+#
+#-------------------------------------------------------------------------
+
+subdir = src/interfaces/libpq
+top_builddir = ../../..
+include ../../Makefile.global
+
+# shared library parameters
+NAME= pq
+SO_MAJOR_VERSION= 2
+SO_MINOR_VERSION= 1
+
+CFLAGS+= -DFRONTEND -I$(srcdir)
+
+OBJS= fe-auth.o fe-connect.o fe-exec.o fe-misc.o fe-print.o fe-lobj.o \
+      pqexpbuffer.o dllist.o pqsignal.o $(SNPRINTF) $(INET_ATON)
+
+ifdef MULTIBYTE
+OBJS+= common.o wchar.o conv.o big5.o
+endif
+
+# If crypt is a separate library, rather than part of libc,
+# make sure it gets included in shared libpq.
+SHLIB_LINK+= $(findstring -lcrypt, $(LIBS))
+
+# Include kerberos libraries into libpq
+SHLIB_LINK += $(KRB_LIBS)
+
+all: all-lib
+
+# Shared library stuff
+include $(top_srcdir)/src/Makefile.shlib
+
+
+# We use several backend modules verbatim, but since we need to
+# compile with appropriate options to build a shared lib, we can't
+# necessarily use the same object files as the backend uses. Instead,
+# symlink the source files in here and build our own object file.
+
+backend_src = $(top_srcdir)/src/backend
+
+dllist.c: $(backend_src)/lib/dllist.c
+	rm -f $@ && $(LN_S) $< .
+
+# this only gets done if configure finds system doesn't have snprintf()
+snprintf.c: $(backend_src)/port/snprintf.c
+	rm -f $@ && $(LN_S) $< .
+
+# this only gets done if configure finds system doesn't have inet_aton()
+inet_aton.c: $(backend_src)/port/inet_aton.c
+	rm -f $@ && $(LN_S) $< .
+
+ifdef MULTIBYTE
+common.c wchar.c conv.c big5.c: % : $(backend_src)/utils/mb/%
+	rm -f $@ && $(LN_S) $< .
+endif
+
+
+install: all installdirs install-headers install-lib
+
+.PHONY: install-headers
+install-headers: libpq-fe.h libpq-int.h pqexpbuffer.h
+	$(INSTALL_DATA) $(srcdir)/libpq-fe.h $(includedir)
+	$(INSTALL_DATA) $(srcdir)/libpq-int.h $(includedir)
+	$(INSTALL_DATA) $(srcdir)/pqexpbuffer.h $(includedir)
+
+installdirs:
+	$(mkinstalldirs) $(libdir) $(includedir)
+
+uninstall: uninstall-lib
+	rm -f $(addprefix $(includedir)/, libpq-fe.h libpq-int.h pqexpbuffer.h)
+
+clean distclean maintainer-clean: clean-lib
+	rm -f $(OBJS) dllist.c snprintf.c inet_aton.c common.c wchar.c conv.c big5.c
+
+depend dep:
+	$(CC) -MM $(CFLAGS) *.c >depend
+
+ifeq (depend,$(wildcard depend))
+include depend
+endif

src/interfaces/libpq/Makefile.in

-#-------------------------------------------------------------------------
-#
-# Makefile
-#    Makefile for libpq library
-#
-# Copyright (c) 1994, Regents of the University of California
-#
-# IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/interfaces/libpq/Attic/Makefile.in,v 1.60 2000/06/17 00:10:09 petere Exp $
-#
-#-------------------------------------------------------------------------
-
-NAME= pq
-SO_MAJOR_VERSION= 2
-SO_MINOR_VERSION= 1
-
-SRCDIR= ../..
-include $(SRCDIR)/Makefile.global
-
-CFLAGS+= -DFRONTEND
-
-OBJS= fe-auth.o fe-connect.o fe-exec.o fe-misc.o fe-print.o fe-lobj.o \
-      pqexpbuffer.o dllist.o pqsignal.o @SNPRINTF@ @INET_ATON@
-
-ifdef MULTIBYTE
-OBJS+= common.o wchar.o conv.o big5.o
-endif
-
-# If crypt is a separate library, rather than part of libc,
-# make sure it gets included in shared libpq.
-SHLIB_LINK+= $(findstring -lcrypt,$(LIBS))
-
-# Include kerberos libraries into libpq
-SHLIB_LINK += $(KRB_LIBS)
-
-
-# Shared library stuff, also default 'all' target
-include $(SRCDIR)/Makefile.shlib
-
-
-# We use several backend modules verbatim, but since we need to compile
-# with appropriate options to build a shared lib, we can't necessarily
-# use the same object files as the backend uses.  Instead, symlink the
-# source files in here and build our own object file.
-
-dllist.c:	$(SRCDIR)/backend/lib/dllist.c
-	-$(LN_S) $(SRCDIR)/backend/lib/dllist.c .
-
-# this only gets done if configure finds system doesn't have snprintf()
-snprintf.c:	$(SRCDIR)/backend/port/snprintf.c
-	-$(LN_S) $(SRCDIR)/backend/port/snprintf.c .
-
-# this only gets done if configure finds system doesn't have inet_aton()
-inet_aton.c:	$(SRCDIR)/backend/port/inet_aton.c
-	-$(LN_S) $(SRCDIR)/backend/port/inet_aton.c .
-
-ifdef MULTIBYTE
-common.c: $(SRCDIR)/backend/utils/mb/common.c
-	-$(LN_S) $(SRCDIR)/backend/utils/mb/common.c .
-
-wchar.c: $(SRCDIR)/backend/utils/mb/wchar.c
-	-$(LN_S) $(SRCDIR)/backend/utils/mb/wchar.c .
-
-conv.c: $(SRCDIR)/backend/utils/mb/conv.c
-	-$(LN_S) $(SRCDIR)/backend/utils/mb/conv.c .
-
-big5.c: $(SRCDIR)/backend/utils/mb/big5.c
-	-$(LN_S) $(SRCDIR)/backend/utils/mb/big5.c .
-endif
-
-
-.PHONY: install install-headers
-
-install: install-headers install-lib $(install-shlib-dep)
-
-install-headers: libpq-fe.h libpq-int.h
-	-@if [ ! -d $(HEADERDIR) ]; then mkdir $(HEADERDIR); fi
-	$(INSTALL) $(INSTLOPTS) libpq-fe.h $(HEADERDIR)/libpq-fe.h
-	$(INSTALL) $(INSTLOPTS) libpq-int.h $(HEADERDIR)/libpq-int.h
-	$(INSTALL) $(INSTLOPTS) pqexpbuffer.h $(HEADERDIR)/pqexpbuffer.h
-
-
-.PHONY: clean
-
-clean: clean-shlib
-	rm -f lib$(NAME).a $(OBJS)
-	rm -f dllist.c snprintf.c inet_aton.c common.c wchar.c conv.c big5.c
-
-depend dep:
-	$(CC) -MM $(CFLAGS) *.c >depend
-
-ifeq (depend,$(wildcard depend))
-include depend
-endif

src/interfaces/odbc/GNUmakefile

+#-------------------------------------------------------------------------
+#
+# GNUMakefile for psqlodbc (Postgres ODBC driver)
+#
+# $Header: /cvsroot/pgsql/src/interfaces/odbc/Attic/GNUmakefile,v 1.1 2000/06/28 18:29:54 petere Exp $
+#
+#-------------------------------------------------------------------------
+
+subdir = src/interfaces/odbc
+top_builddir = ../../..
+include ../../Makefile.global
+
+# Shared library parameters
+NAME = psqlodbc
+SO_MAJOR_VERSION = 0
+SO_MINOR_VERSION = 26
+
+CFLAGS += -I$(srcdir) -DHAVE_CONFIG_H -DODBCINSTDIR='"$(odbcinst_ini_dir)"'
+
+
+OBJS = info.o bind.o columninfo.o connection.o convert.o drvconn.o \
+        environ.o execute.o lobj.o misc.o options.o \
+        pgtypes.o psqlodbc.o qresult.o results.o socket.o parse.o statement.o \
+        gpps.o tuple.o tuplelist.o dlg_specific.o $(OBJX)
+
+SHLIB_LINK= $(LD_FLAGS)
+
+all: all-lib
+
+# Shared library stuff
+include $(top_srcdir)/src/Makefile.shlib
+
+LDFLAGS_SL+= $(LDFLAGS_ODBC)
+
+odbc_headers = isql.h isqlext.h iodbc.h
+odbc_includedir = $(includedir)/iodbc
+
+install: all installdirs install-headers install-ini install-lib
+
+installdirs:
+	$(mkinstalldirs) $(odbc_includedir) $(libdir) $(odbcinst_ini_dir)
+
+.PHONY: install-headers
+install-headers: $(odbc_headers)
+	for i in $^; do $(INSTALL_DATA) $$i $(odbc_includedir) || exit 1; done
+
+.PHONY: install-ini
+install-ini: odbcinst.ini
+	$(INSTALL_DATA) $< $(odbcinst_ini_dir)
+
+uninstall: uninstall-lib
+	rm -f $(addprefix $(odbc_includedir)/, $(odbc_headers))
+
+clean distclean maintainer-clean: clean-lib
+	rm -f $(OBJS)
+
+depend dep:
+	$(CC) -MM $(CFLAGS) *.c >depend
+
+ifeq (depend,$(wildcard depend))
+include depend
+endif

src/interfaces/odbc/GNUmakefile.in

-#-------------------------------------------------------------------------
-#
-# GNUMakefile.in for psqlodbc (Postgres ODBC driver).
-#
-# $Header: /cvsroot/pgsql/src/interfaces/odbc/Attic/GNUmakefile.in,v 1.17 2000/06/20 16:39:57 petere Exp $
-#
-#-------------------------------------------------------------------------
-
-srcdir = @srcdir@
-VPATH = @srcdir@
-top_srcdir = @top_srcdir@
-top_builddir = ../../..
-subdir = src/interfaces/odbc
-
-mkinstalldirs = @mkinstalldirs@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-
-prefix = @prefix@
-datadir = @datadir@
-odbcinst_ini_dir = @odbcinst_ini_dir@
-includedir = @includedir@
-
-# Shared library parameters
-NAME = psqlodbc
-SO_MAJOR_VERSION = 0
-SO_MINOR_VERSION = 26
-
-
-SRCDIR= $(top_srcdir)/src
-include $(SRCDIR)/Makefile.global
-
-CFLAGS += -I. @DEFS@ -DODBCINSTDIR='"$(odbcinst_ini_dir)"'
-
-
-OBJS = info.o bind.o columninfo.o connection.o convert.o drvconn.o \
-        environ.o execute.o lobj.o misc.o options.o \
-        pgtypes.o psqlodbc.o qresult.o results.o socket.o parse.o statement.o \
-        gpps.o tuple.o tuplelist.o dlg_specific.o
-
-
-# Shared library stuff, also default 'all' target
-include $(SRCDIR)/Makefile.shlib
-
-install: all installdirs install-headers install-ini install-lib $(install-shlib-dep)
-
-installdirs:
-	$(mkinstalldirs) $(includedir)/iodbc $(LIBDIR) $(odbcinst_ini_dir)
-
-install-headers: isql.h isqlext.h iodbc.h
-	$(INSTALL_DATA) $^ $(includedir)/iodbc/
-
-install-ini: odbcinst.ini
-	$(INSTALL_DATA) odbcinst.ini $(odbcinst_ini_dir)
-
-clean: clean-shlib
-	rm -f lib$(NAME).a $(OBJS)
-
-distclean maintainer-clean: clean
-	rm -f GNUmakefile
-
-
-depend dep:
-	$(CC) -MM $(CFLAGS) *.c >depend
-
-ifeq (depend,$(wildcard depend))
-include depend
-endif
-
-.PHONY: all install installdirs install-headers install-lib install-ini clean distclean maintainer-clean
-
-
-GNUmakefile: GNUmakefile.in $(top_builddir)/config.status
-	cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status
-
-$(top_builddir)/config.status: $(top_srcdir)/configure
-	cd $(top_builddir) && ./config.status --recheck

src/interfaces/perl5/GNUmakefile

+# This file is an interface from the Autoconf world to Perl's
+# MakeMaker world, so that the latter behaves (kind of) like the
+# former would prefer. Internally, we call Perl to create another
+# Makefile according to its own ideas and then invoke the rules from
+# that file.
+#
+# $Header: /cvsroot/pgsql/src/interfaces/perl5/Attic/GNUmakefile,v 1.1 2000/06/28 18:29:56 petere Exp $
+
+subdir = src/interfaces/perl5
+top_builddir = ../../..
+include ../../Makefile.global
+
+
+all: Makefile libpq-all
+	$(MAKE) -f $< all
+
+Makefile: Makefile.PL
+	$(PERL) $< POLLUTE=1
+
+.PHONY: libpq-all
+libpq-all:
+	$(MAKE) -C $(top_builddir)/src/interfaces/libpq all
+
+# The klugery here is to ensure that the perl5 shared library gets
+# built with the correct path to the installed location of libpq
+# during `make install', but is built against the local tree during
+# ordinary building and testing.
+#
+# During install, we must also guard against the likelihood that we
+# don't have permissions to install into the Perl module library. The
+# purer alternative would naturally be the ability to select the
+# installation directory somewhere.
+
+install: Makefile
+	$(MAKE) -f Makefile clean
+	POSTGRES_LIB="$(libdir)" \
+	  POSTGRES_INCLUDE="$(includedir)" \
+	  $(PERL) $(srcdir)/Makefile.PL POLLUTE=1
+	$(MAKE) -f Makefile all
+	-@if [ -w "`$(MAKE) --quiet -f Makefile echo-installdir`" ]; then \
+		$(MAKE) -f Makefile install; \
+		rm -f Makefile; \
+	else \
+		echo "*****" ;\
+		echo "* Skipping the installation of the Perl module for lack of permissions."; \
+		echo "* To install it, change to the directory "`pwd`","; \
+		echo "* become the appropriate user, and do \`$(MAKE) install'."; \
+		echo "*****"; \
+	fi
+
+
+uninstall:
+	@echo "*****"; \
+	 echo "* The Perl module cannot be uninstalled automatically. You can"; \
+	 echo "* change into the directory "`pwd`" and do"; \
+	 echo "*"; \
+	 echo "*     $(MAKE) -f Makefile realclean"; \
+	 echo "*"; \
+	 echo "* to delete built and installed files."; \
+	 echo "*****"
+
+clean distclean maintainer-clean:
+	-[ -f Makefile ] && $(MAKE) -f Makefile clean
+	rm -f Makefile Makefile.old

src/interfaces/perl5/GNUmakefile.in

-# This file is an interface from the Autoconf world to Perl's
-# MakeMaker world, so that the latter behaves (kind of) like the
-# former would prefer. Internally, we call Perl to create another
-# Makefile according to it's own ideas and then invoke the rules from
-# that file.
-#
-# $Header: /cvsroot/pgsql/src/interfaces/perl5/Attic/GNUmakefile.in,v 1.1 2000/06/10 18:01:56 petere Exp $
-
-srcdir = @srcdir@
-VPATH = @srcdir@
-
-top_srcdir = @top_srcdir@
-top_builddir = ../../..
-
-PERL = @PERL@
-
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-libdir = @libdir@
-includedir = @includedir@
-
-
-all: Makefile libpq-all
-	$(MAKE) -f $< all
-
-Makefile: Makefile.PL
-	$(PERL) $< POLLUTE=1
-
-libpq-all:
-	$(MAKE) -C $(top_builddir)/src/interfaces/libpq all
-
-# The klugery here is to ensure that the perl5 shared library gets
-# built with the correct path to the installed location of libpq
-# during `make install', but is built against the local tree during
-# ordinary building and testing.
-#
-# During install, we must also guard against the likelihood that we
-# don't have permissions to install into the Perl module library. The
-# purer alternative would naturally be the ability to select the
-# installation directory somewhere.
-
-install: Makefile libpq-install
-	$(MAKE) -f Makefile clean
-	POSTGRES_LIB="$(libdir)" \
-	  POSTGRES_INCLUDE="$(includedir)" \
-	  $(PERL) $(srcdir)/Makefile.PL POLLUTE=1
-	$(MAKE) -f Makefile all
-	-@if [ -w "`$(MAKE) --quiet -f Makefile echo-installdir`" ]; then \
-		$(MAKE) -f Makefile install; \
-		rm -f Makefile; \
-	else \
-		echo "*****" ;\
-		echo "* Skipping the installation of the Perl module for lack of permissions."; \
-		echo "* To install it, change to the directory "`pwd`","; \
-		echo "* become the appropriate user, and do \`$(MAKE) install'."; \
-		echo "*****"; \
-	fi
-
-libpq-install:
-	$(MAKE) -C $(top_builddir)/src/interfaces/libpq install
-
-# Note: Perl's idea of "clean" is a little different, so we use "realclean"
-
-clean:
-	-[ -f Makefile ] && $(MAKE) -f Makefile realclean
-
-distclean maintainer-clean: clean
-	rm -f GNUmakefile
-
-
-.PHONY: all install clean distclean maintainer-clean libpq-all libpq-install

src/interfaces/python/GNUmakefile

+#-------------------------------------------------------------------
+#
+# GNUmakefile for src/interfaces/python, a.k.a. "PyGreSQL"
+#
+# Written by Peter Eisentraut  <peter_e@gmx.net>
+#
+# $Header: /cvsroot/pgsql/src/interfaces/python/Attic/GNUmakefile,v 1.1 2000/06/28 18:30:07 petere Exp $
+#
+#-------------------------------------------------------------------
+
+subdir = src/interfaces/python
+top_builddir = ../../..
+include ../../Makefile.global
+
+all: Makefile pgmodule.c libpq-all
+	$(MAKE) -f Makefile
+
+.PHONY: libpq-all
+libpq-all:
+	$(MAKE) -C $(top_builddir)/src/interfaces/libpq all
+
+Makefile: Setup.in Makefile.pre.in
+	$(MAKE) -f Makefile.pre.in boot srcdir=$(srcdir) VPATH=$(srcdir)
+
+Makefile.pre.in: $(python_extmakefile)
+	cp $< $@
+
+Setup.in: Setup.in.raw
+	sed -e "s%__LIBPQ__%${top_srcdir}/src/interfaces/libpq%g" \
+	    -e "s%__EXTRA_LIBS__%${LIBS}%g" \
+	    -e "s%__INCLUDES__%${top_srcdir}/src/include%g" \
+	    < $< > $@
+
+install: all
+	@echo "Installing Python module"
+	@if ! ( $(INSTALL_DATA) pg.py $(python_moduledir) && \
+	    $(MAKE) -f Makefile install ); then \
+		echo "*****" ;\
+		echo "* Skipping the installation of the Python interface module for lack"; \
+		echo "* of permissions. To install it, change to the directory"; \
+		echo "* "`pwd`", become the appropriate"; \
+		echo "* user, and do \`$(MAKE) install'."; \
+		echo "*****"; \
+	fi
+
+uninstall:
+	@echo "*****"; \
+	 echo "* Unfortunately, the Python interface module cannot be uninstalled"; \
+	 echo "* automatically. To do it yourself, look in or near the directory"; \
+	 echo "* \`$(python_moduledir)' for files \`pg.py' and \`_pgmodule$(DLSUFFIX)'."; \
+	 echo "*****"
+
+# Python sometimes has a different idea what exactly "clean" is.
+
+clean distclean maintainer-clean:
+	-[ -f Makefile ] && $(MAKE) -f Makefile clobber
+	rm -f Makefile.pre.in Makefile Setup Setup.in

src/interfaces/python/GNUmakefile.in

-#-------------------------------------------------------------------
-#
-# Makefile for src/interfaces/python, a.k.a. "PyGreSQL"
-#
-# Written by Peter Eisentraut  <peter_e@gmx.net>
-#
-# $Header: /cvsroot/pgsql/src/interfaces/python/Attic/GNUmakefile.in,v 1.1 2000/06/10 18:02:00 petere Exp $
-#
-#-------------------------------------------------------------------
-
-srcdir = @srcdir@
-VPATH = @srcdir@
-
-top_srcdir = @top_srcdir@
-top_builddir = ../../..
-
-
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-libdir = @libdir@
-includedir = @includedir@
-
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-
-LIBS = @LIBS@
-
-PYTHON = @PYTHON@
-python_extmakefile = @python_extmakefile@
-python_moduledir = @python_moduledir@
-
-
-all: Makefile pgmodule.c libpq-all
-	$(MAKE) -f Makefile
-
-libpq-all:
-	$(MAKE) -C $(top_builddir)/src/interfaces/libpq all
-
-Makefile: Setup.in Makefile.pre.in
-	$(MAKE) -f Makefile.pre.in boot srcdir=$(srcdir) VPATH=$(srcdir)
-
-Makefile.pre.in: $(python_extmakefile)
-	cp $< $@
-
-Setup.in: Setup.in.raw
-	sed -e "s%__LIBPQ__%${top_srcdir}/src/interfaces/libpq%g" \
-	    -e "s%__EXTRA_LIBS__%${LIBS}%g" \
-	    -e "s%__INCLUDES__%${top_srcdir}/src/include%g" \
-	    < $< > $@
-
-install: all
-	@echo "Installing Python module"
-	@if ! ( $(INSTALL_DATA) pg.py $(python_moduledir) && \
-	    $(MAKE) -f Makefile install ); then \
-		echo "*****" ;\
-		echo "* Skipping the installation of the Python interface module for lack"; \
-		echo "* of permissions. To install it, change to the directory"; \
-		echo "* "`pwd`", become the appropriate"; \
-		echo "* user, and do \`$(MAKE) install'."; \
-		echo "*****"; \
-	fi
-
-
-# Python sometimes has a different idea what exactly "clean" is.
-
-clean:
-	-[ -f Makefile ] && $(MAKE) -f Makefile clobber
-	rm -f Makefile.pre.in Makefile Setup Setup.in
-
-distclean maintainer-clean: clean
-	rm -f GNUmakefile
-
-
-.PHONY: all libpq-all install clean distclean maintainer-clean

src/pl/plperl/GNUmakefile

-# $Header: /cvsroot/pgsql/src/pl/plperl/GNUmakefile,v 1.1 2000/06/27 00:31:49 petere Exp $
+# $Header: /cvsroot/pgsql/src/pl/plperl/GNUmakefile,v 1.2 2000/06/28 18:30:12 petere Exp $
 
 subdir = src/pl/plperl
 top_builddir = ../../..
 	rm -f $(libdir)/plperl$(DLSUFFIX)
 
 clean distclean maintainer-clean:
-	-[ -f Makefile ] && $(MAKE) -f Makefile realclean
+	-[ -f Makefile ] && $(MAKE) -f Makefile clean
+	rm -f Makefile Makefile.old

src/pl/plpgsql/src/Makefile

 #
 # Makefile for the plpgsql shared object
 #
-# $Header: /cvsroot/pgsql/src/pl/plpgsql/src/Makefile,v 1.3 2000/06/27 00:32:01 petere Exp $
+# $Header: /cvsroot/pgsql/src/pl/plpgsql/src/Makefile,v 1.4 2000/06/28 18:30:16 petere Exp $
 #
 #-------------------------------------------------------------------------
 
 
 OBJS = pl_parse.o pl_handler.o pl_comp.o pl_exec.o pl_funcs.o
 
-# Shared library stuff, also default `all' target
+all: all-lib
+
+# Shared library stuff
 include $(top_srcdir)/src/Makefile.shlib
 
 
 	sed -e 's%__libdir__%$(libdir)%g' -e 's%__DLSUFFIX__%$(DLSUFFIX)%g' < $< > $@