From f7e86e03d956fb4d6ad7b340e125e5df6341162f Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Thu, 31 Aug 2000 16:12:35 +0000 Subject: [PATCH] Fix relative path references so that make knowns which dependencies refer to one another. Sort out builddir vs srcdir variable namings. Remove some now obsoleted make variables. --- GNUmakefile.in | 2 +- contrib/findoidjoins/Makefile | 4 +- contrib/mSQL-interface/Makefile | 4 +- contrib/odbc/Makefile | 6 +- contrib/pg_dumplo/Makefile | 6 +- contrib/pgbench/Makefile | 4 +- contrib/vacuumlo/Makefile | 4 +- doc/src/Makefile | 18 ++--- doc/src/sgml/Makefile | 17 ++--- src/Makefile.global.in | 91 ++++++----------------- src/backend/Makefile | 2 +- src/backend/access/Makefile | 2 +- src/backend/access/common/Makefile | 5 +- src/backend/access/gist/Makefile | 6 +- src/backend/access/hash/Makefile | 5 +- src/backend/access/heap/Makefile | 5 +- src/backend/access/index/Makefile | 6 +- src/backend/access/nbtree/Makefile | 5 +- src/backend/access/rtree/Makefile | 5 +- src/backend/access/transam/Makefile | 7 +- src/backend/catalog/Makefile | 2 +- src/backend/commands/Makefile | 6 +- src/backend/executor/Makefile | 6 +- src/backend/lib/Makefile | 6 +- src/backend/main/Makefile | 6 +- src/backend/nodes/Makefile | 5 +- src/backend/optimizer/Makefile | 2 +- src/backend/optimizer/geqo/Makefile | 14 +--- src/backend/optimizer/path/Makefile | 6 +- src/backend/optimizer/plan/Makefile | 8 +- src/backend/optimizer/prep/Makefile | 7 +- src/backend/optimizer/util/Makefile | 8 +- src/backend/port/Makefile.in | 7 +- src/backend/port/nextstep/Makefile | 10 ++- src/backend/port/qnx4/Makefile | 6 +- src/backend/port/sunos4/Makefile | 16 +--- src/backend/postmaster/Makefile | 6 +- src/backend/regex/Makefile | 10 +-- src/backend/rewrite/Makefile | 6 +- src/backend/storage/Makefile | 2 +- src/backend/storage/buffer/Makefile | 5 +- src/backend/storage/file/Makefile | 6 +- src/backend/storage/ipc/Makefile | 2 +- src/backend/storage/large_object/Makefile | 6 +- src/backend/storage/lmgr/Makefile | 6 +- src/backend/storage/page/Makefile | 6 +- src/backend/storage/smgr/Makefile | 6 +- src/backend/tcop/Makefile | 10 +-- src/backend/tioga/Makefile | 7 +- src/backend/utils/Makefile | 2 +- src/backend/utils/adt/Makefile | 5 +- src/backend/utils/cache/Makefile | 6 +- src/backend/utils/error/Makefile | 6 +- src/backend/utils/fmgr/Makefile | 6 +- src/backend/utils/hash/Makefile | 6 +- src/backend/utils/init/Makefile | 5 +- src/backend/utils/mb/Makefile | 6 +- src/backend/utils/mmgr/Makefile | 6 +- src/backend/utils/sort/Makefile | 6 +- src/backend/utils/time/Makefile | 6 +- src/bin/Makefile | 2 +- src/bin/initdb/Makefile | 4 +- src/bin/initlocation/Makefile | 2 +- src/bin/ipcclean/Makefile | 2 +- src/bin/pg_ctl/Makefile | 2 +- src/bin/pg_dump/Makefile | 14 ++-- src/bin/pg_encoding/Makefile | 6 +- src/bin/pg_id/Makefile | 2 +- src/bin/pg_passwd/Makefile | 6 +- src/bin/pgaccess/Makefile | 2 +- src/bin/pgtclsh/Makefile | 14 ++-- src/bin/psql/Makefile | 10 +-- src/bin/scripts/Makefile | 2 +- src/include/Makefile | 2 +- src/interfaces/Makefile | 2 +- src/interfaces/ecpg/Makefile | 2 +- src/interfaces/ecpg/include/Makefile | 2 +- src/interfaces/ecpg/lib/Makefile | 6 +- src/interfaces/ecpg/preproc/Makefile | 4 +- src/interfaces/libpgeasy/Makefile | 6 +- src/interfaces/libpgtcl/Makefile | 4 +- src/interfaces/libpq++/Makefile | 8 +- src/interfaces/libpq/Makefile | 2 +- src/interfaces/odbc/GNUmakefile | 4 +- src/interfaces/perl5/GNUmakefile | 4 +- src/interfaces/python/GNUmakefile | 13 ++-- src/interfaces/python/Setup.in.raw | 2 +- src/makefiles/Makefile.aix | 8 +- src/makefiles/Makefile.hpux | 4 +- src/makefiles/Makefile.win | 4 +- src/pl/Makefile | 2 +- src/pl/plperl/GNUmakefile | 2 +- src/pl/plpgsql/Makefile | 2 +- src/pl/tcl/Makefile | 2 +- src/test/bench/Makefile | 7 +- src/test/examples/Makefile | 9 ++- src/test/locale/Makefile | 13 ++-- src/test/regress/GNUmakefile | 4 +- src/test/regress/input/Makefile | 7 +- src/test/regress/output/Makefile | 8 +- src/tutorial/Makefile | 5 +- src/utils/Makefile | 2 +- 102 files changed, 298 insertions(+), 367 deletions(-) diff --git a/GNUmakefile.in b/GNUmakefile.in index cffcb1bff5..77aa70b2c0 100644 --- a/GNUmakefile.in +++ b/GNUmakefile.in @@ -6,7 +6,7 @@ subdir = top_builddir = . -include src/Makefile.global +include $(top_builddir)/src/Makefile.global all: $(MAKE) -C doc all diff --git a/contrib/findoidjoins/Makefile b/contrib/findoidjoins/Makefile index 9e7d42b177..3b40c83eb8 100644 --- a/contrib/findoidjoins/Makefile +++ b/contrib/findoidjoins/Makefile @@ -6,8 +6,8 @@ subdir = contrib/findoidjoins top_builddir = ../.. include ../../src/Makefile.global -CFLAGS += -I$(LIBPGEASYDIR) -I$(LIBPQDIR) -LIBS += $(LIBPGEASY) +CFLAGS += -I$(libpgeasy_srcdir) -I$(libpq_srcdir) +LIBS += $(libpgeasy) all: findoidjoins diff --git a/contrib/mSQL-interface/Makefile b/contrib/mSQL-interface/Makefile index 4dfbd29400..358d293b98 100644 --- a/contrib/mSQL-interface/Makefile +++ b/contrib/mSQL-interface/Makefile @@ -4,14 +4,14 @@ subdir = contrib/mSQL-interface top_builddir = ../.. -include ../../src/Makefile.global +include $(top_builddir)/src/Makefile.global NAME := mpgsql SO_MAJOR_VERSION := 0 SO_MINOR_VERSION := 0 OBJS := mpgsql.o -CFLAGS += -I$(LIBPQDIR) +CFLAGS += -I$(libpq_srcdir) include $(top_srcdir)/src/Makefile.shlib diff --git a/contrib/odbc/Makefile b/contrib/odbc/Makefile index b9922c486a..e81f51f215 100644 --- a/contrib/odbc/Makefile +++ b/contrib/odbc/Makefile @@ -1,9 +1,9 @@ # ODBC extensions # Thomas Lockhart 2000-04-03 -SRCDIR= ../../src - -include $(SRCDIR)/Makefile.global +subdir = contrib/odbc +top_builddir = ../.. +include $(top_builddir)/src/Makefile.global ifndef PGLIB PGLIB= . diff --git a/contrib/pg_dumplo/Makefile b/contrib/pg_dumplo/Makefile index a44424ddc8..fa7a4559ae 100644 --- a/contrib/pg_dumplo/Makefile +++ b/contrib/pg_dumplo/Makefile @@ -7,12 +7,12 @@ top_builddir = ../.. include ../../src/Makefile.global OBJS = main.o lo_export.o lo_import.o utils.o -CFLAGS += -I$(LIBPQDIR) +CFLAGS += -I$(libpq_srcdir) all: pg_dumplo -pg_dumplo: $(OBJS) $(LIBPQDIR)/libpq.a - $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBPQ) +pg_dumplo: $(OBJS) $(libpq_builddir)/libpq.a + $(CC) $(CFLAGS) -o $@ $(OBJS) $(libpq) install: all installdirs $(INSTALL_PROGRAM) pg_dumplo$(X) $(bindir) diff --git a/contrib/pgbench/Makefile b/contrib/pgbench/Makefile index f2660734c1..d7a7259a0c 100644 --- a/contrib/pgbench/Makefile +++ b/contrib/pgbench/Makefile @@ -6,8 +6,8 @@ subdir = contrib/pgbench top_builddir = ../.. include ../../src/Makefile.global -CFLAGS += -I$(LIBPQDIR) -LIBS += $(LIBPQ) +CFLAGS += -I$(libpq_srcdir) +LIBS += $(libpq) all: pgbench diff --git a/contrib/vacuumlo/Makefile b/contrib/vacuumlo/Makefile index 1c7c2d41dc..137bd36614 100644 --- a/contrib/vacuumlo/Makefile +++ b/contrib/vacuumlo/Makefile @@ -6,8 +6,8 @@ subdir = contrib/vacuumlo top_builddir = ../.. include ../../src/Makefile.global -CPPFLAGS += -I$(LIBPQDIR) -LIBS += $(LIBPQ) +CPPFLAGS += -I$(libpq_srcdir) +LIBS += $(libpq) all: vacuumlo diff --git a/doc/src/Makefile b/doc/src/Makefile index 38471a1193..00d3569512 100644 --- a/doc/src/Makefile +++ b/doc/src/Makefile @@ -1,21 +1,14 @@ # Postgres documentation makefile -# Thomas Lockhart +# $Header$ -# Not yet generated from configure, so use relative path names for now... -PGDOCS= .. -SRCDIR= ../../src +subdir = doc/src +top_builddir = ../.. +-include $(top_builddir)/src/Makefile.global TAR= tar ZIP= gzip TAREXCLUDE= --exclude=Makefile --exclude='*.sgml' --exclude=ref -# Pick up Makefile.global from the source area -# This is the only resource from the code source area and is optional - -ifneq ($(wildcard $(SRCDIR)/Makefile.global), ) -include $(SRCDIR)/Makefile.global -endif - SRC= admin postgres programmer tutorial user TARGETS= $(SRC:%=%.tar.gz) @@ -80,5 +73,4 @@ man.tar: # Compressed file %.gz: % - ($(ZIP) -f $<) - + $(GZIP) -f $< diff --git a/doc/src/sgml/Makefile b/doc/src/sgml/Makefile index 1b929e77f8..45b18d7834 100644 --- a/doc/src/sgml/Makefile +++ b/doc/src/sgml/Makefile @@ -12,8 +12,13 @@ # #---------------------------------------------------------------------------- -PGDOCS= ../.. -SRCDIR= ../../../src +# Pick up Makefile.global from the source area +# This is the only resource from the code source area and is optional. +# Actually, we want this to get Makefile.custom - thomas 1998-03-01 +subdir = doc/src/sgml +top_builddir = ../../.. +-include $(top_builddir)/src/Makefile.global + # This is where the default stylesheets appear on my linux system. # Probably no need to change this; rather, put definitions @@ -46,14 +51,6 @@ D2MSCRIPT= $(D2MDIR)/docbook2man-spec.pl TAR= tar -# Pick up Makefile.global from the source area -# This is the only resource from the code source area and is optional. -# Actually, we want this to get Makefile.custom - thomas 1998-03-01 - -ifneq ($(wildcard $(SRCDIR)/Makefile.global),) - include $(SRCDIR)/Makefile.global -endif - # Hmm, made this optional but jade _really_ doesn't like them missing # - thomas 1998-03-01 ifneq ($(HDSL), ) diff --git a/src/Makefile.global.in b/src/Makefile.global.in index f6cfe82ef6..2ef171ff53 100644 --- a/src/Makefile.global.in +++ b/src/Makefile.global.in @@ -1,51 +1,20 @@ -#---------------------------------------------------------------------------- -# -# Makefile.global-- -# global configuration for the Makefiles -# -# Copyright (c) 1994, Regents of the University of California -# -# -# IDENTIFICATION -# $Header$ -# -# NOTES -# Essentially all Postgres make files include this file and use the -# variables it sets. -# -# To override the default setting, create a Makefile.custom in this -# directory and put your defines there. (Makefile.custom is included -# near the end of this file). Sometimes, a variable gets set in -# Makefile.global after Makefile.custom has been included, so you can't -# simply set that variable in Makefile.custom. In those cases, there is -# often another variable (like CUSTOM_COPT) that you can set in -# Makefile.custom that influences the later setting of the true variable -# of interest (like CFLAGS) by Makefile.global. -# -# -# If you change any of these defines you probably have to -# make clean; make -# since no dependencies are created for these. (of course you can -# be crafty and check what files really depend on them and just remake -# those). -# -# Before including this file, you must set the SRCDIR variable to the -# path of the top of the Postgres source tree (the directory that -# contains this file). +# $Header$ + +#------------------------------------------------------------------------------ +# All PostgreSQL makefiles include this file and use the variables it sets, +# which in turn are put here by the configure script. There is no need for +# users to edit this file -- if it turns out to be necessary then that's a +# bug. # -#------------------------------------------------------------------------- +# A makefile that includes this file needs to set the variable `subdir' to +# the relative path from the top to itself and `top_builddir' to the relative +# path from itself to the top before including this file. (The "top" is the +# parent directory of the directory this file is in.) +#------------------------------------------------------------------------------ # PostgreSQL version number VERSION = @VERSION@ -ifndef top_builddir -top_builddir = $(SRCDIR)/.. -endif - -ifndef SRCDIR -SRCDIR = $(top_builddir)/src -endif - # This should be changed once we have separate build dirs. top_srcdir = $(top_builddir) @@ -73,13 +42,14 @@ BSD_SHLIB= true # systems now. May be applicable to other systems to? ELF_SYSTEM= @ELF_SYS@ -LIBPQDIR= $(SRCDIR)/interfaces/libpq -LIBPGEASYDIR= $(SRCDIR)/interfaces/libpgeasy -LIBPGTCLDIR= $(SRCDIR)/interfaces/libpgtcl +libpq_srcdir = $(top_srcdir)/src/interfaces/libpq +libpq_builddir = $(top_builddir)/src/interfaces/libpq +libpq = -L$(libpq_builddir) -lpq + +libpgeasy_srcdir = $(top_srcdir)/src/interfaces/libpgeasy +libpgeasy_builddir = $(top_builddir/src/interfaces/libpgeasy +libpgeasy = -L$(libpgeasy_builddir) -lpgeasy -LIBPQ= -L$(LIBPQDIR) -lpq -LIBPGTCL= -L$(LIBPGTCLDIR) -lpgtcl -LIBPGEASY= -L$(LIBPGEASYDIR) -lpgeasy # installation directories @@ -99,16 +69,6 @@ docdir = @docdir@ odbcinst_ini_dir = @odbcinst_ini_dir@ -# old variable names for installation directories - -POSTGRESDIR= $(prefix) -BINDIR= $(bindir) -LIBDIR= $(libdir) -TEMPLATEDIR= $(libdir) -POSTMANDIR= $(mandir) -POSTDOCDIR= $(docdir) -HEADERDIR= $(includedir) - ############################################################################## # @@ -117,10 +77,6 @@ HEADERDIR= $(includedir) # To disable a feature, comment out the entire definition # (that is, prepend '#', don't set it to "0" or "no"). -# Comment out ENFORCE_ALIGNMENT if you do NOT want unaligned access to -# multi-byte types to generate a bus error. -ENFORCE_ALIGNMENT= true - # Comment out PROFILE to generate a profile version of the binaries #PROFILE= -p -non_shared @@ -156,7 +112,6 @@ MULTIBYTE=@MULTIBYTE@ # # Installation. # -# For many ports, INSTALL is overridden below. INSTALL= @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -180,7 +135,7 @@ FLEX = @FLEX@ FLEXFLAGS = @FLEXFLAGS@ $(LFLAGS) AROPT= @AROPT@ CPPFLAGS = @CPPFLAGS@ -CFLAGS = -I$(SRCDIR)/include $(CPPFLAGS) @CFLAGS@ +CFLAGS = -I$(top_srcdir)/src/include $(CPPFLAGS) @CFLAGS@ CFLAGS_SL= @SHARED_LIB@ LIBS= @LIBS@ LDFLAGS= @LDFLAGS@ $(LIBS) @@ -210,7 +165,7 @@ CPU= @CPU@ HAVE_POSIX_SIGNALS= @HAVE_POSIX_SIGNALS@ HPUXMATHLIB= @HPUXMATHLIB@ -include $(SRCDIR)/Makefile.port +include $(top_builddir)/src/Makefile.port ############################################################################## # @@ -219,9 +174,7 @@ include $(SRCDIR)/Makefile.port # This includes your local customizations if Makefile.custom exists # in the source directory. This file doesn't exist in the original # distribution so that it doesn't get overwritten when you upgrade. -ifneq ($(wildcard $(SRCDIR)/Makefile.custom), ) -include $(SRCDIR)/Makefile.custom -endif +-include $(top_srcdir)/src/Makefile.custom # This goes here so that customization in Makefile.custom is effective ############################################################################## diff --git a/src/backend/Makefile b/src/backend/Makefile index a44d3ad385..9021d84476 100644 --- a/src/backend/Makefile +++ b/src/backend/Makefile @@ -10,7 +10,7 @@ subdir = src/backend top_builddir = ../.. -include ../Makefile.global +include $(top_builddir)/src/Makefile.global DIRS := access bootstrap catalog parser commands executor lib libpq \ main nodes optimizer port postmaster regex rewrite \ diff --git a/src/backend/access/Makefile b/src/backend/access/Makefile index a339f81139..2a2fd52211 100644 --- a/src/backend/access/Makefile +++ b/src/backend/access/Makefile @@ -6,7 +6,7 @@ subdir = src/backend/access top_builddir = ../../.. -include ../../Makefile.global +include $(top_builddir)/src/Makefile.global SUBDIRS := common gist hash heap index nbtree rtree transam SUBDIROBJS := $(SUBDIRS:%=%/SUBSYS.o) diff --git a/src/backend/access/common/Makefile b/src/backend/access/common/Makefile index bdebf29dc5..5f02a34628 100644 --- a/src/backend/access/common/Makefile +++ b/src/backend/access/common/Makefile @@ -8,8 +8,9 @@ # #------------------------------------------------------------------------- -SRCDIR = ../../.. -include ../../../Makefile.global +subdir = src/backend/access/common +top_builddir = ../../../.. +include $(top_builddir)/src/Makefile.global OBJS = heaptuple.o indextuple.o indexvalid.o printtup.o \ scankey.o tupdesc.o diff --git a/src/backend/access/gist/Makefile b/src/backend/access/gist/Makefile index 16cc0a80e1..bee0c00daf 100644 --- a/src/backend/access/gist/Makefile +++ b/src/backend/access/gist/Makefile @@ -8,8 +8,9 @@ # #------------------------------------------------------------------------- -SRCDIR = ../../.. -include ../../../Makefile.global +subdir = src/backend/access/gist +top_builddir = ../../../.. +include $(top_builddir)/src/Makefile.global OBJS = gist.o gistget.o gistscan.o giststrat.o @@ -27,4 +28,3 @@ clean: ifeq (depend,$(wildcard depend)) include depend endif - diff --git a/src/backend/access/hash/Makefile b/src/backend/access/hash/Makefile index 07e5777133..de68d15c0f 100644 --- a/src/backend/access/hash/Makefile +++ b/src/backend/access/hash/Makefile @@ -8,8 +8,9 @@ # #------------------------------------------------------------------------- -SRCDIR = ../../.. -include ../../../Makefile.global +subdir = src/backend/access/hash +top_builddir = ../../../.. +include $(top_builddir)/src/Makefile.global OBJS = hash.o hashfunc.o hashinsert.o hashovfl.o hashpage.o hashscan.o \ hashsearch.o hashstrat.o hashutil.o diff --git a/src/backend/access/heap/Makefile b/src/backend/access/heap/Makefile index 2824d22b0f..7cf4f058c6 100644 --- a/src/backend/access/heap/Makefile +++ b/src/backend/access/heap/Makefile @@ -8,8 +8,9 @@ # #------------------------------------------------------------------------- -SRCDIR = ../../.. -include ../../../Makefile.global +subdir = src/backend/access/heap +top_builddir = ../../../.. +include $(top_builddir)/src/Makefile.global OBJS = heapam.o hio.o stats.o tuptoaster.o diff --git a/src/backend/access/index/Makefile b/src/backend/access/index/Makefile index 625de982bb..6bf3ecb788 100644 --- a/src/backend/access/index/Makefile +++ b/src/backend/access/index/Makefile @@ -8,8 +8,9 @@ # #------------------------------------------------------------------------- -SRCDIR = ../../.. -include ../../../Makefile.global +subdir = src/backend/access/index +top_builddir = ../../../.. +include $(top_builddir)/src/Makefile.global OBJS = genam.o indexam.o istrat.o @@ -27,4 +28,3 @@ clean: ifeq (depend,$(wildcard depend)) include depend endif - diff --git a/src/backend/access/nbtree/Makefile b/src/backend/access/nbtree/Makefile index ce4fc2b402..4440ff0c21 100644 --- a/src/backend/access/nbtree/Makefile +++ b/src/backend/access/nbtree/Makefile @@ -8,8 +8,9 @@ # #------------------------------------------------------------------------- -SRCDIR = ../../.. -include ../../../Makefile.global +subdir = src/backend/access/nbtree +top_builddir = ../../../.. +include $(top_builddir)/src/Makefile.global OBJS = nbtcompare.o nbtinsert.o nbtpage.o nbtree.o nbtscan.o nbtsearch.o \ nbtstrat.o nbtutils.o nbtsort.o diff --git a/src/backend/access/rtree/Makefile b/src/backend/access/rtree/Makefile index d40c682fc9..5dd31afe6f 100644 --- a/src/backend/access/rtree/Makefile +++ b/src/backend/access/rtree/Makefile @@ -8,8 +8,9 @@ # #------------------------------------------------------------------------- -SRCDIR = ../../.. -include ../../../Makefile.global +subdir = src/backend/access/rtree +top_builddir = ../../../.. +include $(top_builddir)/src/Makefile.global OBJS = rtget.o rtproc.o rtree.o rtscan.o rtstrat.o diff --git a/src/backend/access/transam/Makefile b/src/backend/access/transam/Makefile index 59b23ab648..4ac5fbc677 100644 --- a/src/backend/access/transam/Makefile +++ b/src/backend/access/transam/Makefile @@ -8,8 +8,9 @@ # #------------------------------------------------------------------------- -SRCDIR = ../../.. -include ../../../Makefile.global +subdir = src/backend/access/transam +top_builddir = ../../../.. +include $(top_builddir)/src/Makefile.global OBJS = transam.o transsup.o varsup.o xact.o xid.o xlog.o rmgr.o @@ -26,7 +27,7 @@ clean: # ensure that version checks in xlog.c get recompiled when config.h or # catversion.h changes, even if "make depend" hasn't been done. -xlog.o: xlog.c $(SRCDIR)/include/config.h $(SRCDIR)/include/catalog/catversion.h +xlog.o: xlog.c $(top_builddir)/src/include/config.h $(top_srcdir)/src/include/catalog/catversion.h ifeq (depend,$(wildcard depend)) include depend diff --git a/src/backend/catalog/Makefile b/src/backend/catalog/Makefile index 9cf326b69b..553f87a37c 100644 --- a/src/backend/catalog/Makefile +++ b/src/backend/catalog/Makefile @@ -8,7 +8,7 @@ subdir = src/backend/catalog top_builddir = ../../.. -include ../../Makefile.global +include $(top_builddir)/src/Makefile.global OBJS = catalog.o heap.o index.o indexing.o aclchk.o \ pg_aggregate.o pg_operator.o pg_proc.o pg_type.o diff --git a/src/backend/commands/Makefile b/src/backend/commands/Makefile index ccba4f3fc0..20b5e7d64d 100644 --- a/src/backend/commands/Makefile +++ b/src/backend/commands/Makefile @@ -8,8 +8,9 @@ # #------------------------------------------------------------------------- -SRCDIR = ../.. -include $(SRCDIR)/Makefile.global +subdir = src/backend/commands +top_builddir = ../../.. +include $(top_builddir)/src/Makefile.global OBJS = async.o creatinh.o command.o comment.o copy.o indexcmds.o define.o \ remove.o rename.o vacuum.o analyze.o view.o cluster.o \ @@ -30,4 +31,3 @@ clean: ifeq (depend,$(wildcard depend)) include depend endif - diff --git a/src/backend/executor/Makefile b/src/backend/executor/Makefile index 06b2190ca6..e82c27c889 100644 --- a/src/backend/executor/Makefile +++ b/src/backend/executor/Makefile @@ -8,8 +8,9 @@ # #------------------------------------------------------------------------- -SRCDIR = ../.. -include ../../Makefile.global +subdir = src/backend/executor +top_builddir = ../../.. +include $(top_builddir)/src/Makefile.global OBJS = execAmi.o execFlatten.o execJunk.o execMain.o \ execProcnode.o execQual.o execScan.o execTuples.o \ @@ -33,4 +34,3 @@ clean: ifeq (depend,$(wildcard depend)) include depend endif - diff --git a/src/backend/lib/Makefile b/src/backend/lib/Makefile index 711df2f773..4988a5f939 100644 --- a/src/backend/lib/Makefile +++ b/src/backend/lib/Makefile @@ -8,8 +8,9 @@ # #------------------------------------------------------------------------- -SRCDIR = ../.. -include ../../Makefile.global +subdir = src/backend/lib +top_builddir = ../../.. +include $(top_builddir)/src/Makefile.global OBJS = bit.o hasht.o lispsort.o stringinfo.o dllist.o @@ -27,4 +28,3 @@ clean: ifeq (depend,$(wildcard depend)) include depend endif - diff --git a/src/backend/main/Makefile b/src/backend/main/Makefile index f2fe752437..03015394e2 100644 --- a/src/backend/main/Makefile +++ b/src/backend/main/Makefile @@ -8,8 +8,9 @@ # #------------------------------------------------------------------------- -SRCDIR = ../.. -include ../../Makefile.global +subdir = src/backend/main +top_builddir = ../../.. +include $(top_builddir)/src/Makefile.global OBJS = main.o @@ -27,4 +28,3 @@ clean: ifeq (depend,$(wildcard depend)) include depend endif - diff --git a/src/backend/nodes/Makefile b/src/backend/nodes/Makefile index 4f4c34e53d..b5c4697c8d 100644 --- a/src/backend/nodes/Makefile +++ b/src/backend/nodes/Makefile @@ -8,8 +8,9 @@ # #------------------------------------------------------------------------- -SRCDIR = ../.. -include $(SRCDIR)/Makefile.global +subdir = src/backend/nodes +top_builddir = ../../.. +include $(top_builddir)/src/Makefile.global OBJS = nodeFuncs.o nodes.o list.o \ copyfuncs.o equalfuncs.o makefuncs.o \ diff --git a/src/backend/optimizer/Makefile b/src/backend/optimizer/Makefile index 6a7f2515d3..a9fa226849 100644 --- a/src/backend/optimizer/Makefile +++ b/src/backend/optimizer/Makefile @@ -6,7 +6,7 @@ subdir = src/backend/optimizer top_builddir = ../../.. -include ../../Makefile.global +include $(top_builddir)/src/Makefile.global SUBDIRS := geqo path plan prep util SUBDIROBJS := $(SUBDIRS:%=%/SUBSYS.o) diff --git a/src/backend/optimizer/geqo/Makefile b/src/backend/optimizer/geqo/Makefile index d63556026d..f017bbb843 100644 --- a/src/backend/optimizer/geqo/Makefile +++ b/src/backend/optimizer/geqo/Makefile @@ -5,24 +5,19 @@ # # Copyright (c) 1994, Regents of the University of California # -# $Id$ +# $Header$ # #------------------------------------------------------------------------- -SRCDIR = ../../.. -include ../../../Makefile.global - -ifeq ($(CC), gcc) -CFLAGS+= -Wno-error -endif +subdir = src/backend/optimizer/geqo +top_builddir = ../../../.. +include $(top_builddir)/src/Makefile.global OBJS = geqo_copy.o geqo_eval.o geqo_main.o geqo_misc.o \ geqo_pool.o geqo_recombination.o \ geqo_selection.o \ geqo_erx.o geqo_pmx.o geqo_cx.o geqo_px.o geqo_ox1.o geqo_ox2.o -# deprecated: minspantree.o - all: SUBSYS.o SUBSYS.o: $(OBJS) @@ -37,4 +32,3 @@ clean: ifeq (depend,$(wildcard depend)) include depend endif - diff --git a/src/backend/optimizer/path/Makefile b/src/backend/optimizer/path/Makefile index 0a87671c1c..ea3da28fec 100644 --- a/src/backend/optimizer/path/Makefile +++ b/src/backend/optimizer/path/Makefile @@ -8,8 +8,9 @@ # #------------------------------------------------------------------------- -SRCDIR = ../../.. -include ../../../Makefile.global +subdir = src/backend/optimizer/path +top_builddir = ../../../.. +include $(top_builddir)/src/Makefile.global OBJS = allpaths.o clausesel.o costsize.o indxpath.o \ joinpath.o joinrels.o orindxpath.o pathkeys.o tidpath.o @@ -28,4 +29,3 @@ clean: ifeq (depend,$(wildcard depend)) include depend endif - diff --git a/src/backend/optimizer/plan/Makefile b/src/backend/optimizer/plan/Makefile index b03d83afdd..99cec8aecd 100644 --- a/src/backend/optimizer/plan/Makefile +++ b/src/backend/optimizer/plan/Makefile @@ -8,13 +8,12 @@ # #------------------------------------------------------------------------- -SRCDIR = ../../.. -include ../../../Makefile.global +subdir = src/backend/optimizer/plan +top_builddir = ../../../.. +include $(top_builddir)/src/Makefile.global OBJS = createplan.o initsplan.o planmain.o planner.o setrefs.o subselect.o -# not ready yet: predmig.o xfunc.o - all: SUBSYS.o SUBSYS.o: $(OBJS) @@ -29,4 +28,3 @@ clean: ifeq (depend,$(wildcard depend)) include depend endif - diff --git a/src/backend/optimizer/prep/Makefile b/src/backend/optimizer/prep/Makefile index 312f9d2124..993053bff4 100644 --- a/src/backend/optimizer/prep/Makefile +++ b/src/backend/optimizer/prep/Makefile @@ -8,13 +8,12 @@ # #------------------------------------------------------------------------- -SRCDIR = ../../.. -include ../../../Makefile.global +subdir = src/backend/optimizer/prep +top_builddir = ../../../.. +include $(top_builddir)/src/Makefile.global OBJS = prepqual.o preptlist.o prepunion.o prepkeyset.o -# not ready yet: predmig.o xfunc.o - all: SUBSYS.o SUBSYS.o: $(OBJS) diff --git a/src/backend/optimizer/util/Makefile b/src/backend/optimizer/util/Makefile index bf5d9e884c..7cbe5c0196 100644 --- a/src/backend/optimizer/util/Makefile +++ b/src/backend/optimizer/util/Makefile @@ -8,14 +8,13 @@ # #------------------------------------------------------------------------- -SRCDIR = ../../.. -include ../../../Makefile.global +subdir = src/backend/optimizer/util +top_builddir = ../../../.. +include $(top_builddir)/src/Makefile.global OBJS = restrictinfo.o clauses.o indexnode.o plancat.o \ joininfo.o pathnode.o relnode.o tlist.o var.o -# not ready yet: predmig.o xfunc.o - all: SUBSYS.o SUBSYS.o: $(OBJS) @@ -30,4 +29,3 @@ clean: ifeq (depend,$(wildcard depend)) include depend endif - diff --git a/src/backend/port/Makefile.in b/src/backend/port/Makefile.in index 8e2dfe3c19..027b70a987 100644 --- a/src/backend/port/Makefile.in +++ b/src/backend/port/Makefile.in @@ -17,8 +17,9 @@ # #------------------------------------------------------------------------- -SRCDIR=../.. -include ../../Makefile.global +subdir = src/backend/port +top_builddir = ../../.. +include $(top_builddir)/src/Makefile.global OBJS = dynloader.o @INET_ATON@ @STRERROR@ @MISSING_RANDOM@ @SRANDOM@ OBJS+= @GETHOSTNAME@ @GETRUSAGE@ @STRCASECMP@ @STRDUP@ @TAS@ @ISINF@ @@ -39,8 +40,6 @@ qnx4.dir: tas.o: tas.s $(CC) $(CFLAGS) -c tas.s -.PHONY: clean dep - distclean clean: rm -f SUBSYS.o $(OBJS) diff --git a/src/backend/port/nextstep/Makefile b/src/backend/port/nextstep/Makefile index 1399014dde..4f2e9a92ea 100644 --- a/src/backend/port/nextstep/Makefile +++ b/src/backend/port/nextstep/Makefile @@ -1,12 +1,14 @@ #------------------------------------------------------------------------- # -# Makefile-- -# Makefile for port/next (NeXTStep 3.3 specific stuff) +# Makefile for NeXTStep 3.3 specific stuff +# +# $Header$ # #------------------------------------------------------------------------- -SRCDIR = ../../.. -include ../../../Makefile.global +subdir = src/backend/port/nextstep +top_builddir = ../../../.. +include $(top_builddir)/src/Makefile.global OBJS = dynloader.o port.o diff --git a/src/backend/port/qnx4/Makefile b/src/backend/port/qnx4/Makefile index 096f8d7ab7..b826046dd1 100644 --- a/src/backend/port/qnx4/Makefile +++ b/src/backend/port/qnx4/Makefile @@ -8,8 +8,9 @@ # #------------------------------------------------------------------------- -SRCDIR = ../../.. -include ../../../Makefile.global +subdir = src/backend/port/qnx4 +top_builddir = ../../../.. +include $(top_builddir)/src/Makefile.global OBJS = isnan.o rint.o sem.o shm.o @@ -36,4 +37,3 @@ clean: ifeq (depend,$(wildcard depend)) include depend endif - diff --git a/src/backend/port/sunos4/Makefile b/src/backend/port/sunos4/Makefile index 6477bc43dc..3759e1f3b9 100644 --- a/src/backend/port/sunos4/Makefile +++ b/src/backend/port/sunos4/Makefile @@ -1,15 +1,8 @@ -#------------------------------------------------------------------------- -# -# Makefile-- -# Makefile for port/sparc -# -# IDENTIFICATION -# $Header$ -# -#------------------------------------------------------------------------- +# $Header$ -SRCDIR = ../../.. -include ../../../Makefile.global +subdir = src/backend/port/sunos4 +top_builddir = ../../../.. +include $(top_builddir)/src/Makefile.global OBJS = strtol.o @@ -27,4 +20,3 @@ clean: ifeq (depend,$(wildcard depend)) include depend endif - diff --git a/src/backend/postmaster/Makefile b/src/backend/postmaster/Makefile index b1a11571f0..bc9c512b10 100644 --- a/src/backend/postmaster/Makefile +++ b/src/backend/postmaster/Makefile @@ -8,8 +8,9 @@ # #------------------------------------------------------------------------- -SRCDIR = ../.. -include ../../Makefile.global +subdir = src/backend/postmaster +top_builddir = ../../.. +include $(top_builddir)/src/Makefile.global OBJS = postmaster.o @@ -27,4 +28,3 @@ clean: ifeq (depend,$(wildcard depend)) include depend endif - diff --git a/src/backend/regex/Makefile b/src/backend/regex/Makefile index 2c60ad8a91..b550eba6dd 100644 --- a/src/backend/regex/Makefile +++ b/src/backend/regex/Makefile @@ -8,10 +8,11 @@ # #------------------------------------------------------------------------- -SRCDIR = ../.. -include ../../Makefile.global +subdir = src/backend/regex +top_builddir = ../../.. +include $(top_builddir)/src/Makefile.global -CFLAGS += -DPOSIX_MISTAKE +CPPFLAGS += -DPOSIX_MISTAKE DEBUGOBJ = @@ -27,7 +28,7 @@ SUBSYS.o: $(OBJS) $(LD) $(LDREL) $(LDOUT) SUBSYS.o $(OBJS) retest: retest.o SUBSYS.o $(DEBUGOBJ) - $(CC) -o retest retest.o SUBSYS.o $(DEBUGOBJ) + $(CC) $(CFLAGS) -o retest retest.o SUBSYS.o $(DEBUGOBJ) depend dep: $(CC) -MM $(CFLAGS) *.c >depend @@ -38,4 +39,3 @@ clean: ifeq (depend,$(wildcard depend)) include depend endif - diff --git a/src/backend/rewrite/Makefile b/src/backend/rewrite/Makefile index 7f0c7501f3..168d2233c0 100644 --- a/src/backend/rewrite/Makefile +++ b/src/backend/rewrite/Makefile @@ -8,8 +8,9 @@ # #------------------------------------------------------------------------- -SRCDIR = ../.. -include ../../Makefile.global +subdir = src/backend/rewrite +top_builddir = ../../.. +include $(top_builddir)/src/Makefile.global OBJS = rewriteRemove.o rewriteDefine.o \ rewriteHandler.o rewriteManip.o rewriteSupport.o locks.o @@ -28,4 +29,3 @@ clean: ifeq (depend,$(wildcard depend)) include depend endif - diff --git a/src/backend/storage/Makefile b/src/backend/storage/Makefile index ebf02fb486..7c2a86fbb7 100644 --- a/src/backend/storage/Makefile +++ b/src/backend/storage/Makefile @@ -6,7 +6,7 @@ subdir = src/backend/storage top_builddir = ../../.. -include ../../Makefile.global +include $(top_builddir)/src/Makefile.global SUBDIRS := buffer file ipc large_object lmgr page smgr SUBDIROBJS := $(SUBDIRS:%=%/SUBSYS.o) diff --git a/src/backend/storage/buffer/Makefile b/src/backend/storage/buffer/Makefile index 3eb30a2369..719ba86c3c 100644 --- a/src/backend/storage/buffer/Makefile +++ b/src/backend/storage/buffer/Makefile @@ -8,8 +8,9 @@ # #------------------------------------------------------------------------- -SRCDIR = ../../.. -include ../../../Makefile.global +subdir = src/backend/storage/buffer +top_builddir = ../../../.. +include $(top_builddir)/src/Makefile.global OBJS = buf_table.o buf_init.o bufmgr.o freelist.o localbuf.o s_lock.o diff --git a/src/backend/storage/file/Makefile b/src/backend/storage/file/Makefile index efb627aba7..c6c0cb1476 100644 --- a/src/backend/storage/file/Makefile +++ b/src/backend/storage/file/Makefile @@ -8,8 +8,9 @@ # #------------------------------------------------------------------------- -SRCDIR = ../../.. -include ../../../Makefile.global +subdir = src/backend/storage/file +top_builddir = ../../../.. +include $(top_builddir)/src/Makefile.global OBJS = fd.o buffile.o @@ -27,4 +28,3 @@ clean: ifeq (depend,$(wildcard depend)) include depend endif - diff --git a/src/backend/storage/ipc/Makefile b/src/backend/storage/ipc/Makefile index 1ea9e92415..45d030dc39 100644 --- a/src/backend/storage/ipc/Makefile +++ b/src/backend/storage/ipc/Makefile @@ -6,7 +6,7 @@ subdir = src/backend/storage/ipc top_builddir = ../../../.. -include ../../../Makefile.global +include $(top_builddir)/src/Makefile.global # seems to be required 1999/07/22 bjm ifeq ($(CPU), alpha) diff --git a/src/backend/storage/large_object/Makefile b/src/backend/storage/large_object/Makefile index 086cccc88a..73cfd346bf 100644 --- a/src/backend/storage/large_object/Makefile +++ b/src/backend/storage/large_object/Makefile @@ -8,8 +8,9 @@ # #------------------------------------------------------------------------- -SRCDIR = ../../.. -include ../../../Makefile.global +subdir = src/backend/storage/large_object +top_builddir = ../../../.. +include $(top_builddir)/src/Makefile.global OBJS = inv_api.o @@ -27,4 +28,3 @@ clean: ifeq (depend,$(wildcard depend)) include depend endif - diff --git a/src/backend/storage/lmgr/Makefile b/src/backend/storage/lmgr/Makefile index 34d6893161..a00868b1a1 100644 --- a/src/backend/storage/lmgr/Makefile +++ b/src/backend/storage/lmgr/Makefile @@ -8,8 +8,9 @@ # #------------------------------------------------------------------------- -SRCDIR = ../../.. -include ../../../Makefile.global +subdir = src/backend/storage/lmgr +top_builddir = ../../../.. +include $(top_builddir)/src/Makefile.global OBJS = lmgr.o lock.o proc.o @@ -27,4 +28,3 @@ clean: ifeq (depend,$(wildcard depend)) include depend endif - diff --git a/src/backend/storage/page/Makefile b/src/backend/storage/page/Makefile index 025a411fc3..1c9ae32dc1 100644 --- a/src/backend/storage/page/Makefile +++ b/src/backend/storage/page/Makefile @@ -8,8 +8,9 @@ # #------------------------------------------------------------------------- -SRCDIR = ../../.. -include ../../../Makefile.global +subdir = src/backend/storage/page +top_builddir = ../../../.. +include $(top_builddir)/src/Makefile.global OBJS = bufpage.o itemptr.o @@ -27,4 +28,3 @@ clean: ifeq (depend,$(wildcard depend)) include depend endif - diff --git a/src/backend/storage/smgr/Makefile b/src/backend/storage/smgr/Makefile index 5654c58558..9e873f5c5b 100644 --- a/src/backend/storage/smgr/Makefile +++ b/src/backend/storage/smgr/Makefile @@ -8,8 +8,9 @@ # #------------------------------------------------------------------------- -SRCDIR = ../../.. -include ../../../Makefile.global +subdir = src/backend/storage/smgr +top_builddir = ../../../.. +include $(top_builddir)/src/Makefile.global OBJS = md.o mm.o smgr.o smgrtype.o @@ -27,4 +28,3 @@ clean: ifeq (depend,$(wildcard depend)) include depend endif - diff --git a/src/backend/tcop/Makefile b/src/backend/tcop/Makefile index 0a85c24622..79e9829b57 100644 --- a/src/backend/tcop/Makefile +++ b/src/backend/tcop/Makefile @@ -8,12 +8,9 @@ # #------------------------------------------------------------------------- -SRCDIR= ../.. -include $(SRCDIR)/Makefile.global - -ifeq ($(CC), gcc) -CFLAGS+= -Wno-error -endif +subdir = src/backend/tcop +top_builddir = ../../.. +include $(top_builddir)/src/Makefile.global OBJS= dest.o fastpath.o postgres.o pquery.o utility.o @@ -31,4 +28,3 @@ clean: ifeq (depend,$(wildcard depend)) include depend endif - diff --git a/src/backend/tioga/Makefile b/src/backend/tioga/Makefile index 460b75871c..846fb1a545 100644 --- a/src/backend/tioga/Makefile +++ b/src/backend/tioga/Makefile @@ -8,10 +8,12 @@ # #------------------------------------------------------------------------- -SRCDIR = ../.. -include ../../Makefile.global +subdir = src/backend/tioga +top_builddir = ../../.. +include $(top_builddir)/src/Makefile.global OBJS = tgRecipe.o Varray.o +CPPFLAGS += -I$(srcdir) all: SUBSYS.o @@ -27,4 +29,3 @@ clean: ifeq (depend,$(wildcard depend)) include depend endif - diff --git a/src/backend/utils/Makefile b/src/backend/utils/Makefile index f6a13e8070..9cc63bd3c0 100644 --- a/src/backend/utils/Makefile +++ b/src/backend/utils/Makefile @@ -6,7 +6,7 @@ subdir = src/backend/utils/ top_builddir = ../../.. -include ../../Makefile.global +include $(top_builddir)/src/Makefile.global SUBDIRS := adt cache error fmgr hash init misc mmgr sort time ifdef MULTIBYTE diff --git a/src/backend/utils/adt/Makefile b/src/backend/utils/adt/Makefile index 7a74aa3ec9..ea099ff048 100644 --- a/src/backend/utils/adt/Makefile +++ b/src/backend/utils/adt/Makefile @@ -6,7 +6,7 @@ subdir = src/backend/utils/adt top_builddir = ../../../.. -include ../../../Makefile.global +include $(top_builddir)/src/Makefile.global # seems to be required for some date/time stuff 1999/07/22 bjm ifeq ($(CPU),alpha) @@ -40,6 +40,3 @@ clean: ifeq (depend,$(wildcard depend)) include depend endif - - - diff --git a/src/backend/utils/cache/Makefile b/src/backend/utils/cache/Makefile index 7c1a1408ab..9ebe9424d5 100644 --- a/src/backend/utils/cache/Makefile +++ b/src/backend/utils/cache/Makefile @@ -8,8 +8,9 @@ # #------------------------------------------------------------------------- -SRCDIR = ../../.. -include ../../../Makefile.global +subdir = src/backend/utils/cache +top_builddir = ../../../.. +include $(top_builddir)/src/Makefile.global OBJS = catcache.o inval.o rel.o relcache.o syscache.o lsyscache.o \ fcache.o temprel.o @@ -28,4 +29,3 @@ clean: ifeq (depend,$(wildcard depend)) include depend endif - diff --git a/src/backend/utils/error/Makefile b/src/backend/utils/error/Makefile index b1771f9033..eb7099bedf 100644 --- a/src/backend/utils/error/Makefile +++ b/src/backend/utils/error/Makefile @@ -8,8 +8,9 @@ # #------------------------------------------------------------------------- -SRCDIR = ../../.. -include ../../../Makefile.global +subdir = src/backend/utils/error +top_builddir = ../../../.. +include $(top_builddir)/src/Makefile.global OBJS = assert.o elog.o exc.o excabort.o excid.o format.o @@ -27,4 +28,3 @@ clean: ifeq (depend,$(wildcard depend)) include depend endif - diff --git a/src/backend/utils/fmgr/Makefile b/src/backend/utils/fmgr/Makefile index d27f9edaba..9d1eb81d54 100644 --- a/src/backend/utils/fmgr/Makefile +++ b/src/backend/utils/fmgr/Makefile @@ -8,8 +8,9 @@ # #------------------------------------------------------------------------- -SRCDIR = ../../.. -include ../../../Makefile.global +subdir = src/backend/utils/fmgr +top_builddir = ../../../.. +include $(top_builddir)/src/Makefile.global OBJS = dfmgr.o fmgr.o @@ -27,4 +28,3 @@ clean: ifeq (depend,$(wildcard depend)) include depend endif - diff --git a/src/backend/utils/hash/Makefile b/src/backend/utils/hash/Makefile index ae3c1fa749..80fbf050df 100644 --- a/src/backend/utils/hash/Makefile +++ b/src/backend/utils/hash/Makefile @@ -8,8 +8,9 @@ # #------------------------------------------------------------------------- -SRCDIR = ../../.. -include ../../../Makefile.global +subdir = src/backend/utils/hash +top_builddir = ../../../.. +include $(top_builddir)/src/Makefile.global OBJS = dynahash.o hashfn.o @@ -27,4 +28,3 @@ clean: ifeq (depend,$(wildcard depend)) include depend endif - diff --git a/src/backend/utils/init/Makefile b/src/backend/utils/init/Makefile index 904e04aad9..4e0628c301 100644 --- a/src/backend/utils/init/Makefile +++ b/src/backend/utils/init/Makefile @@ -8,8 +8,9 @@ # #------------------------------------------------------------------------- -SRCDIR = ../../.. -include ../../../Makefile.global +subdir = src/backend/utils/init +top_builddir = ../../../.. +include $(top_builddir)/src/Makefile.global OBJS = findbe.o globals.o miscinit.o postinit.o diff --git a/src/backend/utils/mb/Makefile b/src/backend/utils/mb/Makefile index a73b0b2be2..d15604640f 100644 --- a/src/backend/utils/mb/Makefile +++ b/src/backend/utils/mb/Makefile @@ -8,8 +8,9 @@ # #------------------------------------------------------------------------- -SRCDIR = ../../.. -include ../../../Makefile.global +subdir = src/backend/utils/mb +top_builddir = ../../../.. +include $(top_builddir)/src/Makefile.global OBJS = common.o conv.o mbutils.o wchar.o wstrcmp.o wstrncmp.o variable.o \ big5.o @@ -47,4 +48,3 @@ clean: ifeq (depend,$(wildcard depend)) include depend endif - diff --git a/src/backend/utils/mmgr/Makefile b/src/backend/utils/mmgr/Makefile index 1b36aa3366..67624b2c8d 100644 --- a/src/backend/utils/mmgr/Makefile +++ b/src/backend/utils/mmgr/Makefile @@ -8,8 +8,9 @@ # #------------------------------------------------------------------------- -SRCDIR = ../../.. -include ../../../Makefile.global +subdir = src/backend/utils/mmgr +top_builddir = ../../../.. +include $(top_builddir)/src/Makefile.global OBJS = aset.o mcxt.o portalmem.o @@ -27,4 +28,3 @@ clean: ifeq (depend,$(wildcard depend)) include depend endif - diff --git a/src/backend/utils/sort/Makefile b/src/backend/utils/sort/Makefile index a7ae9610c3..6cac6fc3c4 100644 --- a/src/backend/utils/sort/Makefile +++ b/src/backend/utils/sort/Makefile @@ -8,8 +8,9 @@ # #------------------------------------------------------------------------- -SRCDIR = ../../.. -include ../../../Makefile.global +subdir = src/backend/utils/sort +top_builddir = ../../../.. +include $(top_builddir)/src/Makefile.global OBJS = logtape.o tuplesort.o tuplestore.o @@ -27,4 +28,3 @@ clean: ifeq (depend,$(wildcard depend)) include depend endif - diff --git a/src/backend/utils/time/Makefile b/src/backend/utils/time/Makefile index 2119f4601b..9b39fdf355 100644 --- a/src/backend/utils/time/Makefile +++ b/src/backend/utils/time/Makefile @@ -8,8 +8,9 @@ # #------------------------------------------------------------------------- -SRCDIR = ../../.. -include ../../../Makefile.global +subdir = src/backend/utils/time +top_builddir = ../../../.. +include $(top_builddir)/src/Makefile.global OBJS = tqual.o @@ -27,4 +28,3 @@ clean: ifeq (depend,$(wildcard depend)) include depend endif - diff --git a/src/bin/Makefile b/src/bin/Makefile index 63fab62831..28eddbee56 100644 --- a/src/bin/Makefile +++ b/src/bin/Makefile @@ -10,7 +10,7 @@ subdir = src/bin top_builddir = ../.. -include ../Makefile.global +include $(top_builddir)/src/Makefile.global DIRS := initdb initlocation ipcclean pg_ctl pg_dump pg_id \ pg_passwd psql scripts pg-config diff --git a/src/bin/initdb/Makefile b/src/bin/initdb/Makefile index 5df9b74d91..459c5d4bf6 100644 --- a/src/bin/initdb/Makefile +++ b/src/bin/initdb/Makefile @@ -10,11 +10,11 @@ subdir = src/bin/initdb top_builddir = ../../.. -include ../../Makefile.global +include $(top_builddir)/src/Makefile.global all: initdb -initdb: initdb.sh ../../Makefile.global +initdb: initdb.sh $(top_builddir)/src/Makefile.global sed -e 's/__MULTIBYTE__/$(MULTIBYTE)/g' \ -e 's/__VERSION__/$(VERSION)/g' \ -e 's:__bindir__:$(bindir):g' \ diff --git a/src/bin/initlocation/Makefile b/src/bin/initlocation/Makefile index 43c1d4f9bb..25c6ea4553 100644 --- a/src/bin/initlocation/Makefile +++ b/src/bin/initlocation/Makefile @@ -10,7 +10,7 @@ subdir = src/bin/initlocation top_builddir = ../../.. -include ../../Makefile.global +include $(top_builddir)/src/Makefile.global all: initlocation diff --git a/src/bin/ipcclean/Makefile b/src/bin/ipcclean/Makefile index 5095badf21..046aa2aaec 100644 --- a/src/bin/ipcclean/Makefile +++ b/src/bin/ipcclean/Makefile @@ -10,7 +10,7 @@ subdir = src/bin/ipcclean top_builddir = ../../.. -include ../../Makefile.global +include $(top_builddir)/src/Makefile.global all: ipcclean diff --git a/src/bin/pg_ctl/Makefile b/src/bin/pg_ctl/Makefile index d74a98b988..dd7878bbb7 100644 --- a/src/bin/pg_ctl/Makefile +++ b/src/bin/pg_ctl/Makefile @@ -10,7 +10,7 @@ subdir = src/bin/pg_ctl top_builddir = ../../.. -include ../../Makefile.global +include $(top_builddir)/src/Makefile.global all: pg_ctl diff --git a/src/bin/pg_dump/Makefile b/src/bin/pg_dump/Makefile index 36683a0cc0..8e2d61d357 100644 --- a/src/bin/pg_dump/Makefile +++ b/src/bin/pg_dump/Makefile @@ -10,21 +10,21 @@ subdir = src/bin/pg_dump top_builddir = ../../.. -include ../../Makefile.global +include $(top_builddir)/src/Makefile.global OBJS= pg_backup_archiver.o pg_backup_db.o pg_backup_custom.o pg_backup_files.o \ pg_backup_null.o pg_backup_tar.o $(STRDUP) -CFLAGS+= -I$(LIBPQDIR) +CPPFLAGS+= -I$(libpq_srcdir) LIBS+= -lz all: submake pg_dump pg_restore pg_dumpall -pg_dump: pg_dump.o common.o $(OBJS) $(LIBPQDIR)/libpq.a - $(CC) $(CFLAGS) -o $@ pg_dump.o common.o $(OBJS) $(LIBPQ) $(LDFLAGS) +pg_dump: pg_dump.o common.o $(OBJS) $(libpq_builddir)/libpq.a + $(CC) $(CFLAGS) -o $@ pg_dump.o common.o $(OBJS) $(libpq) $(LDFLAGS) -pg_restore: pg_restore.o $(OBJS) $(LIBPQDIR)/libpq.a - $(CC) $(CFLAGS) -o $@ pg_restore.o $(OBJS) $(LIBPQ) $(LDFLAGS) +pg_restore: pg_restore.o $(OBJS) $(libpq_builddir)/libpq.a + $(CC) $(CFLAGS) -o $@ pg_restore.o $(OBJS) $(libpq) $(LDFLAGS) ../../utils/strdup.o: $(MAKE) -C ../../utils strdup.o @@ -37,7 +37,7 @@ pg_dumpall: pg_dumpall.sh .PHONY: submake submake: - $(MAKE) -C $(LIBPQDIR) all + $(MAKE) -C $(libpq_builddir) all install: all installdirs $(INSTALL_PROGRAM) pg_dump$(X) $(bindir)/pg_dump$(X) diff --git a/src/bin/pg_encoding/Makefile b/src/bin/pg_encoding/Makefile index 3fc6951de7..83376a3e93 100644 --- a/src/bin/pg_encoding/Makefile +++ b/src/bin/pg_encoding/Makefile @@ -10,19 +10,19 @@ subdir = src/bin/pg_encoding top_builddir = ../../.. -include ../../Makefile.global +include $(top_builddir)/src/Makefile.global OBJS= pg_encoding.o all: submake pg_encoding$(X) pg_encoding$(X): $(OBJS) - $(CC) -o $@ $(OBJS) $(LIBPQ) $(LDFLAGS) $(CFLAGS) + $(CC) -o $@ $(OBJS) $(libpq) $(LDFLAGS) $(CFLAGS) .PHONY: submake submake: - $(MAKE) -C $(LIBPQDIR) all + $(MAKE) -C $(libpq_builddir) all install: all installdirs $(INSTALL_PROGRAM) pg_encoding$(X) $(bindir)/pg_encoding$(X) diff --git a/src/bin/pg_id/Makefile b/src/bin/pg_id/Makefile index da044ea37b..be5e1d678d 100644 --- a/src/bin/pg_id/Makefile +++ b/src/bin/pg_id/Makefile @@ -10,7 +10,7 @@ subdir = src/bin/pg_id top_builddir = ../../.. -include ../../Makefile.global +include $(top_builddir)/src/Makefile.global all: pg_id$(X) diff --git a/src/bin/pg_passwd/Makefile b/src/bin/pg_passwd/Makefile index aef4f1a56a..6009e1a0b8 100644 --- a/src/bin/pg_passwd/Makefile +++ b/src/bin/pg_passwd/Makefile @@ -1,10 +1,8 @@ -# -# Makefile for src/bin/pg_passwd -# +# $Header$ subdir = src/bin/pg_passwd top_builddir = ../../.. -include ../../Makefile.global +include $(top_builddir)/src/Makefile.global all: pg_passwd$(X) diff --git a/src/bin/pgaccess/Makefile b/src/bin/pgaccess/Makefile index 94418dc153..b3e5d1c176 100644 --- a/src/bin/pgaccess/Makefile +++ b/src/bin/pgaccess/Makefile @@ -10,7 +10,7 @@ subdir = src/bin/pgaccess top_builddir = ../../.. -include ../../Makefile.global +include $(top_builddir)/src/Makefile.global pgaccessdir = $(datadir)/pgaccess diff --git a/src/bin/pgtclsh/Makefile b/src/bin/pgtclsh/Makefile index 2b61ec16a0..bd3055f64e 100644 --- a/src/bin/pgtclsh/Makefile +++ b/src/bin/pgtclsh/Makefile @@ -11,7 +11,7 @@ subdir = src/bin/pgtclsh top_builddir = ../../.. -include ../../Makefile.global +include $(top_builddir)/src/Makefile.global # # Include definitions from the tclConfig.sh file @@ -21,7 +21,11 @@ ifeq ($(USE_TK), true) -include Makefile.tkdefs endif -CFLAGS+= $(X_CFLAGS) -I$(LIBPGTCLDIR) +libpgtcl_srcdir = $(top_srcdir)/src/interfaces/libpgtcl +libpgtcl_builddir = $(top_builddir)/src/interfaces/libpgtcl +libpgtcl = -L$(libpgtcl_builddir) -lpgtcl + +CFLAGS+= $(X_CFLAGS) -I$(libpgtcl_srcdir) # If we are here then TCL is available @@ -36,16 +40,16 @@ all: submake $(PROGRAMS) pgtclsh: pgtclAppInit.o $(CC) $(CFLAGS) $(TCL_DEFS) -o $@ $< \ - $(LIBPGTCL) $(LIBPQ) $(TCL_LIB_SPEC) $(TCL_LIBS) $(LDFLAGS) + $(libpgtcl) $(libpq) $(TCL_LIB_SPEC) $(TCL_LIBS) $(LDFLAGS) pgtksh: pgtkAppInit.o $(CC) $(CFLAGS) $(TK_DEFS) -o $@ $< \ - $(LIBPGTCL) $(LIBPQ) $(X_LIBS) $(TK_LIB_SPEC) $(TK_LIBS) \ + $(libpgtcl) $(libpq) $(X_LIBS) $(TK_LIB_SPEC) $(TK_LIBS) \ $(TCL_LIB_SPEC) $(X11_LIBS) $(LDFLAGS) .PHONY: submake submake: - $(MAKE) -C $(LIBPGTCLDIR) all + $(MAKE) -C $(libpgtcl_builddir) all install: all installdirs $(INSTALL_PROGRAM) pgtclsh $(bindir)/pgtclsh diff --git a/src/bin/psql/Makefile b/src/bin/psql/Makefile index fb5b65e36f..a12efee3ca 100644 --- a/src/bin/psql/Makefile +++ b/src/bin/psql/Makefile @@ -10,11 +10,11 @@ subdir = src/bin/psql top_builddir = ../../.. -include ../../Makefile.global +include $(top_builddir)/src/Makefile.global REFDOCDIR= $(top_srcdir)/doc/src/sgml/ref -CFLAGS+= -I$(LIBPQDIR) +CPPFLAGS+= -I$(libpq_srcdir) OBJS=command.o common.o help.o input.o stringutils.o mainloop.o \ copy.o startup.o prompt.o variables.o large_obj.o print.o describe.o \ @@ -47,8 +47,8 @@ endif # End of hacks for picking up backend 'port' modules -psql$(X): $(OBJS) $(LIBPQDIR)/libpq.a - $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBPQ) $(LDFLAGS) +psql$(X): $(OBJS) $(libpq_builddir)/libpq.a + $(CC) $(CFLAGS) -o $@ $(OBJS) $(libpq) $(LDFLAGS) help.o: $(srcdir)/sql_help.h @@ -63,7 +63,7 @@ endif .PHONY: submake submake: - $(MAKE) -C $(LIBPQDIR) all + $(MAKE) -C $(libpq_builddir) all distprep: $(srcdir)/sql_help.h diff --git a/src/bin/scripts/Makefile b/src/bin/scripts/Makefile index d07dd52185..cf5f2ce5f1 100644 --- a/src/bin/scripts/Makefile +++ b/src/bin/scripts/Makefile @@ -10,7 +10,7 @@ subdir = src/bin/scripts top_builddir = ../../.. -include ../../Makefile.global +include $(top_builddir)/src/Makefile.global SCRIPTS := createdb dropdb createuser dropuser createlang droplang vacuumdb diff --git a/src/include/Makefile b/src/include/Makefile index 15454a4991..344d82b717 100644 --- a/src/include/Makefile +++ b/src/include/Makefile @@ -11,7 +11,7 @@ subdir = src/include top_builddir = ../.. -include ../Makefile.global +include $(top_builddir)/src/Makefile.global HEADERS := os.h config.h c.h postgres.h postgres_ext.h fmgr.h \ diff --git a/src/interfaces/Makefile b/src/interfaces/Makefile index 439d574402..19bda8f838 100644 --- a/src/interfaces/Makefile +++ b/src/interfaces/Makefile @@ -10,7 +10,7 @@ subdir = src/interfaces top_builddir = ../.. -include ../Makefile.global +include $(top_builddir)/src/Makefile.global DIRS := libpq ecpg libpgeasy diff --git a/src/interfaces/ecpg/Makefile b/src/interfaces/ecpg/Makefile index d3f9df7c9a..2637a2ed01 100644 --- a/src/interfaces/ecpg/Makefile +++ b/src/interfaces/ecpg/Makefile @@ -1,6 +1,6 @@ subdir = src/interfaces/ecpg top_builddir = ../../.. -include ../../Makefile.global +include $(top_builddir)/src/Makefile.global all install installdirs uninstall dep depend distprep: $(MAKE) -C include $@ diff --git a/src/interfaces/ecpg/include/Makefile b/src/interfaces/ecpg/include/Makefile index 3d36e878eb..9255fe78b5 100644 --- a/src/interfaces/ecpg/include/Makefile +++ b/src/interfaces/ecpg/include/Makefile @@ -1,6 +1,6 @@ subdir = src/interfaces/ecpg/include top_builddir = ../../../.. -include ../../../Makefile.global +include $(top_builddir)/src/Makefile.global install: all installdirs install-headers diff --git a/src/interfaces/ecpg/lib/Makefile b/src/interfaces/ecpg/lib/Makefile index 3aa6046e6e..9ffe7287d8 100644 --- a/src/interfaces/ecpg/lib/Makefile +++ b/src/interfaces/ecpg/lib/Makefile @@ -10,19 +10,19 @@ subdir = src/interfaces/ecpg/lib top_builddir = ../../../.. -include ../../../Makefile.global +include $(top_builddir)/src/Makefile.global NAME= ecpg SO_MAJOR_VERSION= 3 SO_MINOR_VERSION= 1.1 -CFLAGS+= -I$(top_srcdir)/src/interfaces/ecpg/include -I$(LIBPQDIR) +CPPFLAGS += -I$(top_srcdir)/src/interfaces/ecpg/include -I$(libpq_srcdir) OBJS= execute.o typename.o descriptor.o data.o error.o prepare.o memory.o \ connect.o misc.o -SHLIB_LINK= $(LIBPQ) +SHLIB_LINK= $(libpq) all: all-lib diff --git a/src/interfaces/ecpg/preproc/Makefile b/src/interfaces/ecpg/preproc/Makefile index bba2ecdeb7..aeb0a0fc07 100644 --- a/src/interfaces/ecpg/preproc/Makefile +++ b/src/interfaces/ecpg/preproc/Makefile @@ -1,12 +1,12 @@ subdir = src/interfaces/ecpg/preproc top_builddir = ../../../.. -include ../../../Makefile.global +include $(top_builddir)/src/Makefile.global MAJOR_VERSION=2 MINOR_VERSION=7 PATCHLEVEL=1 -CFLAGS+=-I../include -DMAJOR_VERSION=$(MAJOR_VERSION) \ +CPPFLAGS+=-I../include -DMAJOR_VERSION=$(MAJOR_VERSION) \ -DMINOR_VERSION=$(MINOR_VERSION) -DPATCHLEVEL=$(PATCHLEVEL) \ -DINCLUDE_PATH=\"$(includedir)\" diff --git a/src/interfaces/libpgeasy/Makefile b/src/interfaces/libpgeasy/Makefile index 0c531f645c..4153a3c62f 100644 --- a/src/interfaces/libpgeasy/Makefile +++ b/src/interfaces/libpgeasy/Makefile @@ -8,7 +8,7 @@ subdir = src/interfaces/libpgeasy top_builddir = ../../.. -include ../../Makefile.global +include $(top_builddir)/src/Makefile.global # shared library parameters @@ -16,11 +16,11 @@ NAME= pgeasy SO_MAJOR_VERSION= 2 SO_MINOR_VERSION= 1 -CFLAGS+= -I$(LIBPQDIR) +CPPFLAGS += -I$(libpq_srcdir) OBJS= libpgeasy.o halt.o -SHLIB_LINK+= $(LIBPQ) +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 diff --git a/src/interfaces/libpgtcl/Makefile b/src/interfaces/libpgtcl/Makefile index bf8bb6b819..21f52f5eed 100644 --- a/src/interfaces/libpgtcl/Makefile +++ b/src/interfaces/libpgtcl/Makefile @@ -16,11 +16,11 @@ NAME= pgtcl SO_MAJOR_VERSION= 2 SO_MINOR_VERSION= 1 -CFLAGS+= -I$(LIBPQDIR) +CPPFLAGS += -I$(libpq_srcdir) OBJS= pgtcl.o pgtclCmds.o pgtclId.o -SHLIB_LINK+= $(LIBPQ) +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 diff --git a/src/interfaces/libpq++/Makefile b/src/interfaces/libpq++/Makefile index 5376b8c35b..c45e0c8fa0 100644 --- a/src/interfaces/libpq++/Makefile +++ b/src/interfaces/libpq++/Makefile @@ -10,21 +10,21 @@ subdir = src/interfaces/libpq++ top_builddir = ../../.. -include ../../Makefile.global +include $(top_builddir)/src/Makefile.global NAME= pq++ SO_MAJOR_VERSION= 3 SO_MINOR_VERSION= 1 SRCHEADERDIR = $(top_srcdir)/src/include -CXXFLAGS+= -I$(SRCHEADERDIR) -I$(LIBPQDIR) +CXXFLAGS+= -I$(SRCHEADERDIR) -I$(libpq_srcdir) OBJS = pgconnection.o pgdatabase.o pgtransdb.o pgcursordb.o pglobject.o ifeq ($(PORTNAME), win) -SHLIB_LINK+= --driver-name g++ $(LIBPQ) +SHLIB_LINK+= --driver-name g++ $(libpq) else -SHLIB_LINK= $(LIBPQ) +SHLIB_LINK= $(libpq) endif # For CC on IRIX, must use CC as linker/archiver of C++ libraries diff --git a/src/interfaces/libpq/Makefile b/src/interfaces/libpq/Makefile index 7402d79c73..eb55327ad6 100644 --- a/src/interfaces/libpq/Makefile +++ b/src/interfaces/libpq/Makefile @@ -10,7 +10,7 @@ subdir = src/interfaces/libpq top_builddir = ../../.. -include ../../Makefile.global +include $(top_builddir)/src/Makefile.global # shared library parameters NAME= pq diff --git a/src/interfaces/odbc/GNUmakefile b/src/interfaces/odbc/GNUmakefile index 165f121d31..68aa155b9b 100644 --- a/src/interfaces/odbc/GNUmakefile +++ b/src/interfaces/odbc/GNUmakefile @@ -8,14 +8,14 @@ subdir = src/interfaces/odbc top_builddir = ../../.. -include ../../Makefile.global +include $(top_builddir)/src/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)"' +CPPFLAGS += -I$(srcdir) -DHAVE_CONFIG_H -DODBCINSTDIR='"$(odbcinst_ini_dir)"' OBJS = info.o bind.o columninfo.o connection.o convert.o drvconn.o \ diff --git a/src/interfaces/perl5/GNUmakefile b/src/interfaces/perl5/GNUmakefile index 210da52660..53cf86c8e3 100644 --- a/src/interfaces/perl5/GNUmakefile +++ b/src/interfaces/perl5/GNUmakefile @@ -8,7 +8,7 @@ subdir = src/interfaces/perl5 top_builddir = ../../.. -include ../../Makefile.global +include $(top_builddir)/src/Makefile.global all: Makefile libpq-all @@ -19,7 +19,7 @@ Makefile: Makefile.PL .PHONY: libpq-all libpq-all: - $(MAKE) -C $(top_builddir)/src/interfaces/libpq all + $(MAKE) -C $(libpq_builddir) all # The klugery here is to ensure that the perl5 shared library gets # built with the correct path to the installed location of libpq diff --git a/src/interfaces/python/GNUmakefile b/src/interfaces/python/GNUmakefile index 111b0800fa..5be583a35a 100644 --- a/src/interfaces/python/GNUmakefile +++ b/src/interfaces/python/GNUmakefile @@ -10,14 +10,14 @@ subdir = src/interfaces/python top_builddir = ../../.. -include ../../Makefile.global +include $(top_builddir)/src/Makefile.global all: Makefile pgmodule.c libpq-all $(MAKE) -f Makefile .PHONY: libpq-all libpq-all: - $(MAKE) -C $(top_builddir)/src/interfaces/libpq all + $(MAKE) -C $(libpq_builddir) all Makefile: Setup.in Makefile.pre.in $(MAKE) -f Makefile.pre.in boot srcdir=$(srcdir) VPATH=$(srcdir) @@ -26,10 +26,11 @@ 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" \ - < $< > $@ + sed -e 's,@libpq_srcdir@,$(libpq_srcdir),g' \ + -e 's,@libpq_builddir@,$(libpq_builddir),g' \ + -e 's,@EXTRA_LIBS@,$(LIBS),g' \ + -e 's,@pg_includedir@,$(top_srcdir)/src/include,g' \ + $< > $@ install: all @echo "Installing Python module" diff --git a/src/interfaces/python/Setup.in.raw b/src/interfaces/python/Setup.in.raw index dddb558810..9c26d73968 100644 --- a/src/interfaces/python/Setup.in.raw +++ b/src/interfaces/python/Setup.in.raw @@ -1,3 +1,3 @@ *shared* -_pg pgmodule.c -I__LIBPQ__ -I__INCLUDES__ -L__LIBPQ__ -lpq __EXTRA_LIBS__ +_pg pgmodule.c -I@libpq_srcdir@ -I@pg_includedir@ -L@libpq_builddir@ -lpq @EXTRA_LIBS@ diff --git a/src/makefiles/Makefile.aix b/src/makefiles/Makefile.aix index ba6d0540d3..0066135179 100644 --- a/src/makefiles/Makefile.aix +++ b/src/makefiles/Makefile.aix @@ -10,16 +10,16 @@ IMPSUFF= .imp POSTGRES_IMP= postgres$(IMPSUFF) -MKLDEXPORT=$(SRCDIR)/backend/port/aix/mkldexport.sh +MKLDEXPORT=$(top_srcdir)/src/backend/port/aix/mkldexport.sh $(POSTGRES_IMP): @echo Making $@ - $(MKLDEXPORT) postgres $(BINDIR) > $@ - $(CC) -Wl,-bE:$(SRCDIR)/backend/$@ -o postgres $(OBJS) $(LDFLAGS) + $(MKLDEXPORT) postgres $(bindir) > $@ + $(CC) -Wl,-bE:$(top_builddir)/src/backend/$@ -o postgres $(OBJS) $(LDFLAGS) %$(EXPSUFF): $(MKLDEXPORT) $*.o `pwd` > $*$(EXPSUFF) %$(DLSUFFIX): %.o %$(EXPSUFF) @echo Making share library $@ from $*.o, $*$(EXPSUFF), and installed postgres.imp - $(LD) -H512 -bM:SRE -bI:$(LIBDIR)/$(POSTGRES_IMP) -bE:$*$(EXPSUFF) -o $@ $*.o $(LDFLAGS) $(CFLAGS_SL) + $(LD) -H512 -bM:SRE -bI:$(libdir)/$(POSTGRES_IMP) -bE:$*$(EXPSUFF) -o $@ $*.o $(LDFLAGS) $(CFLAGS_SL) diff --git a/src/makefiles/Makefile.hpux b/src/makefiles/Makefile.hpux index ad2b932d64..de2b87d613 100644 --- a/src/makefiles/Makefile.hpux +++ b/src/makefiles/Makefile.hpux @@ -19,11 +19,11 @@ ifneq ($(HPUXMATHLIB),) LDFLAGS:= -L /lib/pa1.1 $(LDFLAGS) endif -# On all HPUX versions, embed LIBDIR as the shared library search path +# On all HPUX versions, embed `libdir' as the shared library search path # so that the executables don't need SHLIB_PATH to be set, specify -z # to catch null pointer dereferences, and specify -E to make all symbols # visible to dynamically linked shared libraries. -LDFLAGS+= -Wl,+b -Wl,$(LIBDIR) -Wl,-z -Wl,-E +LDFLAGS+= -Wl,+b -Wl,$(libdir) -Wl,-z -Wl,-E # Rule for building shared libs (currently used only for regression test # shlib ... should go away, since this is not really enough knowledge) diff --git a/src/makefiles/Makefile.win b/src/makefiles/Makefile.win index b73f1f2d09..45fab0e6e2 100644 --- a/src/makefiles/Makefile.win +++ b/src/makefiles/Makefile.win @@ -2,7 +2,7 @@ CFLAGS+= -I/usr/local/include LDFLAGS+= -g DLLTOOL= dlltool DLLWRAP= dllwrap -DLLLIBS=-L/usr/local/lib -L$(LIBDIR) -L$(SRCDIR)/backend -lpostgres -lcygipc -lcygwin -lcrypt -lkernel32 +DLLLIBS=-L/usr/local/lib -L$(libdir) -L$(top_builddir)/src/backend -lpostgres -lcygipc -lcygwin -lcrypt -lkernel32 X=.exe MK_NO_LORDER=true MAKE_DLL=true @@ -11,7 +11,7 @@ SHLIB_LINK=$(DLLLIBS) %.dll: %.o $(DLLTOOL) --export-all --output-def $*.def $< - $(DLLWRAP) -o $@ --def $*.def $< $(SRCDIR)/utils/dllinit.o $(DLLLIBS) + $(DLLWRAP) -o $@ --def $*.def $< $(top_builddir)/src/utils/dllinit.o $(DLLLIBS) rm -f $*.def curdir:=$(shell pwd) diff --git a/src/pl/Makefile b/src/pl/Makefile index 1a000b49c8..978c6a663d 100644 --- a/src/pl/Makefile +++ b/src/pl/Makefile @@ -10,7 +10,7 @@ subdir = src/pl top_builddir = ../.. -include ../Makefile.global +include $(top_builddir)/src/Makefile.global DIRS := plpgsql diff --git a/src/pl/plperl/GNUmakefile b/src/pl/plperl/GNUmakefile index ecefef0884..d9531a3d87 100644 --- a/src/pl/plperl/GNUmakefile +++ b/src/pl/plperl/GNUmakefile @@ -2,7 +2,7 @@ subdir = src/pl/plperl top_builddir = ../../.. -include ../../Makefile.global +include $(top_builddir)/src/Makefile.global plperl_installdir = $(libdir) diff --git a/src/pl/plpgsql/Makefile b/src/pl/plpgsql/Makefile index d9daa5445c..e1a56d8733 100644 --- a/src/pl/plpgsql/Makefile +++ b/src/pl/plpgsql/Makefile @@ -10,7 +10,7 @@ subdir = src/pl/plpgsql top_builddir = ../../.. -include ../../Makefile.global +include $(top_builddir)/src/Makefile.global all install installdirs uninstall distprep: $(MAKE) -C src $@ diff --git a/src/pl/tcl/Makefile b/src/pl/tcl/Makefile index 19d0f580fd..3ce1b01aed 100644 --- a/src/pl/tcl/Makefile +++ b/src/pl/tcl/Makefile @@ -8,7 +8,7 @@ subdir = src/pl/tcl top_builddir = ../../.. -include ../../Makefile.global +include $(top_builddir)/src/Makefile.global -include Makefile.tcldefs diff --git a/src/test/bench/Makefile b/src/test/bench/Makefile index 0eebe3865e..58b7df2ad8 100644 --- a/src/test/bench/Makefile +++ b/src/test/bench/Makefile @@ -11,13 +11,14 @@ # #------------------------------------------------------------------------- -SRCDIR= ../.. -include ../../Makefile.global +subdir = src/test/bench +top_builddir = ../../.. +include $(top_builddir)/src/Makefile.global CREATEFILES= create.sql bench.sql OUTFILES= bench.out bench.out.perquery -CFLAGS+= -I$(LIBPQDIR) $(CFLAGS_SL) +CFLAGS+= -I$(libpq_srcdir) $(CFLAGS_SL) all: $(CREATEFILES) diff --git a/src/test/examples/Makefile b/src/test/examples/Makefile index 8368e4078e..9dd159e2f2 100644 --- a/src/test/examples/Makefile +++ b/src/test/examples/Makefile @@ -2,12 +2,13 @@ # Makefile for example programs # -SRCDIR= ../.. -include ../../Makefile.global +subdir = src/test/examples +top_builddir = ../../.. +include $(top_builddir)/src/Makefile.global -CFLAGS+= -I$(LIBPQDIR) +CPPFLAGS+= -I$(libpq_srcdir) -LDFLAGS+= -L$(LIBPQDIR) -lpq +LDFLAGS+= $(libpq) # PROGS= testlibpq0 testlibpq1 testlibpq2 testlibpq3 testlibpq4 testlo diff --git a/src/test/locale/Makefile b/src/test/locale/Makefile index cd37c92057..eed94c6bc7 100644 --- a/src/test/locale/Makefile +++ b/src/test/locale/Makefile @@ -1,9 +1,8 @@ -# -# Makefile for example programs -# +# $Header$ -SRCDIR= ../.. -include ../../Makefile.global +subdir = src/test/locale +top_builddir = ../../.. +include $(top_builddir)/src/Makefile.global PROGS = test-pgsql-locale test-ctype @@ -17,9 +16,7 @@ $(PROGS): % : %.c clean: rm -f $(PROGS) *.out for d in $(DIRS); do \ - cd $$d; \ - $(MAKE) clean; \ - cd ..; \ + $(MAKE) -C $$d clean done test-%: all diff --git a/src/test/regress/GNUmakefile b/src/test/regress/GNUmakefile index fb995c2d20..c8ebf00401 100644 --- a/src/test/regress/GNUmakefile +++ b/src/test/regress/GNUmakefile @@ -19,9 +19,9 @@ CONTRIB= $(top_builddir)/contrib HOST := $(shell $(top_srcdir)/config/config.guess) -CFLAGS+= -I$(LIBPQDIR) $(CFLAGS_SL) +CFLAGS+= -I$(libpq_srcdir) $(CFLAGS_SL) -LDADD+= -L$(LIBPQDIR) -lpq +LDADD+= $(libpq) # # DLOBJS is the dynamically-loaded object file. The regression test uses diff --git a/src/test/regress/input/Makefile b/src/test/regress/input/Makefile index 233adcad1c..3e63bc424d 100644 --- a/src/test/regress/input/Makefile +++ b/src/test/regress/input/Makefile @@ -11,8 +11,9 @@ # #------------------------------------------------------------------------- -SRCDIR= ../../.. -include ../../../Makefile.global +subdir = src/test/regress/input +top_builddir = ../../../.. +include $(top_builddir)/src/Makefile.global # # ... plus test query inputs @@ -34,5 +35,5 @@ all: $(INFILES) OBJ=`pwd`; \ sed -e "s:_OBJWD_:$$OBJ/\.\.:g" \ -e "s:_DLSUFFIX_:$(DLSUFFIX):g" \ - -e "s:_LIBDIR_:$(LIBDIR):g" \ + -e "s:_LIBDIR_:$(libdir):g" \ -e "s/_USER_/$$USER/g" < $< > ../sql/$@ diff --git a/src/test/regress/output/Makefile b/src/test/regress/output/Makefile index 79a230131a..80ce17cac5 100644 --- a/src/test/regress/output/Makefile +++ b/src/test/regress/output/Makefile @@ -11,8 +11,9 @@ # #------------------------------------------------------------------------- -SRCDIR= ../../.. -include ../../../Makefile.global +subdir = src/test/regress/output +top_builddir = ../../../.. +include $(top_builddir)/src/Makefile.global # # ... plus test query inputs @@ -34,7 +35,6 @@ all: $(INFILES) OBJ=`pwd`; \ sed -e "s:_OBJWD_:$$OBJ/\.\.:g" \ -e "s:_DLSUFFIX_:$(DLSUFFIX):g" \ - -e "s:_LIBDIR_:$(LIBDIR):g" \ + -e "s:_LIBDIR_:$(libdir):g" \ -e "s/_USER_/$$USER/g" < $< | \ sed -e "s:output/\.\.:input/\.\.:g" > ../expected/$@ - diff --git a/src/tutorial/Makefile b/src/tutorial/Makefile index 15372e8158..500d4e7523 100644 --- a/src/tutorial/Makefile +++ b/src/tutorial/Makefile @@ -8,8 +8,9 @@ # #------------------------------------------------------------------------- -SRCDIR= .. -include $(SRCDIR)/Makefile.global +subdir = src/tutorial +top_builddir = ../.. +include $(top_builddir)/src/Makefile.global CFLAGS+= $(CFLAGS_SL) diff --git a/src/utils/Makefile b/src/utils/Makefile index f6967bdcb4..bd9e041117 100644 --- a/src/utils/Makefile +++ b/src/utils/Makefile @@ -19,7 +19,7 @@ subdir = src/utils top_builddir = ../.. -include ../Makefile.global +include $(top_builddir)/src/Makefile.global all: -- 2.39.5