1996-07-09 08:22:35 +02:00
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
#
|
2000-07-06 23:33:45 +02:00
|
|
|
# Makefile for the postgres backend
|
1996-07-09 08:22:35 +02:00
|
|
|
#
|
2018-01-03 05:30:12 +01:00
|
|
|
# Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group
|
2007-08-21 03:11:32 +02:00
|
|
|
# Portions Copyright (c) 1994, Regents of the University of California
|
1996-07-09 08:22:35 +02:00
|
|
|
#
|
2010-09-20 22:08:53 +02:00
|
|
|
# src/backend/Makefile
|
1996-07-09 08:22:35 +02:00
|
|
|
#
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
|
2006-06-18 17:38:37 +02:00
|
|
|
PGFILEDESC = "PostgreSQL Server"
|
2010-05-13 01:48:36 +02:00
|
|
|
# This is a daemon process, which is why it is not labeled as an executable
|
2010-05-12 23:42:21 +02:00
|
|
|
#PGAPPICON=win32
|
2010-05-12 13:33:10 +02:00
|
|
|
|
2000-07-06 23:33:45 +02:00
|
|
|
subdir = src/backend
|
|
|
|
top_builddir = ../..
|
2000-08-31 18:12:35 +02:00
|
|
|
include $(top_builddir)/src/Makefile.global
|
1996-07-09 08:22:35 +02:00
|
|
|
|
2008-12-19 17:25:19 +01:00
|
|
|
SUBDIRS = access bootstrap catalog parser commands executor foreign lib libpq \
|
Faster partition pruning
Add a new module backend/partitioning/partprune.c, implementing a more
sophisticated algorithm for partition pruning. The new module uses each
partition's "boundinfo" for pruning instead of constraint exclusion,
based on an idea proposed by Robert Haas of a "pruning program": a list
of steps generated from the query quals which are run iteratively to
obtain a list of partitions that must be scanned in order to satisfy
those quals.
At present, this targets planner-time partition pruning, but there exist
further patches to apply partition pruning at execution time as well.
This commit also moves some definitions from include/catalog/partition.h
to a new file include/partitioning/partbounds.h, in an attempt to
rationalize partitioning related code.
Authors: Amit Langote, David Rowley, Dilip Kumar
Reviewers: Robert Haas, Kyotaro Horiguchi, Ashutosh Bapat, Jesper Pedersen.
Discussion: https://postgr.es/m/098b9c71-1915-1a2a-8d52-1a7a50ce79e8@lab.ntt.co.jp
2018-04-06 21:23:04 +02:00
|
|
|
main nodes optimizer partitioning port postmaster \
|
|
|
|
regex replication rewrite \
|
2018-03-22 03:28:28 +01:00
|
|
|
statistics storage tcop tsearch utils $(top_builddir)/src/timezone \
|
|
|
|
jit
|
2004-04-30 18:08:01 +02:00
|
|
|
|
2008-02-25 18:55:42 +01:00
|
|
|
include $(srcdir)/common.mk
|
2005-07-28 06:31:30 +02:00
|
|
|
|
2010-01-21 00:12:03 +01:00
|
|
|
# As of 1/2010:
|
|
|
|
# The probes.o file is necessary for dtrace support on Solaris, and on recent
|
|
|
|
# versions of systemtap. (Older systemtap releases just produce an empty
|
Refer to OS X as "macOS", except for the port name which is still "darwin".
We weren't terribly consistent about whether to call Apple's OS "OS X"
or "Mac OS X", and the former is probably confusing to people who aren't
Apple users. Now that Apple has rebranded it "macOS", follow their lead
to establish a consistent naming pattern. Also, avoid the use of the
ancient project name "Darwin", except as the port code name which does not
seem desirable to change. (In short, this patch touches documentation and
comments, but no actual code.)
I didn't touch contrib/start-scripts/osx/, either. I suspect those are
obsolete and due for a rewrite, anyway.
I dithered about whether to apply this edit to old release notes, but
those were responsible for quite a lot of the inconsistencies, so I ended
up changing them too. Anyway, Apple's being ahistorical about this,
so why shouldn't we be?
2016-09-25 21:40:57 +02:00
|
|
|
# file, but that's okay.) However, macOS's dtrace doesn't use it and doesn't
|
|
|
|
# even recognize the -G option. So, build probes.o except on macOS.
|
2010-01-21 00:12:03 +01:00
|
|
|
# This might need adjustment as other platforms add dtrace support.
|
|
|
|
ifneq ($(PORTNAME), darwin)
|
2006-07-24 18:32:45 +02:00
|
|
|
ifeq ($(enable_dtrace), yes)
|
|
|
|
LOCALOBJS += utils/probes.o
|
|
|
|
endif
|
2009-09-05 23:14:04 +02:00
|
|
|
endif
|
2006-07-24 18:32:45 +02:00
|
|
|
|
2013-02-22 02:46:17 +01:00
|
|
|
OBJS = $(SUBDIROBJS) $(LOCALOBJS) $(top_builddir)/src/port/libpgport_srv.a \
|
|
|
|
$(top_builddir)/src/common/libpgcommon_srv.a
|
2005-07-28 06:31:30 +02:00
|
|
|
|
2013-02-22 02:46:17 +01:00
|
|
|
# We put libpgport and libpgcommon into OBJS, so remove it from LIBS; also add
|
2017-08-21 06:22:18 +02:00
|
|
|
# libldap and ICU
|
|
|
|
LIBS := $(filter-out -lpgport -lpgcommon, $(LIBS)) $(LDAP_LIBS_BE) $(ICU_LIBS)
|
2000-05-29 07:45:56 +02:00
|
|
|
|
2005-11-28 23:06:39 +01:00
|
|
|
# The backend doesn't need everything that's in LIBS, however
|
2005-11-28 23:43:30 +01:00
|
|
|
LIBS := $(filter-out -lz -lreadline -ledit -ltermcap -lncurses -lcurses, $(LIBS))
|
2005-11-28 23:06:39 +01:00
|
|
|
|
2015-11-17 12:46:17 +01:00
|
|
|
ifeq ($(with_systemd),yes)
|
|
|
|
LIBS += -lsystemd
|
|
|
|
endif
|
|
|
|
|
2000-07-06 23:33:45 +02:00
|
|
|
##########################################################################
|
1999-01-17 07:20:06 +01:00
|
|
|
|
2010-01-05 02:06:57 +01:00
|
|
|
all: submake-libpgport submake-schemapg postgres $(POSTGRES_IMP)
|
1998-01-04 20:13:04 +01:00
|
|
|
|
2003-03-21 18:18:34 +01:00
|
|
|
ifneq ($(PORTNAME), cygwin)
|
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
|
|
|
ifneq ($(PORTNAME), win32)
|
2005-10-27 22:45:29 +02:00
|
|
|
ifneq ($(PORTNAME), aix)
|
2000-05-29 07:45:56 +02:00
|
|
|
|
2000-07-13 18:07:14 +02:00
|
|
|
postgres: $(OBJS)
|
2017-08-21 06:22:18 +02:00
|
|
|
$(CC) $(CFLAGS) $(LDFLAGS) $(LDFLAGS_EX) $(export_dynamic) $(call expand_subsys,$^) $(LIBS) -o $@
|
2000-05-29 07:45:56 +02:00
|
|
|
|
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
|
|
|
|
endif
|
2005-10-27 22:45:29 +02:00
|
|
|
endif
|
2000-05-29 07:45:56 +02:00
|
|
|
|
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), cygwin)
|
2005-10-27 22:45:29 +02:00
|
|
|
|
2014-02-11 18:10:52 +01:00
|
|
|
postgres: $(OBJS)
|
|
|
|
$(CC) $(CFLAGS) $(LDFLAGS) $(LDFLAGS_EX) $(export_dynamic) -Wl,--stack,$(WIN32_STACK_RLIMIT) -Wl,--export-all-symbols -Wl,--out-implib=libpostgres.a $(call expand_subsys,$^) $(LIBS) -o $@
|
2002-09-05 20:28:46 +02:00
|
|
|
|
Fix make rules that generate multiple output files.
For years, our makefiles have correctly observed that "there is no correct
way to write a rule that generates two files". However, what we did is to
provide empty rules that "generate" the secondary output files from the
primary one, and that's not right either. Depending on the details of
the creating process, the primary file might end up timestamped later than
one or more secondary files, causing subsequent make runs to consider the
secondary file(s) out of date. That's harmless in a plain build, since
make will just re-execute the empty rule and nothing happens. But it's
fatal in a VPATH build, since make will expect the secondary file to be
rebuilt in the build directory. This would manifest as "file not found"
failures during VPATH builds from tarballs, if we were ever unlucky enough
to ship a tarball with apparently out-of-date secondary files. (It's not
clear whether that has ever actually happened, but it definitely could.)
To ensure that secondary output files have timestamps >= their primary's,
change our makefile convention to be that we provide a "touch $@" action
not an empty rule. Also, make sure that this rule actually gets invoked
during a distprep run, else the hazard remains.
It's been like this a long time, so back-patch to all supported branches.
In HEAD, I skipped the changes in src/backend/catalog/Makefile, because
those rules are due to get replaced soon in the bootstrap data format
patch, and there seems no need to create a merge issue for that patch.
If for some reason we fail to land that patch in v11, we'll need to
back-fill the changes in that one makefile from v10.
Discussion: https://postgr.es/m/18556.1521668179@sss.pgh.pa.us
2018-03-23 18:45:37 +01:00
|
|
|
# libpostgres.a is actually built in the preceding rule, but we need this to
|
|
|
|
# ensure it's newer than postgres; see notes in src/backend/parser/Makefile
|
|
|
|
libpostgres.a: postgres
|
|
|
|
touch $@
|
1999-01-17 07:20:06 +01:00
|
|
|
|
2003-03-21 18:18:34 +01:00
|
|
|
endif # cygwin
|
2000-07-06 23:33:45 +02:00
|
|
|
|
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)
|
2007-07-24 11:00:27 +02:00
|
|
|
LIBS += -lsecur32
|
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
|
|
|
|
2014-02-11 18:56:20 +01:00
|
|
|
postgres: $(OBJS) $(WIN32RES)
|
|
|
|
$(CC) $(CFLAGS) $(LDFLAGS) $(LDFLAGS_EX) -Wl,--stack=$(WIN32_STACK_RLIMIT) -Wl,--export-all-symbols -Wl,--out-implib=libpostgres.a $(call expand_subsys,$(OBJS)) $(WIN32RES) $(LIBS) -o $@$(X)
|
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
|
|
|
|
Fix make rules that generate multiple output files.
For years, our makefiles have correctly observed that "there is no correct
way to write a rule that generates two files". However, what we did is to
provide empty rules that "generate" the secondary output files from the
primary one, and that's not right either. Depending on the details of
the creating process, the primary file might end up timestamped later than
one or more secondary files, causing subsequent make runs to consider the
secondary file(s) out of date. That's harmless in a plain build, since
make will just re-execute the empty rule and nothing happens. But it's
fatal in a VPATH build, since make will expect the secondary file to be
rebuilt in the build directory. This would manifest as "file not found"
failures during VPATH builds from tarballs, if we were ever unlucky enough
to ship a tarball with apparently out-of-date secondary files. (It's not
clear whether that has ever actually happened, but it definitely could.)
To ensure that secondary output files have timestamps >= their primary's,
change our makefile convention to be that we provide a "touch $@" action
not an empty rule. Also, make sure that this rule actually gets invoked
during a distprep run, else the hazard remains.
It's been like this a long time, so back-patch to all supported branches.
In HEAD, I skipped the changes in src/backend/catalog/Makefile, because
those rules are due to get replaced soon in the bootstrap data format
patch, and there seems no need to create a merge issue for that patch.
If for some reason we fail to land that patch in v11, we'll need to
back-fill the changes in that one makefile from v10.
Discussion: https://postgr.es/m/18556.1521668179@sss.pgh.pa.us
2018-03-23 18:45:37 +01:00
|
|
|
# libpostgres.a is actually built in the preceding rule, but we need this to
|
|
|
|
# ensure it's newer than postgres; see notes in src/backend/parser/Makefile
|
|
|
|
libpostgres.a: postgres
|
|
|
|
touch $@
|
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 # win32
|
|
|
|
|
2002-10-09 18:21:54 +02:00
|
|
|
ifeq ($(PORTNAME), aix)
|
|
|
|
|
|
|
|
postgres: $(POSTGRES_IMP)
|
2015-07-16 03:00:26 +02:00
|
|
|
$(CC) $(CFLAGS) $(LDFLAGS) $(LDFLAGS_EX) $(call expand_subsys,$(OBJS)) -Wl,-bE:$(top_builddir)/src/backend/$(POSTGRES_IMP) $(LIBS) -Wl,-brtllib -o $@
|
2002-10-09 18:21:54 +02:00
|
|
|
|
|
|
|
$(POSTGRES_IMP): $(OBJS)
|
2008-02-25 18:55:42 +01:00
|
|
|
$(LD) $(LDREL) $(LDOUT) SUBSYS.o $(call expand_subsys,$^)
|
2002-10-09 18:21:54 +02:00
|
|
|
ifeq ($(host_os), aix3.2.5)
|
|
|
|
$(MKLDEXPORT) SUBSYS.o $(bindir)/postgres > $@
|
|
|
|
else
|
|
|
|
ifneq (,$(findstring aix4.1, $(host_os)))
|
|
|
|
$(MKLDEXPORT) SUBSYS.o $(bindir)/postgres > $@
|
|
|
|
else
|
|
|
|
$(MKLDEXPORT) SUBSYS.o . > $@
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
@rm -f SUBSYS.o
|
|
|
|
|
|
|
|
endif # aix
|
1997-03-12 21:44:57 +01:00
|
|
|
|
2000-07-13 18:07:14 +02:00
|
|
|
# Update the commonly used headers before building the subdirectories
|
2016-07-01 21:08:55 +02:00
|
|
|
$(SUBDIRS:%=%-recursive): | generated-headers
|
2010-01-05 02:06:57 +01:00
|
|
|
|
2016-07-01 21:08:55 +02:00
|
|
|
# src/port needs a convenient way to force just errcodes.h to get built
|
2011-02-04 15:28:06 +01:00
|
|
|
submake-errcodes: $(top_builddir)/src/include/utils/errcodes.h
|
|
|
|
|
2016-07-01 21:08:55 +02:00
|
|
|
.PHONY: submake-errcodes
|
2010-11-12 21:15:16 +01:00
|
|
|
|
|
|
|
$(top_builddir)/src/port/libpgport_srv.a: | submake-libpgport
|
2010-01-05 02:20:35 +01:00
|
|
|
|
2000-07-06 23:33:45 +02:00
|
|
|
|
1996-11-23 10:51:57 +01:00
|
|
|
# The postgres.o target is needed by the rule in Makefile.global that
|
|
|
|
# creates the exports file when MAKE_EXPORTS = true.
|
|
|
|
postgres.o: $(OBJS)
|
2010-07-05 20:54:38 +02:00
|
|
|
$(CC) $(LDREL) $(LDFLAGS) $(LDFLAGS_EX) $(call expand_subsys,$^) $(LIBS) -o $@
|
2000-05-29 07:45:56 +02:00
|
|
|
|
|
|
|
|
2000-07-06 23:33:45 +02:00
|
|
|
# The following targets are specified in make commands that appear in
|
|
|
|
# the make files in our subdirectories. Note that it's important we
|
|
|
|
# match the dependencies shown in the subdirectory makefiles!
|
Fix make rules that generate multiple output files.
For years, our makefiles have correctly observed that "there is no correct
way to write a rule that generates two files". However, what we did is to
provide empty rules that "generate" the secondary output files from the
primary one, and that's not right either. Depending on the details of
the creating process, the primary file might end up timestamped later than
one or more secondary files, causing subsequent make runs to consider the
secondary file(s) out of date. That's harmless in a plain build, since
make will just re-execute the empty rule and nothing happens. But it's
fatal in a VPATH build, since make will expect the secondary file to be
rebuilt in the build directory. This would manifest as "file not found"
failures during VPATH builds from tarballs, if we were ever unlucky enough
to ship a tarball with apparently out-of-date secondary files. (It's not
clear whether that has ever actually happened, but it definitely could.)
To ensure that secondary output files have timestamps >= their primary's,
change our makefile convention to be that we provide a "touch $@" action
not an empty rule. Also, make sure that this rule actually gets invoked
during a distprep run, else the hazard remains.
It's been like this a long time, so back-patch to all supported branches.
In HEAD, I skipped the changes in src/backend/catalog/Makefile, because
those rules are due to get replaced soon in the bootstrap data format
patch, and there seems no need to create a merge issue for that patch.
If for some reason we fail to land that patch in v11, we'll need to
back-fill the changes in that one makefile from v10.
Discussion: https://postgr.es/m/18556.1521668179@sss.pgh.pa.us
2018-03-23 18:45:37 +01:00
|
|
|
# Also, in cases where a subdirectory makefile generates two files in
|
|
|
|
# what's really one step, such as bison producing both gram.h and gram.c,
|
|
|
|
# we must request making the one that is shown as the secondary (dependent)
|
|
|
|
# output, else the timestamp on it might be wrong. By project convention,
|
|
|
|
# the .h file is the dependent one for bison output, so we need only request
|
|
|
|
# that; but in other cases, request both for safety.
|
1996-11-23 10:51:57 +01:00
|
|
|
|
2009-08-28 22:26:19 +02:00
|
|
|
parser/gram.h: parser/gram.y
|
2008-08-29 15:02:33 +02:00
|
|
|
$(MAKE) -C parser gram.h
|
1996-07-09 08:22:35 +02:00
|
|
|
|
2015-09-11 19:58:28 +02:00
|
|
|
storage/lmgr/lwlocknames.h: storage/lmgr/generate-lwlocknames.pl storage/lmgr/lwlocknames.txt
|
Fix make rules that generate multiple output files.
For years, our makefiles have correctly observed that "there is no correct
way to write a rule that generates two files". However, what we did is to
provide empty rules that "generate" the secondary output files from the
primary one, and that's not right either. Depending on the details of
the creating process, the primary file might end up timestamped later than
one or more secondary files, causing subsequent make runs to consider the
secondary file(s) out of date. That's harmless in a plain build, since
make will just re-execute the empty rule and nothing happens. But it's
fatal in a VPATH build, since make will expect the secondary file to be
rebuilt in the build directory. This would manifest as "file not found"
failures during VPATH builds from tarballs, if we were ever unlucky enough
to ship a tarball with apparently out-of-date secondary files. (It's not
clear whether that has ever actually happened, but it definitely could.)
To ensure that secondary output files have timestamps >= their primary's,
change our makefile convention to be that we provide a "touch $@" action
not an empty rule. Also, make sure that this rule actually gets invoked
during a distprep run, else the hazard remains.
It's been like this a long time, so back-patch to all supported branches.
In HEAD, I skipped the changes in src/backend/catalog/Makefile, because
those rules are due to get replaced soon in the bootstrap data format
patch, and there seems no need to create a merge issue for that patch.
If for some reason we fail to land that patch in v11, we'll need to
back-fill the changes in that one makefile from v10.
Discussion: https://postgr.es/m/18556.1521668179@sss.pgh.pa.us
2018-03-23 18:45:37 +01:00
|
|
|
$(MAKE) -C storage/lmgr lwlocknames.h lwlocknames.c
|
2015-09-11 19:58:28 +02:00
|
|
|
|
2011-02-04 15:28:06 +01:00
|
|
|
utils/errcodes.h: utils/generate-errcodes.pl utils/errcodes.txt
|
|
|
|
$(MAKE) -C utils errcodes.h
|
|
|
|
|
Fix make rules that generate multiple output files.
For years, our makefiles have correctly observed that "there is no correct
way to write a rule that generates two files". However, what we did is to
provide empty rules that "generate" the secondary output files from the
primary one, and that's not right either. Depending on the details of
the creating process, the primary file might end up timestamped later than
one or more secondary files, causing subsequent make runs to consider the
secondary file(s) out of date. That's harmless in a plain build, since
make will just re-execute the empty rule and nothing happens. But it's
fatal in a VPATH build, since make will expect the secondary file to be
rebuilt in the build directory. This would manifest as "file not found"
failures during VPATH builds from tarballs, if we were ever unlucky enough
to ship a tarball with apparently out-of-date secondary files. (It's not
clear whether that has ever actually happened, but it definitely could.)
To ensure that secondary output files have timestamps >= their primary's,
change our makefile convention to be that we provide a "touch $@" action
not an empty rule. Also, make sure that this rule actually gets invoked
during a distprep run, else the hazard remains.
It's been like this a long time, so back-patch to all supported branches.
In HEAD, I skipped the changes in src/backend/catalog/Makefile, because
those rules are due to get replaced soon in the bootstrap data format
patch, and there seems no need to create a merge issue for that patch.
If for some reason we fail to land that patch in v11, we'll need to
back-fill the changes in that one makefile from v10.
Discussion: https://postgr.es/m/18556.1521668179@sss.pgh.pa.us
2018-03-23 18:45:37 +01:00
|
|
|
# see notes in src/backend/parser/Makefile
|
|
|
|
utils/fmgrprotos.h: utils/fmgroids.h
|
|
|
|
touch $@
|
2017-01-23 21:36:27 +01:00
|
|
|
|
|
|
|
utils/fmgroids.h: utils/Gen_fmgrtab.pl catalog/Catalog.pm $(top_srcdir)/src/include/catalog/pg_proc.h
|
Fix make rules that generate multiple output files.
For years, our makefiles have correctly observed that "there is no correct
way to write a rule that generates two files". However, what we did is to
provide empty rules that "generate" the secondary output files from the
primary one, and that's not right either. Depending on the details of
the creating process, the primary file might end up timestamped later than
one or more secondary files, causing subsequent make runs to consider the
secondary file(s) out of date. That's harmless in a plain build, since
make will just re-execute the empty rule and nothing happens. But it's
fatal in a VPATH build, since make will expect the secondary file to be
rebuilt in the build directory. This would manifest as "file not found"
failures during VPATH builds from tarballs, if we were ever unlucky enough
to ship a tarball with apparently out-of-date secondary files. (It's not
clear whether that has ever actually happened, but it definitely could.)
To ensure that secondary output files have timestamps >= their primary's,
change our makefile convention to be that we provide a "touch $@" action
not an empty rule. Also, make sure that this rule actually gets invoked
during a distprep run, else the hazard remains.
It's been like this a long time, so back-patch to all supported branches.
In HEAD, I skipped the changes in src/backend/catalog/Makefile, because
those rules are due to get replaced soon in the bootstrap data format
patch, and there seems no need to create a merge issue for that patch.
If for some reason we fail to land that patch in v11, we'll need to
back-fill the changes in that one makefile from v10.
Discussion: https://postgr.es/m/18556.1521668179@sss.pgh.pa.us
2018-03-23 18:45:37 +01:00
|
|
|
$(MAKE) -C utils fmgroids.h fmgrprotos.h
|
2016-07-01 21:08:55 +02:00
|
|
|
|
2008-03-17 20:44:41 +01:00
|
|
|
utils/probes.h: utils/probes.d
|
|
|
|
$(MAKE) -C utils probes.h
|
|
|
|
|
2016-07-01 21:08:55 +02:00
|
|
|
# run this unconditionally to avoid needing to know its dependencies here:
|
|
|
|
catalog/schemapg.h: | submake-schemapg
|
|
|
|
|
|
|
|
submake-schemapg:
|
|
|
|
$(MAKE) -C catalog schemapg.h
|
|
|
|
|
|
|
|
.PHONY: submake-schemapg
|
|
|
|
|
2000-07-06 23:33:45 +02:00
|
|
|
# Make symlinks for these headers in the include directory. That way
|
|
|
|
# we can cut down on the -I options. Also, a symlink is automatically
|
|
|
|
# up to date when we update the base file.
|
2010-01-05 02:06:57 +01:00
|
|
|
#
|
|
|
|
# The point of the prereqdir incantation in some of the rules below is to
|
|
|
|
# force the symlink to use an absolute path rather than a relative path.
|
|
|
|
# For headers which are generated by make distprep, the actual header within
|
|
|
|
# src/backend will be in the source tree, while the symlink in src/include
|
|
|
|
# will be in the build tree, so a simple ../.. reference won't work.
|
|
|
|
# For headers generated during regular builds, we prefer a relative symlink.
|
1999-11-14 18:12:42 +01:00
|
|
|
|
2016-07-01 21:08:55 +02:00
|
|
|
.PHONY: generated-headers
|
|
|
|
|
2016-12-28 18:00:00 +01:00
|
|
|
generated-headers: $(top_builddir)/src/include/parser/gram.h $(top_builddir)/src/include/catalog/schemapg.h $(top_builddir)/src/include/storage/lwlocknames.h $(top_builddir)/src/include/utils/errcodes.h $(top_builddir)/src/include/utils/fmgroids.h $(top_builddir)/src/include/utils/fmgrprotos.h $(top_builddir)/src/include/utils/probes.h
|
2016-07-01 21:08:55 +02:00
|
|
|
|
2009-08-28 22:26:19 +02:00
|
|
|
$(top_builddir)/src/include/parser/gram.h: parser/gram.h
|
2011-06-16 03:45:23 +02:00
|
|
|
prereqdir=`cd '$(dir $<)' >/dev/null && pwd` && \
|
|
|
|
cd '$(dir $@)' && rm -f $(notdir $@) && \
|
2001-11-20 01:27:13 +01:00
|
|
|
$(LN_S) "$$prereqdir/$(notdir $<)" .
|
2000-05-29 07:45:56 +02:00
|
|
|
|
2010-01-05 02:06:57 +01:00
|
|
|
$(top_builddir)/src/include/catalog/schemapg.h: catalog/schemapg.h
|
2011-06-16 03:45:23 +02:00
|
|
|
prereqdir=`cd '$(dir $<)' >/dev/null && pwd` && \
|
|
|
|
cd '$(dir $@)' && rm -f $(notdir $@) && \
|
2010-01-05 02:06:57 +01:00
|
|
|
$(LN_S) "$$prereqdir/$(notdir $<)" .
|
|
|
|
|
2015-09-11 19:58:28 +02:00
|
|
|
$(top_builddir)/src/include/storage/lwlocknames.h: storage/lmgr/lwlocknames.h
|
|
|
|
prereqdir=`cd '$(dir $<)' >/dev/null && pwd` && \
|
|
|
|
cd '$(dir $@)' && rm -f $(notdir $@) && \
|
|
|
|
$(LN_S) "$$prereqdir/$(notdir $<)" .
|
|
|
|
|
2011-02-04 15:28:06 +01:00
|
|
|
$(top_builddir)/src/include/utils/errcodes.h: utils/errcodes.h
|
2011-06-22 19:08:08 +02:00
|
|
|
prereqdir=`cd '$(dir $<)' >/dev/null && pwd` && \
|
|
|
|
cd '$(dir $@)' && rm -f $(notdir $@) && \
|
|
|
|
$(LN_S) "$$prereqdir/$(notdir $<)" .
|
2011-02-04 15:28:06 +01:00
|
|
|
|
2000-07-06 23:33:45 +02:00
|
|
|
$(top_builddir)/src/include/utils/fmgroids.h: utils/fmgroids.h
|
2011-06-16 03:45:23 +02:00
|
|
|
prereqdir=`cd '$(dir $<)' >/dev/null && pwd` && \
|
|
|
|
cd '$(dir $@)' && rm -f $(notdir $@) && \
|
2010-01-05 02:06:57 +01:00
|
|
|
$(LN_S) "$$prereqdir/$(notdir $<)" .
|
1999-11-14 18:12:42 +01:00
|
|
|
|
2016-12-28 18:00:00 +01:00
|
|
|
$(top_builddir)/src/include/utils/fmgrprotos.h: utils/fmgrprotos.h
|
|
|
|
prereqdir=`cd '$(dir $<)' >/dev/null && pwd` && \
|
|
|
|
cd '$(dir $@)' && rm -f $(notdir $@) && \
|
|
|
|
$(LN_S) "$$prereqdir/$(notdir $<)" .
|
|
|
|
|
2008-03-17 20:44:41 +01:00
|
|
|
$(top_builddir)/src/include/utils/probes.h: utils/probes.h
|
2011-06-16 03:45:23 +02:00
|
|
|
cd '$(dir $@)' && rm -f $(notdir $@) && \
|
|
|
|
$(LN_S) "../../../$(subdir)/utils/probes.h" .
|
2000-07-06 23:33:45 +02:00
|
|
|
|
2008-03-17 20:44:41 +01:00
|
|
|
|
2015-10-15 19:16:03 +02:00
|
|
|
utils/probes.o: utils/probes.d $(SUBDIROBJS)
|
|
|
|
$(DTRACE) $(DTRACEFLAGS) -C -G -s $(call expand_subsys,$^) -o $@
|
2006-07-24 18:32:45 +02:00
|
|
|
|
|
|
|
|
2000-07-19 18:30:27 +02:00
|
|
|
##########################################################################
|
|
|
|
|
2011-03-10 06:03:26 +01:00
|
|
|
# Be sure that these files get removed by the maintainer-clean target
|
2000-07-19 18:30:27 +02:00
|
|
|
distprep:
|
2008-08-29 15:02:33 +02:00
|
|
|
$(MAKE) -C parser gram.c gram.h scan.c
|
|
|
|
$(MAKE) -C bootstrap bootparse.c bootscanner.c
|
2010-01-05 02:06:57 +01:00
|
|
|
$(MAKE) -C catalog schemapg.h postgres.bki postgres.description postgres.shdescription
|
Support multiple synchronous standby servers.
Previously synchronous replication offered only the ability to confirm
that all changes made by a transaction had been transferred to at most
one synchronous standby server.
This commit extends synchronous replication so that it supports multiple
synchronous standby servers. It enables users to consider one or more
standby servers as synchronous, and increase the level of transaction
durability by ensuring that transaction commits wait for replies from
all of those synchronous standbys.
Multiple synchronous standby servers are configured in
synchronous_standby_names which is extended to support new syntax of
'num_sync ( standby_name [ , ... ] )', where num_sync specifies
the number of synchronous standbys that transaction commits need to
wait for replies from and standby_name is the name of a standby
server.
The syntax of 'standby_name [ , ... ]' which was used in 9.5 or before
is also still supported. It's the same as new syntax with num_sync=1.
This commit doesn't include "quorum commit" feature which was discussed
in pgsql-hackers. Synchronous standbys are chosen based on their priorities.
synchronous_standby_names determines the priority of each standby for
being chosen as a synchronous standby. The standbys whose names appear
earlier in the list are given higher priority and will be considered as
synchronous. Other standby servers appearing later in this list
represent potential synchronous standbys.
The regression test for multiple synchronous standbys is not included
in this commit. It should come later.
Authors: Sawada Masahiko, Beena Emerson, Michael Paquier, Fujii Masao
Reviewed-By: Kyotaro Horiguchi, Amit Kapila, Robert Haas, Simon Riggs,
Amit Langote, Thomas Munro, Sameer Thakur, Suraj Kharage, Abhijit Menon-Sen,
Rajeev Rastogi
Many thanks to the various individuals who were involved in
discussing and developing this feature.
2016-04-06 10:18:25 +02:00
|
|
|
$(MAKE) -C replication repl_gram.c repl_scanner.c syncrep_gram.c syncrep_scanner.c
|
Fix make rules that generate multiple output files.
For years, our makefiles have correctly observed that "there is no correct
way to write a rule that generates two files". However, what we did is to
provide empty rules that "generate" the secondary output files from the
primary one, and that's not right either. Depending on the details of
the creating process, the primary file might end up timestamped later than
one or more secondary files, causing subsequent make runs to consider the
secondary file(s) out of date. That's harmless in a plain build, since
make will just re-execute the empty rule and nothing happens. But it's
fatal in a VPATH build, since make will expect the secondary file to be
rebuilt in the build directory. This would manifest as "file not found"
failures during VPATH builds from tarballs, if we were ever unlucky enough
to ship a tarball with apparently out-of-date secondary files. (It's not
clear whether that has ever actually happened, but it definitely could.)
To ensure that secondary output files have timestamps >= their primary's,
change our makefile convention to be that we provide a "touch $@" action
not an empty rule. Also, make sure that this rule actually gets invoked
during a distprep run, else the hazard remains.
It's been like this a long time, so back-patch to all supported branches.
In HEAD, I skipped the changes in src/backend/catalog/Makefile, because
those rules are due to get replaced soon in the bootstrap data format
patch, and there seems no need to create a merge issue for that patch.
If for some reason we fail to land that patch in v11, we'll need to
back-fill the changes in that one makefile from v10.
Discussion: https://postgr.es/m/18556.1521668179@sss.pgh.pa.us
2018-03-23 18:45:37 +01:00
|
|
|
$(MAKE) -C storage/lmgr lwlocknames.h lwlocknames.c
|
2016-12-28 18:00:00 +01:00
|
|
|
$(MAKE) -C utils fmgrtab.c fmgroids.h fmgrprotos.h errcodes.h
|
2000-07-19 18:30:27 +02:00
|
|
|
$(MAKE) -C utils/misc guc-file.c
|
2012-02-15 18:13:32 +01:00
|
|
|
$(MAKE) -C utils/sort qsort_tuple.c
|
2002-08-21 22:42:27 +02:00
|
|
|
|
2000-07-19 18:30:27 +02:00
|
|
|
|
2000-07-06 23:33:45 +02:00
|
|
|
##########################################################################
|
|
|
|
|
2000-07-08 04:40:27 +02:00
|
|
|
install: all installdirs install-bin
|
2003-03-21 18:18:34 +01:00
|
|
|
ifeq ($(PORTNAME), cygwin)
|
1999-01-17 07:20:06 +01:00
|
|
|
ifeq ($(MAKE_DLL), true)
|
2005-12-09 22:19:36 +01:00
|
|
|
$(INSTALL_DATA) libpostgres.a '$(DESTDIR)$(libdir)/libpostgres.a'
|
1999-01-17 07:20:06 +01:00
|
|
|
endif
|
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
|
|
|
|
ifeq ($(PORTNAME), win32)
|
|
|
|
ifeq ($(MAKE_DLL), true)
|
2005-12-09 22:19:36 +01:00
|
|
|
$(INSTALL_DATA) libpostgres.a '$(DESTDIR)$(libdir)/libpostgres.a'
|
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
|
1999-01-17 07:20:06 +01:00
|
|
|
endif
|
2002-12-14 01:24:35 +01:00
|
|
|
$(MAKE) -C catalog install-data
|
2007-08-21 03:11:32 +02:00
|
|
|
$(MAKE) -C tsearch install-data
|
2018-04-05 05:05:40 +02:00
|
|
|
$(MAKE) -C utils install-data
|
2005-12-09 22:19:36 +01:00
|
|
|
$(INSTALL_DATA) $(srcdir)/libpq/pg_hba.conf.sample '$(DESTDIR)$(datadir)/pg_hba.conf.sample'
|
|
|
|
$(INSTALL_DATA) $(srcdir)/libpq/pg_ident.conf.sample '$(DESTDIR)$(datadir)/pg_ident.conf.sample'
|
|
|
|
$(INSTALL_DATA) $(srcdir)/utils/misc/postgresql.conf.sample '$(DESTDIR)$(datadir)/postgresql.conf.sample'
|
|
|
|
$(INSTALL_DATA) $(srcdir)/access/transam/recovery.conf.sample '$(DESTDIR)$(datadir)/recovery.conf.sample'
|
1996-10-27 10:55:05 +01:00
|
|
|
|
2018-03-28 22:19:08 +02:00
|
|
|
ifeq ($(with_llvm), yes)
|
|
|
|
install-bin: install-postgres-bitcode
|
|
|
|
|
|
|
|
install-postgres-bitcode: $(OBJS) all
|
|
|
|
$(call install_llvm_module,postgres,$(call expand_subsys, $(filter-out $(top_builddir)/src/timezone/objfiles.txt, $(SUBDIROBJS))))
|
|
|
|
endif
|
|
|
|
|
2000-07-19 18:30:27 +02:00
|
|
|
install-bin: postgres $(POSTGRES_IMP) installdirs
|
2005-12-09 22:19:36 +01:00
|
|
|
$(INSTALL_PROGRAM) postgres$(X) '$(DESTDIR)$(bindir)/postgres$(X)'
|
2003-11-11 04:53:33 +01:00
|
|
|
ifneq ($(PORTNAME), win32)
|
2005-12-09 22:19:36 +01:00
|
|
|
@rm -f '$(DESTDIR)$(bindir)/postmaster$(X)'
|
|
|
|
ln -s postgres$(X) '$(DESTDIR)$(bindir)/postmaster$(X)'
|
2003-11-11 04:53:33 +01:00
|
|
|
else
|
2005-12-09 22:19:36 +01:00
|
|
|
$(INSTALL_PROGRAM) postgres$(X) '$(DESTDIR)$(bindir)/postmaster$(X)'
|
2003-11-11 04:53:33 +01:00
|
|
|
endif
|
2000-07-08 04:40:27 +02:00
|
|
|
ifeq ($(MAKE_EXPORTS), true)
|
2005-12-09 22:19:36 +01:00
|
|
|
$(INSTALL_DATA) $(POSTGRES_IMP) '$(DESTDIR)$(pkglibdir)/$(POSTGRES_IMP)'
|
2012-10-10 03:04:06 +02:00
|
|
|
$(INSTALL_PROGRAM) $(MKLDEXPORT) '$(DESTDIR)$(pgxsdir)/$(MKLDEXPORT_DIR)/mkldexport.sh'
|
2000-07-08 04:40:27 +02:00
|
|
|
endif
|
|
|
|
|
2000-07-19 18:30:27 +02:00
|
|
|
.PHONY: install-bin
|
1996-10-27 10:55:05 +01:00
|
|
|
|
2001-09-16 18:11:11 +02:00
|
|
|
installdirs:
|
2009-08-27 00:24:44 +02:00
|
|
|
$(MKDIR_P) '$(DESTDIR)$(bindir)' '$(DESTDIR)$(datadir)'
|
2003-03-21 18:18:34 +01:00
|
|
|
ifeq ($(PORTNAME), cygwin)
|
2001-09-16 18:11:11 +02:00
|
|
|
ifeq ($(MAKE_DLL), true)
|
2009-08-27 00:24:44 +02:00
|
|
|
$(MKDIR_P) '$(DESTDIR)$(libdir)'
|
2001-09-16 18:11:11 +02:00
|
|
|
endif
|
|
|
|
endif
|
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)
|
|
|
|
ifeq ($(MAKE_DLL), true)
|
2009-08-27 00:24:44 +02:00
|
|
|
$(MKDIR_P) '$(DESTDIR)$(libdir)'
|
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
|
|
|
|
endif
|
2001-09-16 18:11:11 +02:00
|
|
|
ifeq ($(MAKE_EXPORTS), true)
|
2009-08-27 00:24:44 +02:00
|
|
|
$(MKDIR_P) '$(DESTDIR)$(pkglibdir)'
|
2012-10-10 03:04:06 +02:00
|
|
|
$(MKDIR_P) '$(DESTDIR)$(pgxsdir)/$(MKLDEXPORT_DIR)'
|
2001-09-16 18:11:11 +02:00
|
|
|
endif
|
2002-08-21 22:42:27 +02:00
|
|
|
|
2001-09-16 18:11:11 +02:00
|
|
|
|
2000-07-06 23:33:45 +02:00
|
|
|
##########################################################################
|
|
|
|
|
|
|
|
uninstall:
|
2005-12-09 22:19:36 +01:00
|
|
|
rm -f '$(DESTDIR)$(bindir)/postgres$(X)' '$(DESTDIR)$(bindir)/postmaster'
|
1996-11-23 10:51:57 +01:00
|
|
|
ifeq ($(MAKE_EXPORTS), true)
|
2005-12-09 22:19:36 +01:00
|
|
|
rm -f '$(DESTDIR)$(pkglibdir)/$(POSTGRES_IMP)'
|
2012-10-10 03:04:06 +02:00
|
|
|
rm -f '$(DESTDIR)$(pgxsdir)/$(MKLDEXPORT_DIR)/mkldexport.sh'
|
1996-11-23 10:51:57 +01:00
|
|
|
endif
|
2003-03-21 18:18:34 +01:00
|
|
|
ifeq ($(PORTNAME), cygwin)
|
1999-01-17 07:20:06 +01:00
|
|
|
ifeq ($(MAKE_DLL), true)
|
2005-12-09 22:19:36 +01:00
|
|
|
rm -f '$(DESTDIR)$(libdir)/libpostgres.a'
|
1999-01-17 07:20:06 +01:00
|
|
|
endif
|
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
|
|
|
|
ifeq ($(PORTNAME), win32)
|
|
|
|
ifeq ($(MAKE_DLL), true)
|
2005-12-09 22:19:36 +01:00
|
|
|
rm -f '$(DESTDIR)$(libdir)/libpostgres.a'
|
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
|
1999-01-17 07:20:06 +01:00
|
|
|
endif
|
2002-12-14 01:24:35 +01:00
|
|
|
$(MAKE) -C catalog uninstall-data
|
2007-08-21 03:11:32 +02:00
|
|
|
$(MAKE) -C tsearch uninstall-data
|
2018-04-05 05:05:40 +02:00
|
|
|
$(MAKE) -C utils uninstall-data
|
2005-12-09 22:19:36 +01:00
|
|
|
rm -f '$(DESTDIR)$(datadir)/pg_hba.conf.sample' \
|
|
|
|
'$(DESTDIR)$(datadir)/pg_ident.conf.sample' \
|
2016-11-29 18:00:00 +01:00
|
|
|
'$(DESTDIR)$(datadir)/postgresql.conf.sample' \
|
2005-12-09 22:19:36 +01:00
|
|
|
'$(DESTDIR)$(datadir)/recovery.conf.sample'
|
2018-03-28 22:19:08 +02:00
|
|
|
ifeq ($(with_llvm), yes)
|
|
|
|
$(call uninstall_llvm_module,postgres)
|
|
|
|
endif
|
1999-03-08 00:05:57 +01:00
|
|
|
|
2000-03-08 23:00:19 +01:00
|
|
|
|
2000-07-06 23:33:45 +02:00
|
|
|
##########################################################################
|
2000-03-08 23:00:19 +01:00
|
|
|
|
2000-07-06 23:33:45 +02:00
|
|
|
clean:
|
2006-07-24 18:32:45 +02:00
|
|
|
rm -f $(LOCALOBJS) postgres$(X) $(POSTGRES_IMP) \
|
2010-01-05 02:06:57 +01:00
|
|
|
$(top_builddir)/src/include/parser/gram.h \
|
|
|
|
$(top_builddir)/src/include/catalog/schemapg.h \
|
2015-09-11 19:58:28 +02:00
|
|
|
$(top_builddir)/src/include/storage/lwlocknames.h \
|
2010-01-05 02:06:57 +01:00
|
|
|
$(top_builddir)/src/include/utils/fmgroids.h \
|
2016-12-28 18:00:00 +01:00
|
|
|
$(top_builddir)/src/include/utils/fmgrprotos.h \
|
2010-01-05 02:06:57 +01:00
|
|
|
$(top_builddir)/src/include/utils/probes.h
|
2003-03-21 18:18:34 +01:00
|
|
|
ifeq ($(PORTNAME), cygwin)
|
2014-02-11 18:10:52 +01:00
|
|
|
rm -f postgres.dll libpostgres.a
|
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
|
|
|
|
ifeq ($(PORTNAME), win32)
|
2014-02-11 18:56:20 +01:00
|
|
|
rm -f postgres.dll libpostgres.a $(WIN32RES)
|
2000-07-06 23:33:45 +02:00
|
|
|
endif
|
2000-03-08 23:00:19 +01:00
|
|
|
|
2000-07-06 23:33:45 +02:00
|
|
|
distclean: clean
|
2016-03-21 09:56:39 +01:00
|
|
|
rm -f port/tas.s port/dynloader.c port/pg_sema.c port/pg_shmem.c
|
1996-07-09 08:22:35 +02:00
|
|
|
|
2000-07-06 23:33:45 +02:00
|
|
|
maintainer-clean: distclean
|
2009-08-28 22:26:19 +02:00
|
|
|
rm -f bootstrap/bootparse.c \
|
|
|
|
bootstrap/bootscanner.c \
|
|
|
|
parser/gram.c \
|
|
|
|
parser/gram.h \
|
2011-03-10 06:03:26 +01:00
|
|
|
parser/scan.c \
|
2010-01-05 02:06:57 +01:00
|
|
|
catalog/schemapg.h \
|
|
|
|
catalog/postgres.bki \
|
|
|
|
catalog/postgres.description \
|
|
|
|
catalog/postgres.shdescription \
|
2011-03-10 06:03:26 +01:00
|
|
|
replication/repl_gram.c \
|
|
|
|
replication/repl_scanner.c \
|
Support multiple synchronous standby servers.
Previously synchronous replication offered only the ability to confirm
that all changes made by a transaction had been transferred to at most
one synchronous standby server.
This commit extends synchronous replication so that it supports multiple
synchronous standby servers. It enables users to consider one or more
standby servers as synchronous, and increase the level of transaction
durability by ensuring that transaction commits wait for replies from
all of those synchronous standbys.
Multiple synchronous standby servers are configured in
synchronous_standby_names which is extended to support new syntax of
'num_sync ( standby_name [ , ... ] )', where num_sync specifies
the number of synchronous standbys that transaction commits need to
wait for replies from and standby_name is the name of a standby
server.
The syntax of 'standby_name [ , ... ]' which was used in 9.5 or before
is also still supported. It's the same as new syntax with num_sync=1.
This commit doesn't include "quorum commit" feature which was discussed
in pgsql-hackers. Synchronous standbys are chosen based on their priorities.
synchronous_standby_names determines the priority of each standby for
being chosen as a synchronous standby. The standbys whose names appear
earlier in the list are given higher priority and will be considered as
synchronous. Other standby servers appearing later in this list
represent potential synchronous standbys.
The regression test for multiple synchronous standbys is not included
in this commit. It should come later.
Authors: Sawada Masahiko, Beena Emerson, Michael Paquier, Fujii Masao
Reviewed-By: Kyotaro Horiguchi, Amit Kapila, Robert Haas, Simon Riggs,
Amit Langote, Thomas Munro, Sameer Thakur, Suraj Kharage, Abhijit Menon-Sen,
Rajeev Rastogi
Many thanks to the various individuals who were involved in
discussing and developing this feature.
2016-04-06 10:18:25 +02:00
|
|
|
replication/syncrep_gram.c \
|
|
|
|
replication/syncrep_scanner.c \
|
2015-09-11 19:58:28 +02:00
|
|
|
storage/lmgr/lwlocknames.c \
|
|
|
|
storage/lmgr/lwlocknames.h \
|
2010-01-05 02:06:57 +01:00
|
|
|
utils/fmgroids.h \
|
2016-12-28 18:00:00 +01:00
|
|
|
utils/fmgrprotos.h \
|
2010-01-05 02:06:57 +01:00
|
|
|
utils/fmgrtab.c \
|
2011-02-04 04:32:49 +01:00
|
|
|
utils/errcodes.h \
|
2012-02-15 18:13:32 +01:00
|
|
|
utils/misc/guc-file.c \
|
2012-04-08 00:16:50 +02:00
|
|
|
utils/sort/qsort_tuple.c
|
2000-03-08 23:00:19 +01:00
|
|
|
|
|
|
|
|
2000-07-06 23:33:45 +02:00
|
|
|
##########################################################################
|
1996-07-09 08:22:35 +02:00
|
|
|
#
|
|
|
|
# Support for code development.
|
|
|
|
#
|
2010-11-23 21:27:50 +01:00
|
|
|
# Use target "quick" to build "postgres" when you know all the subsystems
|
1996-11-03 10:05:30 +01:00
|
|
|
# are up to date. It saves the time of doing all the submakes.
|
|
|
|
.PHONY: quick
|
|
|
|
quick: $(OBJS)
|
2010-07-05 20:54:38 +02:00
|
|
|
$(CC) $(CFLAGS) $(LDFLAGS) $(LDFLAGS_EX) $(export_dynamic) $(call expand_subsys,$^) $(LIBS) -o postgres
|