2000-10-08 23:13:27 +02:00
|
|
|
# -*-makefile-*-
|
2010-09-20 22:08:53 +02:00
|
|
|
# src/Makefile.global.in
|
2014-04-15 03:49:57 +02:00
|
|
|
# @configure_input@
|
2000-08-31 18:12:35 +02:00
|
|
|
|
|
|
|
#------------------------------------------------------------------------------
|
|
|
|
# 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.
|
1997-02-04 09:53:45 +01:00
|
|
|
#
|
2000-08-31 18:12:35 +02:00
|
|
|
# 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.)
|
|
|
|
#------------------------------------------------------------------------------
|
1997-02-04 09:53:45 +01:00
|
|
|
|
2000-10-08 23:13:27 +02:00
|
|
|
|
|
|
|
##########################################################################
|
|
|
|
#
|
|
|
|
# Meta configuration
|
|
|
|
|
2013-09-11 20:34:28 +02:00
|
|
|
standard_targets = all install installdirs uninstall distprep clean distclean maintainer-clean coverage check installcheck init-po update-po
|
2011-07-03 19:55:02 +02:00
|
|
|
# these targets should recurse even into subdirectories not being built:
|
|
|
|
standard_always_targets = distprep clean distclean maintainer-clean
|
2010-11-12 21:15:16 +01:00
|
|
|
|
2013-09-11 20:34:28 +02:00
|
|
|
.PHONY: $(standard_targets) install-strip html man installcheck-parallel maintainer-check
|
2000-10-08 23:13:27 +02:00
|
|
|
|
|
|
|
# make `all' the default target
|
|
|
|
all:
|
|
|
|
|
2000-09-08 20:29:28 +02:00
|
|
|
# Delete target files if the command fails after it has
|
|
|
|
# started to update the file.
|
|
|
|
.DELETE_ON_ERROR:
|
|
|
|
|
2012-11-01 04:33:35 +01:00
|
|
|
# Never delete any intermediate files automatically.
|
|
|
|
.SECONDARY:
|
|
|
|
|
2000-07-02 17:21:27 +02:00
|
|
|
# PostgreSQL version number
|
2002-03-29 18:32:55 +01:00
|
|
|
VERSION = @PACKAGE_VERSION@
|
2008-12-11 08:34:09 +01:00
|
|
|
MAJORVERSION = @PG_MAJORVERSION@
|
2000-07-02 17:21:27 +02:00
|
|
|
|
2000-10-20 23:04:27 +02:00
|
|
|
# Support for VPATH builds
|
2002-03-29 18:32:55 +01:00
|
|
|
vpath_build = @vpath_build@
|
2000-10-20 23:04:27 +02:00
|
|
|
abs_top_srcdir = @abs_top_srcdir@
|
2000-07-09 15:14:19 +02:00
|
|
|
|
2002-03-29 18:32:55 +01:00
|
|
|
ifneq ($(vpath_build),yes)
|
2000-10-20 23:04:27 +02:00
|
|
|
top_srcdir = $(top_builddir)
|
2000-06-27 02:32:06 +02:00
|
|
|
srcdir = .
|
2002-03-29 18:32:55 +01:00
|
|
|
else # vpath_build = yes
|
2000-10-20 23:04:27 +02:00
|
|
|
top_srcdir = $(abs_top_srcdir)
|
2000-06-27 02:32:06 +02:00
|
|
|
srcdir = $(top_srcdir)/$(subdir)
|
|
|
|
VPATH = $(srcdir)
|
2000-10-20 23:04:27 +02:00
|
|
|
endif
|
1997-02-04 09:53:45 +01:00
|
|
|
|
2010-05-13 13:49:48 +02:00
|
|
|
vpathsearch = `for f in $(addsuffix /$(1),$(subst :, ,. $(VPATH))); do test -r $$f && echo $$f && break; done`
|
|
|
|
|
2002-03-29 18:32:55 +01:00
|
|
|
# Saved arguments from configure
|
|
|
|
configure_args = @configure_args@
|
|
|
|
|
2000-10-08 23:13:27 +02:00
|
|
|
|
|
|
|
##########################################################################
|
1997-02-04 09:53:45 +01:00
|
|
|
#
|
2000-10-08 23:13:27 +02:00
|
|
|
# Installation directories
|
2004-05-22 02:34:51 +02:00
|
|
|
#
|
|
|
|
# These are set by the equivalent --xxxdir configure options. We
|
|
|
|
# append "postgresql" to some of them, if the string does not already
|
|
|
|
# contain "pgsql" or "postgres", in order to avoid directory clutter.
|
2005-09-27 19:39:35 +02:00
|
|
|
#
|
|
|
|
# In a PGXS build, we cannot use the values inserted into Makefile.global
|
|
|
|
# by configure, since the installation tree may have been relocated.
|
|
|
|
# Instead get the path values from pg_config.
|
|
|
|
|
|
|
|
ifndef PGXS
|
|
|
|
|
2008-02-17 17:36:43 +01:00
|
|
|
# Note that prefix, exec_prefix, and datarootdir aren't defined in a PGXS build;
|
2005-09-27 19:39:35 +02:00
|
|
|
# makefiles may only use the derived variables such as bindir.
|
1997-02-04 09:53:45 +01:00
|
|
|
|
2000-10-08 23:13:27 +02:00
|
|
|
prefix := @prefix@
|
|
|
|
exec_prefix := @exec_prefix@
|
2008-02-17 17:36:43 +01:00
|
|
|
datarootdir := @datarootdir@
|
1998-10-30 05:54:06 +01:00
|
|
|
|
2000-10-08 23:13:27 +02:00
|
|
|
bindir := @bindir@
|
2000-03-08 02:58:46 +01:00
|
|
|
|
2000-10-08 23:13:27 +02:00
|
|
|
datadir := @datadir@
|
2004-05-22 02:34:51 +02:00
|
|
|
ifeq "$(findstring pgsql, $(datadir))" ""
|
|
|
|
ifeq "$(findstring postgres, $(datadir))" ""
|
|
|
|
override datadir := $(datadir)/postgresql
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2000-10-08 23:13:27 +02:00
|
|
|
sysconfdir := @sysconfdir@
|
2004-05-22 02:34:51 +02:00
|
|
|
ifeq "$(findstring pgsql, $(sysconfdir))" ""
|
|
|
|
ifeq "$(findstring postgres, $(sysconfdir))" ""
|
|
|
|
override sysconfdir := $(sysconfdir)/postgresql
|
|
|
|
endif
|
|
|
|
endif
|
2000-10-08 23:13:27 +02:00
|
|
|
|
|
|
|
libdir := @libdir@
|
2005-09-27 19:39:35 +02:00
|
|
|
|
2004-05-22 02:34:51 +02:00
|
|
|
pkglibdir = $(libdir)
|
|
|
|
ifeq "$(findstring pgsql, $(pkglibdir))" ""
|
|
|
|
ifeq "$(findstring postgres, $(pkglibdir))" ""
|
|
|
|
override pkglibdir := $(pkglibdir)/postgresql
|
|
|
|
endif
|
|
|
|
endif
|
2000-10-08 23:13:27 +02:00
|
|
|
|
|
|
|
includedir := @includedir@
|
2005-09-27 19:39:35 +02:00
|
|
|
|
2004-05-22 02:34:51 +02:00
|
|
|
pkgincludedir = $(includedir)
|
|
|
|
ifeq "$(findstring pgsql, $(pkgincludedir))" ""
|
|
|
|
ifeq "$(findstring postgres, $(pkgincludedir))" ""
|
|
|
|
override pkgincludedir := $(pkgincludedir)/postgresql
|
|
|
|
endif
|
|
|
|
endif
|
1997-02-04 09:53:45 +01:00
|
|
|
|
2000-10-08 23:13:27 +02:00
|
|
|
mandir := @mandir@
|
2000-06-27 02:32:06 +02:00
|
|
|
|
2000-10-08 23:13:27 +02:00
|
|
|
docdir := @docdir@
|
2004-05-22 02:34:51 +02:00
|
|
|
ifeq "$(findstring pgsql, $(docdir))" ""
|
|
|
|
ifeq "$(findstring postgres, $(docdir))" ""
|
|
|
|
override docdir := $(docdir)/postgresql
|
|
|
|
endif
|
|
|
|
endif
|
2008-02-17 17:36:43 +01:00
|
|
|
|
|
|
|
htmldir := @htmldir@
|
2000-06-27 02:32:06 +02:00
|
|
|
|
2001-06-02 20:25:18 +02:00
|
|
|
localedir := @localedir@
|
2001-05-25 16:28:58 +02:00
|
|
|
|
2005-09-27 19:39:35 +02:00
|
|
|
else # PGXS case
|
|
|
|
|
2007-06-27 00:05:04 +02:00
|
|
|
# Extension makefiles should set PG_CONFIG, but older ones might not
|
|
|
|
ifndef PG_CONFIG
|
2006-07-20 11:30:18 +02:00
|
|
|
PG_CONFIG = pg_config
|
2007-06-27 00:05:04 +02:00
|
|
|
endif
|
2006-07-20 11:30:18 +02:00
|
|
|
|
|
|
|
bindir := $(shell $(PG_CONFIG) --bindir)
|
|
|
|
datadir := $(shell $(PG_CONFIG) --sharedir)
|
|
|
|
sysconfdir := $(shell $(PG_CONFIG) --sysconfdir)
|
|
|
|
libdir := $(shell $(PG_CONFIG) --libdir)
|
|
|
|
pkglibdir := $(shell $(PG_CONFIG) --pkglibdir)
|
|
|
|
includedir := $(shell $(PG_CONFIG) --includedir)
|
|
|
|
pkgincludedir := $(shell $(PG_CONFIG) --pkgincludedir)
|
|
|
|
mandir := $(shell $(PG_CONFIG) --mandir)
|
|
|
|
docdir := $(shell $(PG_CONFIG) --docdir)
|
|
|
|
localedir := $(shell $(PG_CONFIG) --localedir)
|
2005-09-27 19:39:35 +02:00
|
|
|
|
|
|
|
endif # PGXS
|
|
|
|
|
|
|
|
# These derived path variables aren't separately configurable.
|
|
|
|
|
|
|
|
includedir_server = $(pkgincludedir)/server
|
|
|
|
includedir_internal = $(pkgincludedir)/internal
|
2004-07-30 14:26:40 +02:00
|
|
|
pgxsdir = $(pkglibdir)/pgxs
|
|
|
|
|
1998-10-06 07:42:58 +02:00
|
|
|
|
2000-10-08 23:13:27 +02:00
|
|
|
##########################################################################
|
1997-02-04 09:53:45 +01:00
|
|
|
#
|
2000-10-08 23:13:27 +02:00
|
|
|
# Features
|
1997-02-04 09:53:45 +01:00
|
|
|
#
|
2000-10-08 23:13:27 +02:00
|
|
|
# Records the choice of the various --enable-xxx and --with-xxx options.
|
1997-02-04 09:53:45 +01:00
|
|
|
|
2000-10-08 23:13:27 +02:00
|
|
|
with_perl = @with_perl@
|
|
|
|
with_python = @with_python@
|
|
|
|
with_tcl = @with_tcl@
|
2005-07-06 01:13:57 +02:00
|
|
|
with_openssl = @with_openssl@
|
2007-04-21 19:26:18 +02:00
|
|
|
with_ossp_uuid = @with_ossp_uuid@
|
2011-01-24 02:44:48 +01:00
|
|
|
with_selinux = @with_selinux@
|
2007-04-13 20:50:01 +02:00
|
|
|
with_libxml = @with_libxml@
|
2007-04-15 14:48:24 +02:00
|
|
|
with_libxslt = @with_libxslt@
|
2007-08-20 10:53:12 +02:00
|
|
|
with_system_tzdata = @with_system_tzdata@
|
2005-07-06 01:13:57 +02:00
|
|
|
with_zlib = @with_zlib@
|
2000-10-28 01:59:39 +02:00
|
|
|
enable_rpath = @enable_rpath@
|
2001-06-02 20:25:18 +02:00
|
|
|
enable_nls = @enable_nls@
|
2002-03-05 18:55:23 +01:00
|
|
|
enable_debug = @enable_debug@
|
2006-07-24 18:32:45 +02:00
|
|
|
enable_dtrace = @enable_dtrace@
|
2008-09-05 14:11:18 +02:00
|
|
|
enable_coverage = @enable_coverage@
|
2003-12-20 00:29:15 +01:00
|
|
|
enable_thread_safety = @enable_thread_safety@
|
1997-02-04 09:53:45 +01:00
|
|
|
|
2013-01-05 14:56:14 +01:00
|
|
|
python_enable_shared = @python_enable_shared@
|
2001-07-10 18:33:02 +02:00
|
|
|
python_includespec = @python_includespec@
|
2004-10-11 21:32:19 +02:00
|
|
|
python_libdir = @python_libdir@
|
2001-05-12 19:49:32 +02:00
|
|
|
python_libspec = @python_libspec@
|
2004-10-11 21:32:19 +02:00
|
|
|
python_additional_libs = @python_additional_libs@
|
2009-12-15 23:59:55 +01:00
|
|
|
python_majorversion = @python_majorversion@
|
2004-10-06 11:20:41 +02:00
|
|
|
python_version = @python_version@
|
2000-06-27 02:32:06 +02:00
|
|
|
|
2000-07-09 15:14:19 +02:00
|
|
|
krb_srvtab = @krb_srvtab@
|
|
|
|
|
2002-05-24 20:10:17 +02:00
|
|
|
TCLSH = @TCLSH@
|
|
|
|
TCL_LIB_FILE = @TCL_LIB_FILE@
|
|
|
|
TCL_LIBS = @TCL_LIBS@
|
|
|
|
TCL_LIB_SPEC = @TCL_LIB_SPEC@
|
2002-12-30 18:19:54 +01:00
|
|
|
TCL_INCLUDE_SPEC = @TCL_INCLUDE_SPEC@
|
2002-05-24 20:10:17 +02:00
|
|
|
TCL_SHARED_BUILD = @TCL_SHARED_BUILD@
|
|
|
|
TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@
|
|
|
|
|
2004-04-23 20:15:55 +02:00
|
|
|
PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
|
|
|
|
PTHREAD_LIBS = @PTHREAD_LIBS@
|
2003-05-27 18:36:50 +02:00
|
|
|
|
1997-02-04 09:53:45 +01:00
|
|
|
|
2000-10-08 23:13:27 +02:00
|
|
|
##########################################################################
|
1997-02-04 09:53:45 +01:00
|
|
|
#
|
2000-10-08 23:13:27 +02:00
|
|
|
# Programs and flags
|
1997-02-04 09:53:45 +01:00
|
|
|
|
2000-10-08 23:13:27 +02:00
|
|
|
# Compilers
|
2000-06-27 02:32:06 +02:00
|
|
|
|
2000-10-08 23:13:27 +02:00
|
|
|
CPP = @CPP@
|
|
|
|
CPPFLAGS = @CPPFLAGS@
|
2004-07-30 14:26:40 +02:00
|
|
|
|
|
|
|
ifdef PGXS
|
|
|
|
override CPPFLAGS := -I$(includedir_server) -I$(includedir_internal) $(CPPFLAGS)
|
|
|
|
else # not PGXS
|
2001-07-15 13:20:01 +02:00
|
|
|
override CPPFLAGS := -I$(top_srcdir)/src/include $(CPPFLAGS)
|
|
|
|
ifdef VPATH
|
|
|
|
override CPPFLAGS := -I$(top_builddir)/src/include $(CPPFLAGS)
|
|
|
|
endif
|
2004-07-30 14:26:40 +02:00
|
|
|
endif # not PGXS
|
2000-10-08 23:13:27 +02:00
|
|
|
|
2000-10-20 23:04:27 +02:00
|
|
|
CC = @CC@
|
|
|
|
GCC = @GCC@
|
2008-10-29 17:06:47 +01:00
|
|
|
SUN_STUDIO_CC = @SUN_STUDIO_CC@
|
2000-10-20 23:04:27 +02:00
|
|
|
CFLAGS = @CFLAGS@
|
2013-04-30 07:59:26 +02:00
|
|
|
CFLAGS_VECTOR = @CFLAGS_VECTOR@
|
2000-06-27 02:32:06 +02:00
|
|
|
|
2000-10-08 23:13:27 +02:00
|
|
|
# Kind-of compilers
|
1997-02-04 09:53:45 +01:00
|
|
|
|
2008-08-29 15:02:33 +02:00
|
|
|
BISON = @BISON@
|
|
|
|
BISONFLAGS = @BISONFLAGS@ $(YFLAGS)
|
2000-08-28 13:53:23 +02:00
|
|
|
FLEX = @FLEX@
|
|
|
|
FLEXFLAGS = @FLEXFLAGS@ $(LFLAGS)
|
2006-07-24 18:32:45 +02:00
|
|
|
DTRACE = @DTRACE@
|
|
|
|
DTRACEFLAGS = @DTRACEFLAGS@
|
2009-01-05 11:25:59 +01:00
|
|
|
ZIC = @ZIC@
|
2000-10-08 23:13:27 +02:00
|
|
|
|
|
|
|
# Linking
|
|
|
|
|
2008-12-07 09:36:22 +01:00
|
|
|
AR = @AR@
|
|
|
|
DLLTOOL = @DLLTOOL@
|
|
|
|
DLLWRAP = @DLLWRAP@
|
2000-10-08 23:13:27 +02:00
|
|
|
LIBS = @LIBS@
|
2006-09-09 05:15:40 +02:00
|
|
|
LDAP_LIBS_FE = @LDAP_LIBS_FE@
|
|
|
|
LDAP_LIBS_BE = @LDAP_LIBS_BE@
|
2007-11-13 01:13:19 +01:00
|
|
|
OSSP_UUID_LIBS = @OSSP_UUID_LIBS@
|
2000-10-21 01:57:34 +02:00
|
|
|
LD = @LD@
|
|
|
|
with_gnu_ld = @with_gnu_ld@
|
2000-11-09 19:18:42 +01:00
|
|
|
ld_R_works = @ld_R_works@
|
2010-07-07 00:03:05 +02:00
|
|
|
|
Create libpgcommon, and move pg_malloc et al to it
libpgcommon is a new static library to allow sharing code among the
various frontend programs and backend; this lets us eliminate duplicate
implementations of common routines. We avoid libpgport, because that's
intended as a place for porting issues; per discussion, it seems better
to keep them separate.
The first use case, and the only implemented by this patch, is pg_malloc
and friends, which many frontend programs were already using.
At the same time, we can use this to provide palloc emulation functions
for the frontend; this way, some palloc-using files in the backend can
also be used by the frontend cleanly. To do this, we change palloc() in
the backend to be a function instead of a macro on top of
MemoryContextAlloc(). This was previously believed to cause loss of
performance, but this implementation has been tweaked by Tom and Andres
so that on modern compilers it provides a slight improvement over the
previous one.
This lets us clean up some places that were already with
localized hacks.
Most of the pg_malloc/palloc changes in this patch were authored by
Andres Freund. Zoltán Böszörményi also independently provided a form of
that. libpgcommon infrastructure was authored by Álvaro.
2013-02-12 14:33:40 +01:00
|
|
|
# We want -L for libpgport.a and libpgcommon.a to be first in LDFLAGS. We
|
|
|
|
# also need LDFLAGS to be a "recursively expanded" variable, else adjustments
|
|
|
|
# to rpathdir don't work right. So we must NOT do LDFLAGS := something,
|
|
|
|
# meaning this has to be done first and elsewhere we must only do LDFLAGS +=
|
|
|
|
# something.
|
2010-07-07 00:03:05 +02:00
|
|
|
ifdef PGXS
|
|
|
|
LDFLAGS = -L$(libdir)
|
|
|
|
else
|
Create libpgcommon, and move pg_malloc et al to it
libpgcommon is a new static library to allow sharing code among the
various frontend programs and backend; this lets us eliminate duplicate
implementations of common routines. We avoid libpgport, because that's
intended as a place for porting issues; per discussion, it seems better
to keep them separate.
The first use case, and the only implemented by this patch, is pg_malloc
and friends, which many frontend programs were already using.
At the same time, we can use this to provide palloc emulation functions
for the frontend; this way, some palloc-using files in the backend can
also be used by the frontend cleanly. To do this, we change palloc() in
the backend to be a function instead of a macro on top of
MemoryContextAlloc(). This was previously believed to cause loss of
performance, but this implementation has been tweaked by Tom and Andres
so that on modern compilers it provides a slight improvement over the
previous one.
This lets us clean up some places that were already with
localized hacks.
Most of the pg_malloc/palloc changes in this patch were authored by
Andres Freund. Zoltán Böszörményi also independently provided a form of
that. libpgcommon infrastructure was authored by Álvaro.
2013-02-12 14:33:40 +01:00
|
|
|
LDFLAGS = -L$(top_builddir)/src/port -L$(top_builddir)/src/common
|
2010-07-07 00:03:05 +02:00
|
|
|
endif
|
|
|
|
LDFLAGS += @LDFLAGS@
|
|
|
|
|
2010-07-05 20:54:38 +02:00
|
|
|
LDFLAGS_EX = @LDFLAGS_EX@
|
2010-07-07 00:03:05 +02:00
|
|
|
# LDFLAGS_SL might have already been assigned by calling makefile
|
|
|
|
LDFLAGS_SL += @LDFLAGS_SL@
|
2000-10-08 23:13:27 +02:00
|
|
|
LDREL = -r
|
|
|
|
LDOUT = -o
|
|
|
|
RANLIB = @RANLIB@
|
2008-12-07 09:36:22 +01:00
|
|
|
WINDRES = @WINDRES@
|
2000-09-27 17:17:57 +02:00
|
|
|
X = @EXEEXT@
|
2000-06-27 02:32:06 +02:00
|
|
|
|
2010-11-23 21:27:50 +01:00
|
|
|
# Perl
|
2001-08-27 00:28:04 +02:00
|
|
|
|
2009-06-23 05:46:00 +02:00
|
|
|
ifneq (@PERL@,)
|
|
|
|
# quoted to protect pathname with spaces
|
2011-06-16 03:45:23 +02:00
|
|
|
PERL = '@PERL@'
|
2009-06-23 05:46:00 +02:00
|
|
|
else
|
|
|
|
PERL = $(missing) perl
|
|
|
|
endif
|
2002-05-28 18:57:53 +02:00
|
|
|
perl_archlibexp = @perl_archlibexp@
|
|
|
|
perl_privlibexp = @perl_privlibexp@
|
|
|
|
perl_useshrplib = @perl_useshrplib@
|
|
|
|
perl_embed_ldflags = @perl_embed_ldflags@
|
2001-08-27 00:28:04 +02:00
|
|
|
|
2000-10-08 23:13:27 +02:00
|
|
|
# Miscellaneous
|
|
|
|
|
|
|
|
AWK = @AWK@
|
|
|
|
LN_S = @LN_S@
|
2001-06-02 20:25:18 +02:00
|
|
|
MSGFMT = @MSGFMT@
|
2013-09-11 20:34:28 +02:00
|
|
|
MSGFMT_FLAGS = @MSGFMT_FLAGS@
|
2001-06-02 20:25:18 +02:00
|
|
|
MSGMERGE = @MSGMERGE@
|
2000-10-08 23:13:27 +02:00
|
|
|
PYTHON = @PYTHON@
|
|
|
|
TAR = @TAR@
|
2001-06-02 20:25:18 +02:00
|
|
|
XGETTEXT = @XGETTEXT@
|
2000-10-08 23:13:27 +02:00
|
|
|
|
2001-09-18 01:00:27 +02:00
|
|
|
GZIP = gzip
|
|
|
|
BZIP2 = bzip2
|
|
|
|
|
2014-04-15 03:33:46 +02:00
|
|
|
# Testing
|
|
|
|
|
|
|
|
PROVE = @PROVE@
|
|
|
|
PG_PROVE_FLAGS = --ext='.pl' -I $(top_srcdir)/src/test/perl/
|
|
|
|
PROVE_FLAGS = --verbose
|
|
|
|
|
|
|
|
define prove_installcheck
|
|
|
|
PATH="$(bindir):$$PATH" PGPORT='6$(DEF_PGPORT)' $(PROVE) $(PG_PROVE_FLAGS) $(PROVE_FLAGS)
|
|
|
|
endef
|
|
|
|
|
|
|
|
define prove_check
|
|
|
|
$(MKDIR_P) tmp_check/log
|
|
|
|
$(MAKE) -C $(top_builddir) DESTDIR=$(CURDIR)/tmp_check/install install >$(CURDIR)/tmp_check/log/install.log 2>&1
|
|
|
|
PATH="$(CURDIR)/tmp_check/install$(bindir):$$PATH" PGPORT='6$(DEF_PGPORT)' $(PROVE) $(PG_PROVE_FLAGS) $(PROVE_FLAGS)
|
|
|
|
endef
|
|
|
|
|
2000-10-08 23:13:27 +02:00
|
|
|
# Installation.
|
|
|
|
|
2012-06-28 19:05:36 +02:00
|
|
|
install_bin = @install_bin@
|
2012-06-27 12:40:51 +02:00
|
|
|
install_sh = $(SHELL) $(top_srcdir)/config/install-sh -c
|
2012-06-28 19:05:36 +02:00
|
|
|
INSTALL = $(if $(use_install_sh),$(install_sh),$(if $(install_bin),$(install_bin),$(install_sh)))
|
2000-10-08 23:13:27 +02:00
|
|
|
|
2005-03-26 00:22:54 +01:00
|
|
|
INSTALL_SCRIPT_MODE = 755
|
|
|
|
INSTALL_DATA_MODE = 644
|
2002-04-10 18:45:25 +02:00
|
|
|
INSTALL_PROGRAM = $(INSTALL_PROGRAM_ENV) $(INSTALL) $(INSTALL_STRIP_FLAG)
|
2005-03-26 00:22:54 +01:00
|
|
|
INSTALL_SCRIPT = $(INSTALL) -m $(INSTALL_SCRIPT_MODE)
|
|
|
|
INSTALL_DATA = $(INSTALL) -m $(INSTALL_DATA_MODE)
|
2002-04-10 18:45:25 +02:00
|
|
|
INSTALL_STLIB = $(INSTALL_STLIB_ENV) $(INSTALL_DATA) $(INSTALL_STRIP_FLAG)
|
|
|
|
INSTALL_SHLIB = $(INSTALL_SHLIB_ENV) $(INSTALL) $(INSTALL_SHLIB_OPTS) $(INSTALL_STRIP_FLAG)
|
2001-03-10 11:38:59 +01:00
|
|
|
# Override in Makefile.port if necessary
|
|
|
|
INSTALL_SHLIB_OPTS = -m 755
|
2000-10-08 23:13:27 +02:00
|
|
|
|
2009-08-27 00:24:44 +02:00
|
|
|
MKDIR_P = @MKDIR_P@
|
|
|
|
|
2000-10-08 23:13:27 +02:00
|
|
|
missing = $(SHELL) $(top_srcdir)/config/missing
|
1997-02-04 09:53:45 +01:00
|
|
|
|
2002-04-10 18:45:25 +02:00
|
|
|
STRIP = @STRIP@
|
|
|
|
STRIP_STATIC_LIB = @STRIP_STATIC_LIB@
|
|
|
|
STRIP_SHARED_LIB = @STRIP_SHARED_LIB@
|
|
|
|
|
2000-11-05 22:04:07 +01:00
|
|
|
# Documentation
|
|
|
|
|
2009-08-05 00:04:37 +02:00
|
|
|
have_docbook = @have_docbook@
|
|
|
|
COLLATEINDEX = @COLLATEINDEX@
|
|
|
|
DOCBOOKSTYLE = @DOCBOOKSTYLE@
|
|
|
|
JADE = @JADE@
|
|
|
|
NSGMLS = @NSGMLS@
|
|
|
|
OSX = @OSX@
|
|
|
|
XSLTPROC = @XSLTPROC@
|
2000-11-05 22:04:07 +01:00
|
|
|
|
2008-09-05 14:11:18 +02:00
|
|
|
# Code coverage
|
|
|
|
|
|
|
|
GCOV = @GCOV@
|
|
|
|
LCOV = @LCOV@
|
|
|
|
GENHTML = @GENHTML@
|
|
|
|
|
|
|
|
ifeq ($(enable_coverage),yes)
|
|
|
|
# ccache loses .gcno files
|
|
|
|
export CCACHE_DISABLE = 1
|
|
|
|
endif
|
|
|
|
|
2001-02-07 21:13:27 +01:00
|
|
|
# Feature settings
|
|
|
|
|
|
|
|
DEF_PGPORT = @default_port@
|
2001-06-02 20:25:18 +02:00
|
|
|
WANTED_LANGUAGES = @WANTED_LANGUAGES@
|
2001-02-07 21:13:27 +01:00
|
|
|
|
2000-10-08 23:13:27 +02:00
|
|
|
|
|
|
|
##########################################################################
|
1998-10-19 02:00:51 +02:00
|
|
|
#
|
|
|
|
# Additional platform-specific settings
|
|
|
|
#
|
|
|
|
|
2000-10-08 23:13:27 +02:00
|
|
|
# Name of the "template"
|
1998-10-19 02:00:51 +02:00
|
|
|
PORTNAME= @PORTNAME@
|
2000-09-29 19:17:41 +02:00
|
|
|
|
2009-01-05 10:54:13 +01:00
|
|
|
build_os = @build_os@
|
|
|
|
|
2000-09-29 19:17:41 +02:00
|
|
|
host_tuple = @host@
|
|
|
|
host_os = @host_os@
|
|
|
|
host_cpu = @host_cpu@
|
1998-10-19 02:00:51 +02:00
|
|
|
|
2003-09-07 05:36:03 +02:00
|
|
|
# Make HAVE_IPV6 available for initdb script creation
|
|
|
|
HAVE_IPV6= @HAVE_IPV6@
|
|
|
|
|
2003-05-11 22:50:53 +02:00
|
|
|
# The HP-UX port makefile, for one, needs access to this symbol
|
1998-11-29 06:30:25 +01:00
|
|
|
HAVE_POSIX_SIGNALS= @HAVE_POSIX_SIGNALS@
|
|
|
|
|
2000-10-08 23:13:27 +02:00
|
|
|
# This is mainly for use on FreeBSD, where we have both a.out and elf
|
|
|
|
# systems now. May be applicable to other systems to?
|
|
|
|
ELF_SYSTEM= @ELF_SYS@
|
|
|
|
|
2006-10-08 19:15:34 +02:00
|
|
|
# Backend stack size limit has to be hard-wired on Windows (it's in bytes)
|
|
|
|
WIN32_STACK_RLIMIT=4194304
|
|
|
|
|
2010-12-26 16:34:47 +01:00
|
|
|
# Set if we have a working win32 crashdump header
|
|
|
|
have_win32_dbghelp = @have_win32_dbghelp@
|
|
|
|
|
2000-10-08 23:13:27 +02:00
|
|
|
# Pull in platform-specific magic
|
2000-08-31 18:12:35 +02:00
|
|
|
include $(top_builddir)/src/Makefile.port
|
1997-03-25 08:16:36 +01:00
|
|
|
|
2004-11-19 01:41:39 +01:00
|
|
|
# Set up rpath if enabled. By default it will point to our libdir,
|
|
|
|
# but individual Makefiles can force other rpath paths if needed.
|
|
|
|
rpathdir = $(libdir)
|
|
|
|
|
2000-10-28 01:59:39 +02:00
|
|
|
ifeq ($(enable_rpath), yes)
|
|
|
|
LDFLAGS += $(rpath)
|
|
|
|
endif
|
2000-10-08 23:13:27 +02:00
|
|
|
|
2002-07-27 22:10:05 +02:00
|
|
|
|
2000-10-08 23:13:27 +02:00
|
|
|
##########################################################################
|
|
|
|
#
|
|
|
|
# Some variables needed to find some client interfaces
|
|
|
|
|
2004-08-20 22:13:10 +02:00
|
|
|
ifdef PGXS
|
|
|
|
# some contribs assumes headers and libs are in the source tree...
|
|
|
|
libpq_srcdir = $(includedir)
|
|
|
|
libpq_builddir = $(libdir)
|
|
|
|
else
|
2000-10-08 23:13:27 +02:00
|
|
|
libpq_srcdir = $(top_srcdir)/src/interfaces/libpq
|
|
|
|
libpq_builddir = $(top_builddir)/src/interfaces/libpq
|
2004-08-20 22:13:10 +02:00
|
|
|
endif
|
|
|
|
|
2006-09-11 00:07:02 +02:00
|
|
|
# This macro is for use by libraries linking to libpq. (Because libpgport
|
|
|
|
# isn't created with the same link flags as libpq, it can't be used.)
|
2007-02-09 16:56:00 +01:00
|
|
|
libpq = -L$(libpq_builddir) -lpq
|
2010-11-23 21:27:50 +01:00
|
|
|
|
2006-09-11 00:07:02 +02:00
|
|
|
# This macro is for use by client executables (not libraries) that use libpq.
|
Create libpgcommon, and move pg_malloc et al to it
libpgcommon is a new static library to allow sharing code among the
various frontend programs and backend; this lets us eliminate duplicate
implementations of common routines. We avoid libpgport, because that's
intended as a place for porting issues; per discussion, it seems better
to keep them separate.
The first use case, and the only implemented by this patch, is pg_malloc
and friends, which many frontend programs were already using.
At the same time, we can use this to provide palloc emulation functions
for the frontend; this way, some palloc-using files in the backend can
also be used by the frontend cleanly. To do this, we change palloc() in
the backend to be a function instead of a macro on top of
MemoryContextAlloc(). This was previously believed to cause loss of
performance, but this implementation has been tweaked by Tom and Andres
so that on modern compilers it provides a slight improvement over the
previous one.
This lets us clean up some places that were already with
localized hacks.
Most of the pg_malloc/palloc changes in this patch were authored by
Andres Freund. Zoltán Böszörményi also independently provided a form of
that. libpgcommon infrastructure was authored by Álvaro.
2013-02-12 14:33:40 +01:00
|
|
|
# We force clients to pull symbols from the non-shared libraries libpgport
|
|
|
|
# and libpgcommon rather than pulling some libpgport symbols from libpq just
|
|
|
|
# because libpq uses those functions too. This makes applications less
|
2005-03-25 19:17:14 +01:00
|
|
|
# dependent on changes in libpq's usage of pgport. To do this we link to
|
|
|
|
# pgport before libpq. This does cause duplicate -lpgport's to appear
|
|
|
|
# on client link lines.
|
|
|
|
ifdef PGXS
|
2013-10-16 05:03:42 +02:00
|
|
|
libpq_pgport = -L$(libdir) -lpgcommon -lpgport $(libpq)
|
2005-03-25 19:17:14 +01:00
|
|
|
else
|
2013-10-16 05:03:42 +02:00
|
|
|
libpq_pgport = -L$(top_builddir)/src/common -lpgcommon -L$(top_builddir)/src/port -lpgport $(libpq)
|
2005-03-25 19:17:14 +01:00
|
|
|
endif
|
|
|
|
|
2014-02-11 18:10:52 +01:00
|
|
|
# Cygwin seems to need ldap libraries to be mentioned here, too
|
|
|
|
ifeq ($(PORTNAME),cygwin)
|
|
|
|
libpq_pgport += $(LDAP_LIBS_FE)
|
|
|
|
endif
|
|
|
|
|
|
|
|
# If PGXS is not defined, build libpq and libpgport dependencies as required.
|
2013-07-01 18:53:05 +02:00
|
|
|
# If the build is with PGXS, then these are supposed to be already built and
|
|
|
|
# installed, and we just ensure that the expected files exist.
|
|
|
|
ifndef PGXS
|
2002-07-27 22:10:05 +02:00
|
|
|
submake-libpq:
|
|
|
|
$(MAKE) -C $(libpq_builddir) all
|
2013-07-01 18:53:05 +02:00
|
|
|
else
|
|
|
|
submake-libpq: $(libdir)/libpq.so ;
|
|
|
|
endif
|
2002-07-27 22:10:05 +02:00
|
|
|
|
2013-07-01 18:53:05 +02:00
|
|
|
ifndef PGXS
|
2002-07-27 22:10:05 +02:00
|
|
|
submake-libpgport:
|
|
|
|
$(MAKE) -C $(top_builddir)/src/port all
|
Create libpgcommon, and move pg_malloc et al to it
libpgcommon is a new static library to allow sharing code among the
various frontend programs and backend; this lets us eliminate duplicate
implementations of common routines. We avoid libpgport, because that's
intended as a place for porting issues; per discussion, it seems better
to keep them separate.
The first use case, and the only implemented by this patch, is pg_malloc
and friends, which many frontend programs were already using.
At the same time, we can use this to provide palloc emulation functions
for the frontend; this way, some palloc-using files in the backend can
also be used by the frontend cleanly. To do this, we change palloc() in
the backend to be a function instead of a macro on top of
MemoryContextAlloc(). This was previously believed to cause loss of
performance, but this implementation has been tweaked by Tom and Andres
so that on modern compilers it provides a slight improvement over the
previous one.
This lets us clean up some places that were already with
localized hacks.
Most of the pg_malloc/palloc changes in this patch were authored by
Andres Freund. Zoltán Böszörményi also independently provided a form of
that. libpgcommon infrastructure was authored by Álvaro.
2013-02-12 14:33:40 +01:00
|
|
|
$(MAKE) -C $(top_builddir)/src/common all
|
2013-07-01 18:53:05 +02:00
|
|
|
else
|
|
|
|
submake-libpgport: $(libdir)/libpgport.a $(libdir)/libpgcommon.a ;
|
|
|
|
endif
|
2002-07-27 22:10:05 +02:00
|
|
|
|
|
|
|
.PHONY: submake-libpq submake-libpgport
|
|
|
|
|
2000-10-08 23:13:27 +02:00
|
|
|
|
2011-02-14 20:52:32 +01:00
|
|
|
##########################################################################
|
|
|
|
#
|
|
|
|
# Testing support
|
|
|
|
|
|
|
|
PL_TESTDB = pl_regression
|
|
|
|
CONTRIB_TESTDB = contrib_regression
|
2012-12-11 17:52:45 +01:00
|
|
|
ifneq ($(MODULE_big),)
|
|
|
|
CONTRIB_TESTDB_MODULE = contrib_regression_$(MODULE_big)
|
2013-05-31 03:05:07 +02:00
|
|
|
else
|
2012-12-11 17:52:45 +01:00
|
|
|
ifneq ($(MODULES),)
|
|
|
|
CONTRIB_TESTDB_MODULE = contrib_regression_$(MODULES)
|
|
|
|
else
|
|
|
|
CONTRIB_TESTDB_MODULE = contrib_regression
|
|
|
|
endif
|
|
|
|
endif
|
2011-02-14 20:52:32 +01:00
|
|
|
|
2011-04-15 07:42:05 +02:00
|
|
|
ifdef NO_LOCALE
|
|
|
|
NOLOCALE += --no-locale
|
|
|
|
endif
|
|
|
|
|
|
|
|
pg_regress_locale_flags = $(if $(ENCODING),--encoding=$(ENCODING)) $(NOLOCALE)
|
|
|
|
|
2013-12-04 16:14:45 +01:00
|
|
|
pg_regress_check = $(top_builddir)/src/test/regress/pg_regress --inputdir=$(srcdir) --temp-install=./tmp_check --top-builddir=$(top_builddir) $(pg_regress_locale_flags) $(EXTRA_REGRESS_OPTS)
|
|
|
|
pg_regress_installcheck = $(top_builddir)/src/test/regress/pg_regress --inputdir=$(srcdir) --psqldir='$(PSQLDIR)' $(pg_regress_locale_flags) $(EXTRA_REGRESS_OPTS)
|
2011-02-14 20:52:32 +01:00
|
|
|
|
|
|
|
pg_regress_clean_files = results/ regression.diffs regression.out tmp_check/ log/
|
|
|
|
|
Introduce logical decoding.
This feature, building on previous commits, allows the write-ahead log
stream to be decoded into a series of logical changes; that is,
inserts, updates, and deletes and the transactions which contain them.
It is capable of handling decoding even across changes to the schema
of the effected tables. The output format is controlled by a
so-called "output plugin"; an example is included. To make use of
this in a real replication system, the output plugin will need to be
modified to produce output in the format appropriate to that system,
and to perform filtering.
Currently, information can be extracted from the logical decoding
system only via SQL; future commits will add the ability to stream
changes via walsender.
Andres Freund, with review and other contributions from many other
people, including Álvaro Herrera, Abhijit Menon-Sen, Peter Gheogegan,
Kevin Grittner, Robert Haas, Heikki Linnakangas, Fujii Masao, Abhijit
Menon-Sen, Michael Paquier, Simon Riggs, Craig Ringer, and Steve
Singer.
2014-03-03 22:32:18 +01:00
|
|
|
pg_isolation_regress_check = $(top_builddir)/src/test/isolation/pg_isolation_regress --inputdir=$(srcdir) --temp-install=./tmp_check --top-builddir=$(top_builddir) $(pg_regress_locale_flags)
|
|
|
|
pg_isolation_regress_installcheck = $(top_builddir)/src/test/isolation/pg_isolation_regress --inputdir=$(srcdir) --top-builddir=$(top_builddir) $(pg_regress_locale_flags)
|
2011-02-14 20:52:32 +01:00
|
|
|
|
2000-10-08 23:13:27 +02:00
|
|
|
##########################################################################
|
1997-03-25 08:16:36 +01:00
|
|
|
#
|
2000-10-08 23:13:27 +02:00
|
|
|
# Customization
|
1997-03-25 08:16:36 +01:00
|
|
|
#
|
1997-04-12 12:33:10 +02:00
|
|
|
# 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.
|
2000-10-08 23:13:27 +02:00
|
|
|
#
|
|
|
|
# NOTE: Makefile.custom is from the pre-Autoconf days of PostgreSQL.
|
|
|
|
# You are liable to shoot yourself in the foot if you use it without
|
|
|
|
# knowing exactly what you're doing. The preferred (and more
|
|
|
|
# reliable) method is to communicate what you want to do to the
|
|
|
|
# configure script, and leave the makefiles alone.
|
1997-03-25 08:16:36 +01:00
|
|
|
|
2000-10-08 23:13:27 +02:00
|
|
|
-include $(top_srcdir)/src/Makefile.custom
|
1997-02-04 09:53:45 +01:00
|
|
|
|
|
|
|
ifneq ($(CUSTOM_INSTALL),)
|
|
|
|
INSTALL= $(CUSTOM_INSTALL)
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq ($(CUSTOM_CC),)
|
|
|
|
CC= $(CUSTOM_CC)
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq ($(CUSTOM_COPT),)
|
|
|
|
COPT= $(CUSTOM_COPT)
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifdef COPT
|
2004-12-16 18:48:29 +01:00
|
|
|
CFLAGS += $(COPT)
|
|
|
|
LDFLAGS += $(COPT)
|
1997-02-04 09:53:45 +01:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifdef PROFILE
|
2004-12-16 18:48:29 +01:00
|
|
|
CFLAGS += $(PROFILE)
|
|
|
|
LDFLAGS += $(PROFILE)
|
1997-02-04 09:53:45 +01:00
|
|
|
endif
|
2000-06-27 02:32:06 +02:00
|
|
|
|
|
|
|
|
2000-10-08 23:13:27 +02:00
|
|
|
##########################################################################
|
|
|
|
#
|
2005-08-02 21:02:32 +02:00
|
|
|
# substitute implementations of C library routines (see src/port/)
|
2010-07-07 00:03:05 +02:00
|
|
|
# note we already included -L.../src/port in LDFLAGS above
|
2000-10-08 23:13:27 +02:00
|
|
|
|
2007-09-29 00:25:49 +02:00
|
|
|
LIBOBJS = @LIBOBJS@
|
2002-07-27 22:10:05 +02:00
|
|
|
|
2013-10-18 03:52:54 +02:00
|
|
|
LIBS := -lpgcommon -lpgport $(LIBS)
|
2002-03-13 01:05:06 +01:00
|
|
|
|
2005-01-26 20:24:03 +01:00
|
|
|
# to make ws2_32.lib the last library, and always link with shfolder,
|
|
|
|
# so SHGetFolderName isn't picked up from shell32.dll
|
Briefly,
* configure + Makefile changes
* shared memory attaching in EXEC_BACKEND case (+ minor fix for apparent
cygwin bug under cygwin/EXEC_BACKEND case only)
* PATH env var separator differences
* missing win32 rand functions added
* placeholder replacements for sync etc under port.h
To those who are really interested, and there are a few of you: the attached
patch + file will allow the source base to be compiled (and, for some
definition, "run") under MingW, with the following caveats (I wanted to
first properly fix all but the last of these, but y'all won't quit asking
for a patch :-):
* child death: SIGCHLD not yet sent, so as a minimum, you'll need to
put in some sort of delay after StartupDatabase, and handle setting
StartupPID to 0 etc (ie. the stuff the reaper() signal function is supposed
to do)
* dirmod.c: comment out the elog calls
* dfmgr.c: some hackage required to substitute_libpath_macro
* slru/xact.c: comment out the errno checking after the readdir
(fixed by next version of MingW)
Again, this is only if you *really* want to see postgres compile and start,
and is a nice leg-up for working on the other Win32 TODO list items. Just
don't expect too much else from it at this point...
Claudio Natoli
2004-02-02 01:11:31 +01:00
|
|
|
ifeq ($(PORTNAME),win32)
|
2005-01-26 20:24:03 +01:00
|
|
|
LIBS += -lws2_32 -lshfolder
|
Briefly,
* configure + Makefile changes
* shared memory attaching in EXEC_BACKEND case (+ minor fix for apparent
cygwin bug under cygwin/EXEC_BACKEND case only)
* PATH env var separator differences
* missing win32 rand functions added
* placeholder replacements for sync etc under port.h
To those who are really interested, and there are a few of you: the attached
patch + file will allow the source base to be compiled (and, for some
definition, "run") under MingW, with the following caveats (I wanted to
first properly fix all but the last of these, but y'all won't quit asking
for a patch :-):
* child death: SIGCHLD not yet sent, so as a minimum, you'll need to
put in some sort of delay after StartupDatabase, and handle setting
StartupPID to 0 etc (ie. the stuff the reaper() signal function is supposed
to do)
* dirmod.c: comment out the elog calls
* dfmgr.c: some hackage required to substitute_libpath_macro
* slru/xact.c: comment out the errno checking after the readdir
(fixed by next version of MingW)
Again, this is only if you *really* want to see postgres compile and start,
and is a nice leg-up for working on the other Win32 TODO list items. Just
don't expect too much else from it at this point...
Claudio Natoli
2004-02-02 01:11:31 +01:00
|
|
|
endif
|
|
|
|
|
2002-07-19 19:35:11 +02:00
|
|
|
# Not really standard libc functions, used by the backend.
|
2002-03-13 01:05:06 +01:00
|
|
|
TAS = @TAS@
|
2000-06-27 02:32:06 +02:00
|
|
|
|
2000-07-16 16:50:44 +02:00
|
|
|
|
2000-10-08 23:13:27 +02:00
|
|
|
##########################################################################
|
|
|
|
#
|
2001-09-18 01:00:27 +02:00
|
|
|
# Global targets and rules
|
|
|
|
|
2012-10-11 12:57:04 +02:00
|
|
|
%.c: %.l
|
|
|
|
ifdef FLEX
|
|
|
|
$(FLEX) $(if $(FLEX_NO_BACKUP),-b) $(FLEXFLAGS) -o'$@' $<
|
|
|
|
@$(if $(FLEX_NO_BACKUP),if [ `wc -l <lex.backup` -eq 1 ]; then rm lex.backup; else echo "Scanner requires backup; see lex.backup." 1>&2; exit 1; fi)
|
|
|
|
else
|
|
|
|
@$(missing) flex $< '$@'
|
|
|
|
endif
|
|
|
|
|
|
|
|
%.c: %.y
|
|
|
|
$(if $(BISON_CHECK_CMD),$(BISON_CHECK_CMD))
|
|
|
|
ifdef BISON
|
|
|
|
$(BISON) $(BISONFLAGS) -o $@ $<
|
|
|
|
else
|
|
|
|
@$(missing) bison $< $@
|
|
|
|
endif
|
|
|
|
|
2009-02-19 11:32:30 +01:00
|
|
|
%.i: %.c
|
|
|
|
$(CPP) $(CPPFLAGS) -o $@ $<
|
|
|
|
|
2001-09-18 01:00:27 +02:00
|
|
|
%.gz: %
|
2009-11-03 22:28:10 +01:00
|
|
|
$(GZIP) --best -c $< >$@
|
2001-09-18 01:00:27 +02:00
|
|
|
|
|
|
|
%.bz2: %
|
2009-11-03 22:28:10 +01:00
|
|
|
$(BZIP2) -c $< >$@
|
2000-07-19 18:30:27 +02:00
|
|
|
|
2012-02-02 19:24:38 +01:00
|
|
|
# Direct builds of foo.c -> foo are disabled to avoid generating
|
|
|
|
# *.dSYM junk on Macs. All builds should normally go through the
|
|
|
|
# foo.c -> foo.o -> foo steps. This also ensures that dependency
|
|
|
|
# tracking (see below) is used.
|
|
|
|
%: %.c
|
|
|
|
|
2004-07-30 14:26:40 +02:00
|
|
|
ifndef PGXS
|
|
|
|
|
2000-07-19 18:30:27 +02:00
|
|
|
# Remake Makefile.global from Makefile.global.in if the latter
|
|
|
|
# changed. In order to trigger this rule, the including file must
|
|
|
|
# write `include $(top_builddir)/src/Makefile.global', not some
|
|
|
|
# shortcut thereof.
|
2000-07-16 16:50:44 +02:00
|
|
|
$(top_builddir)/src/Makefile.global: $(top_srcdir)/src/Makefile.global.in $(top_builddir)/config.status
|
2002-03-29 18:32:55 +01:00
|
|
|
cd $(top_builddir) && ./config.status src/Makefile.global
|
2000-07-16 16:50:44 +02:00
|
|
|
|
2001-08-24 16:07:50 +02:00
|
|
|
# Remake pg_config.h from pg_config.h.in if the latter changed.
|
|
|
|
# config.status will not change the timestamp on pg_config.h if it
|
2000-07-19 18:30:27 +02:00
|
|
|
# doesn't change, so as to avoid recompiling the entire tree
|
2000-12-29 21:39:09 +01:00
|
|
|
# unnecessarily. Therefore we make config.status update a timestamp file
|
2012-04-24 04:43:09 +02:00
|
|
|
# stamp-h every time it runs, so that we don't trigger this rule every time.
|
|
|
|
# (We do trigger the null rule for stamp-h to pg_config.h every time; so it's
|
2012-05-07 20:28:38 +02:00
|
|
|
# important for that rule to be empty!)
|
2000-07-19 18:30:27 +02:00
|
|
|
#
|
|
|
|
# Of course you need to turn on dependency tracking to get any
|
2001-08-24 16:07:50 +02:00
|
|
|
# dependencies on pg_config.h.
|
2012-05-07 20:28:38 +02:00
|
|
|
$(top_builddir)/src/include/pg_config.h: $(top_builddir)/src/include/stamp-h ;
|
2000-12-29 21:39:09 +01:00
|
|
|
|
2001-08-24 16:07:50 +02:00
|
|
|
$(top_builddir)/src/include/stamp-h: $(top_srcdir)/src/include/pg_config.h.in $(top_builddir)/config.status
|
2002-03-29 18:32:55 +01:00
|
|
|
cd $(top_builddir) && ./config.status src/include/pg_config.h
|
2000-07-19 18:30:27 +02:00
|
|
|
|
2012-10-08 03:52:07 +02:00
|
|
|
# Also remake pg_config_ext.h from pg_config_ext.h.in, same logic as above.
|
|
|
|
$(top_builddir)/src/include/pg_config_ext.h: $(top_builddir)/src/include/stamp-ext-h ;
|
|
|
|
|
|
|
|
$(top_builddir)/src/include/stamp-ext-h: $(top_srcdir)/src/include/pg_config_ext.h.in $(top_builddir)/config.status
|
|
|
|
cd $(top_builddir) && ./config.status src/include/pg_config_ext.h
|
|
|
|
|
2010-11-23 21:27:50 +01:00
|
|
|
# Also remake ecpg_config.h from ecpg_config.h.in if the latter changed, same
|
2009-01-22 23:27:13 +01:00
|
|
|
# logic as above.
|
2012-05-07 20:28:38 +02:00
|
|
|
$(top_builddir)/src/interfaces/ecpg/include/ecpg_config.h: $(top_builddir)/src/interfaces/ecpg/include/stamp-h ;
|
2009-01-22 23:27:13 +01:00
|
|
|
|
|
|
|
$(top_builddir)/src/interfaces/ecpg/include/stamp-h: $(top_builddir)/src/interfaces/ecpg/include/ecpg_config.h.in $(top_builddir)/config.status
|
2006-08-23 14:01:53 +02:00
|
|
|
cd $(top_builddir) && ./config.status src/interfaces/ecpg/include/ecpg_config.h
|
|
|
|
|
2000-07-19 18:30:27 +02:00
|
|
|
# When configure changes, rerun configure with the same options as
|
|
|
|
# last time. To change configure, you need to run autoconf manually.
|
2000-07-16 16:50:44 +02:00
|
|
|
$(top_builddir)/config.status: $(top_srcdir)/configure
|
|
|
|
cd $(top_builddir) && ./config.status --recheck
|
|
|
|
|
2004-07-30 14:26:40 +02:00
|
|
|
endif # not PGXS
|
|
|
|
|
2000-07-16 16:50:44 +02:00
|
|
|
|
2002-04-10 18:45:25 +02:00
|
|
|
install-strip:
|
2012-06-27 12:40:51 +02:00
|
|
|
# install-strip always uses install-sh, so that strip options can be
|
|
|
|
# passed.
|
|
|
|
$(MAKE) use_install_sh=yes \
|
|
|
|
INSTALL_PROGRAM_ENV="STRIPPROG='$(STRIP)'" \
|
2002-04-10 18:45:25 +02:00
|
|
|
INSTALL_STLIB_ENV="STRIPPROG='$(STRIP_STATIC_LIB)'" \
|
|
|
|
INSTALL_SHLIB_ENV="STRIPPROG='$(STRIP_SHARED_LIB)'" \
|
|
|
|
INSTALL_STRIP_FLAG=-s \
|
|
|
|
install
|
|
|
|
|
|
|
|
|
2010-11-12 21:15:16 +01:00
|
|
|
##########################################################################
|
|
|
|
#
|
|
|
|
# Recursive make support
|
|
|
|
# ----------------------
|
|
|
|
# Instead of recursing through subdirectories with a for loop or
|
|
|
|
# repeated $(MAKE) -C whatever calls, this is a little smarter: it
|
|
|
|
# allows parallel make across directories and lets make -k and -q work
|
|
|
|
# correctly.
|
|
|
|
|
2010-11-14 18:50:06 +01:00
|
|
|
# We need the $(eval) function and order-only prerequisites, which are
|
|
|
|
# available in GNU make 3.80. That also happens to be the version
|
|
|
|
# where the .VARIABLES variable was introduced, so this is a simple check.
|
|
|
|
ifndef .VARIABLES
|
|
|
|
$(error GNU make 3.80 or newer is required. You are using version $(MAKE_VERSION))
|
|
|
|
endif
|
|
|
|
|
2010-11-12 21:15:16 +01:00
|
|
|
# This function is only for internal use below. It should be called
|
2010-11-14 18:50:06 +01:00
|
|
|
# using $(eval). It will set up a target so that it recurses into
|
|
|
|
# a given subdirectory. Note that to avoid a nasty bug in make 3.80,
|
2010-11-15 07:00:48 +01:00
|
|
|
# this function has to avoid using any complicated constructs (like
|
|
|
|
# multiple targets on a line) and also not contain any lines that expand
|
|
|
|
# to more than about 200 bytes. This is why we make it apply to just one
|
|
|
|
# subdirectory at a time, rather than to a list of subdirectories.
|
2010-11-12 21:15:16 +01:00
|
|
|
# $1: target name, e.g., all
|
2010-11-14 18:50:06 +01:00
|
|
|
# $2: subdir name
|
2010-11-12 21:15:16 +01:00
|
|
|
# $3: target to run in subdir, usually same as $1
|
|
|
|
define _create_recursive_target
|
2010-11-14 18:50:06 +01:00
|
|
|
.PHONY: $(1)-$(2)-recurse
|
|
|
|
$(1): $(1)-$(2)-recurse
|
|
|
|
$(1)-$(2)-recurse:
|
|
|
|
$$(MAKE) -C $(2) $(3)
|
2010-11-12 21:15:16 +01:00
|
|
|
endef
|
|
|
|
# Note that the use of $$ on the last line above is important; we want
|
2010-11-14 18:50:06 +01:00
|
|
|
# $(MAKE) to be evaluated when the rule is run, not when the $(eval) is run
|
|
|
|
# to create the rule. This is necessary to get make -q working.
|
2010-11-12 21:15:16 +01:00
|
|
|
|
2010-11-14 18:50:06 +01:00
|
|
|
# Call this function in a makefile that needs to recurse into subdirectories.
|
|
|
|
# In the normal case all arguments can be defaulted.
|
2010-11-12 21:15:16 +01:00
|
|
|
# $1: targets to make recursive (defaults to list of standard targets)
|
|
|
|
# $2: list of subdirs (defaults to SUBDIRS variable)
|
2010-11-14 18:50:06 +01:00
|
|
|
# $3: target to run in subdir (defaults to current element of $1)
|
|
|
|
recurse = $(foreach target,$(if $1,$1,$(standard_targets)),$(foreach subdir,$(if $2,$2,$(SUBDIRS)),$(eval $(call _create_recursive_target,$(target),$(subdir),$(if $3,$3,$(target))))))
|
2010-11-12 21:15:16 +01:00
|
|
|
|
2011-07-03 19:55:02 +02:00
|
|
|
# If a makefile's list of SUBDIRS varies depending on configuration, then
|
|
|
|
# any subdirectories excluded from SUBDIRS should instead be added to
|
|
|
|
# ALWAYS_SUBDIRS, and then it must call recurse_always as well as recurse.
|
|
|
|
# This ensures that distprep, distclean, etc will apply to all subdirectories.
|
|
|
|
# In the normal case all arguments will be defaulted.
|
|
|
|
# $1: targets to make recursive (defaults to standard_always_targets)
|
|
|
|
# $2: list of subdirs (defaults to ALWAYS_SUBDIRS variable)
|
|
|
|
# $3: target to run in subdir (defaults to current element of $1)
|
|
|
|
recurse_always = $(foreach target,$(if $1,$1,$(standard_always_targets)),$(foreach subdir,$(if $2,$2,$(ALWAYS_SUBDIRS)),$(eval $(call _create_recursive_target,$(target),$(subdir),$(if $3,$3,$(target))))))
|
|
|
|
|
2010-11-12 21:15:16 +01:00
|
|
|
|
2000-10-08 23:13:27 +02:00
|
|
|
##########################################################################
|
|
|
|
#
|
2000-07-16 16:50:44 +02:00
|
|
|
# Automatic dependency generation
|
|
|
|
# -------------------------------
|
|
|
|
# When we configure with --enable-depend then we override the default
|
|
|
|
# compilation rule with the magic below. While or after creating the
|
|
|
|
# actual output file we also create a dependency list for the .c file.
|
|
|
|
# Next time we invoke make we will have top-notch information about
|
|
|
|
# whether this file needs to be updated. The dependency files are kept
|
|
|
|
# in the .deps subdirectory of each directory.
|
|
|
|
|
|
|
|
autodepend = @autodepend@
|
|
|
|
|
2000-09-08 20:29:28 +02:00
|
|
|
ifeq ($(autodepend), yes)
|
2000-07-16 16:50:44 +02:00
|
|
|
|
2000-10-29 17:13:28 +01:00
|
|
|
ifndef COMPILE.c
|
|
|
|
COMPILE.c = $(CC) $(CFLAGS) $(CPPFLAGS) -c
|
|
|
|
endif
|
|
|
|
|
2000-07-16 16:50:44 +02:00
|
|
|
DEPDIR = .deps
|
2000-10-29 17:13:28 +01:00
|
|
|
|
2000-07-16 16:50:44 +02:00
|
|
|
ifeq ($(GCC), yes)
|
|
|
|
|
|
|
|
# GCC allows us to create object and dependency file in one invocation.
|
|
|
|
%.o : %.c
|
2006-07-22 00:37:37 +02:00
|
|
|
@if test ! -d $(DEPDIR); then mkdir -p $(DEPDIR); fi
|
|
|
|
$(COMPILE.c) -o $@ $< -MMD -MP -MF $(DEPDIR)/$(*F).Po
|
2000-07-16 16:50:44 +02:00
|
|
|
|
|
|
|
endif # GCC
|
|
|
|
|
|
|
|
# Include all the dependency files generated for the current
|
2013-04-13 04:45:51 +02:00
|
|
|
# directory. Note that make would complain if include was called with
|
|
|
|
# no arguments.
|
|
|
|
Po_files := $(wildcard $(DEPDIR)/*.Po)
|
|
|
|
ifneq (,$(Po_files))
|
|
|
|
include $(Po_files)
|
|
|
|
endif
|
2000-07-16 16:50:44 +02:00
|
|
|
|
|
|
|
# hook for clean-up
|
2000-07-22 03:48:53 +02:00
|
|
|
clean distclean maintainer-clean: clean-deps
|
2000-07-16 16:50:44 +02:00
|
|
|
|
|
|
|
.PHONY: clean-deps
|
|
|
|
clean-deps:
|
2006-07-22 00:37:37 +02:00
|
|
|
@rm -rf $(DEPDIR)
|
2000-07-16 16:50:44 +02:00
|
|
|
|
|
|
|
endif # autodepend
|
2001-06-02 20:25:18 +02:00
|
|
|
|
|
|
|
|
|
|
|
##########################################################################
|
|
|
|
#
|
|
|
|
# Native language support
|
|
|
|
|
|
|
|
ifeq ($(enable_nls), yes)
|
|
|
|
ifneq (,$(wildcard $(srcdir)/nls.mk))
|
|
|
|
|
|
|
|
include $(top_srcdir)/src/nls-global.mk
|
|
|
|
|
|
|
|
endif # nls.mk
|
|
|
|
endif # enable_nls
|
2008-09-05 14:11:18 +02:00
|
|
|
|
|
|
|
|
|
|
|
##########################################################################
|
|
|
|
#
|
|
|
|
# Coverage
|
|
|
|
|
2008-10-03 17:35:17 +02:00
|
|
|
# Explanation of involved files:
|
|
|
|
# foo.c source file
|
|
|
|
# foo.o object file
|
|
|
|
# foo.gcno gcov graph (a.k.a. "notes") file, created at compile time
|
|
|
|
# (by gcc -ftest-coverage)
|
|
|
|
# foo.gcda gcov data file, created when the program is run (for
|
|
|
|
# programs compiled with gcc -fprofile-arcs)
|
|
|
|
# foo.c.gcov gcov output file with coverage information, created by
|
|
|
|
# gcov from foo.gcda (by "make coverage")
|
|
|
|
# foo.c.gcov.out stdout captured when foo.c.gcov is created, mildly
|
|
|
|
# interesting
|
|
|
|
# lcov.info lcov tracefile, built from gcda files in one directory,
|
|
|
|
# later collected by "make coverage-html"
|
|
|
|
|
2008-09-05 14:11:18 +02:00
|
|
|
ifeq ($(enable_coverage), yes)
|
|
|
|
|
|
|
|
# There is a strange interaction between lcov and existing .gcov
|
|
|
|
# output files. Hence the rm command and the ordering dependency.
|
|
|
|
|
|
|
|
gcda_files := $(wildcard *.gcda)
|
|
|
|
|
2008-10-03 17:35:17 +02:00
|
|
|
lcov.info: $(gcda_files)
|
2008-09-05 14:11:18 +02:00
|
|
|
rm -f *.gcov
|
2014-04-15 03:52:03 +02:00
|
|
|
$(if $^,$(LCOV) -d . -c -o $@ $(LCOVFLAGS) --gcov-tool $(GCOV))
|
2008-09-05 14:11:18 +02:00
|
|
|
|
|
|
|
%.c.gcov: %.gcda | lcov.info
|
|
|
|
$(GCOV) -b -f -p -o . $(GCOVFLAGS) $*.c >$*.c.gcov.out
|
|
|
|
|
2009-08-07 22:50:22 +02:00
|
|
|
coverage: $(gcda_files:.gcda=.c.gcov) lcov.info
|
|
|
|
|
|
|
|
.PHONY: coverage-html
|
|
|
|
coverage-html: coverage
|
|
|
|
rm -rf coverage
|
|
|
|
mkdir coverage
|
|
|
|
$(GENHTML) --show-details --legend --output-directory=coverage --title=PostgreSQL --num-spaces=4 --prefix=$(abs_top_srcdir) `find . -name lcov.info -print`
|
|
|
|
|
2008-09-05 14:11:18 +02:00
|
|
|
|
|
|
|
# hook for clean-up
|
|
|
|
clean distclean maintainer-clean: clean-coverage
|
|
|
|
|
|
|
|
.PHONY: clean-coverage
|
|
|
|
clean-coverage:
|
2009-08-07 22:50:22 +02:00
|
|
|
rm -rf coverage
|
2008-09-05 14:11:18 +02:00
|
|
|
rm -f *.gcda *.gcno lcov.info *.gcov *.gcov.out
|
|
|
|
|
|
|
|
|
|
|
|
# User-callable target to reset counts between test runs
|
|
|
|
coverage-clean:
|
|
|
|
rm -f `find . -name '*.gcda' -print`
|
|
|
|
|
|
|
|
endif # enable_coverage
|