2000-07-06 23:33:45 +02:00
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# Makefile for src/include
|
|
|
|
#
|
2004-10-06 10:50:02 +02:00
|
|
|
# 'make install' installs whole contents of src/include.
|
2000-07-06 23:33:45 +02:00
|
|
|
#
|
2010-09-20 22:08:53 +02:00
|
|
|
# src/include/Makefile
|
2000-07-06 23:33:45 +02:00
|
|
|
#
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
|
|
|
|
subdir = src/include
|
|
|
|
top_builddir = ../..
|
2000-08-31 18:12:35 +02:00
|
|
|
include $(top_builddir)/src/Makefile.global
|
2000-07-06 23:33:45 +02:00
|
|
|
|
|
|
|
|
2012-10-08 03:52:07 +02:00
|
|
|
all: pg_config.h pg_config_ext.h pg_config_os.h
|
2000-07-06 23:33:45 +02:00
|
|
|
|
|
|
|
|
2016-03-24 20:55:44 +01:00
|
|
|
# Subdirectories containing installable headers
|
2023-03-10 12:08:10 +01:00
|
|
|
SUBDIRS = access archive bootstrap catalog commands common datatype \
|
2019-01-28 22:51:12 +01:00
|
|
|
executor fe_utils foreign jit \
|
2018-04-15 02:33:32 +02:00
|
|
|
lib libpq mb nodes optimizer parser partitioning postmaster \
|
|
|
|
regex replication rewrite \
|
|
|
|
statistics storage tcop snowball snowball/libstemmer tsearch \
|
2014-10-02 16:39:36 +02:00
|
|
|
tsearch/dicts utils port port/atomics port/win32 port/win32_msvc \
|
2013-02-26 21:27:30 +01:00
|
|
|
port/win32_msvc/sys port/win32/arpa port/win32/netinet \
|
|
|
|
port/win32/sys portability
|
2000-07-06 23:33:45 +02:00
|
|
|
|
2004-10-06 10:50:02 +02:00
|
|
|
# Install all headers
|
2004-11-09 07:23:50 +01:00
|
|
|
install: all installdirs
|
2001-08-28 16:20:28 +02:00
|
|
|
# These headers are needed by the public headers of the interfaces.
|
2005-12-09 22:19:36 +01:00
|
|
|
$(INSTALL_DATA) $(srcdir)/postgres_ext.h '$(DESTDIR)$(includedir)'
|
|
|
|
$(INSTALL_DATA) $(srcdir)/libpq/libpq-fs.h '$(DESTDIR)$(includedir)/libpq'
|
2012-10-08 03:52:07 +02:00
|
|
|
$(INSTALL_DATA) pg_config.h '$(DESTDIR)$(includedir)'
|
|
|
|
$(INSTALL_DATA) pg_config_ext.h '$(DESTDIR)$(includedir)'
|
|
|
|
$(INSTALL_DATA) pg_config_os.h '$(DESTDIR)$(includedir)'
|
2005-12-09 22:19:36 +01:00
|
|
|
$(INSTALL_DATA) $(srcdir)/pg_config_manual.h '$(DESTDIR)$(includedir)'
|
2001-08-28 16:20:28 +02:00
|
|
|
# These headers are needed by the not-so-public headers of the interfaces.
|
2005-12-09 22:19:36 +01:00
|
|
|
$(INSTALL_DATA) $(srcdir)/c.h '$(DESTDIR)$(includedir_internal)'
|
|
|
|
$(INSTALL_DATA) $(srcdir)/port.h '$(DESTDIR)$(includedir_internal)'
|
|
|
|
$(INSTALL_DATA) $(srcdir)/postgres_fe.h '$(DESTDIR)$(includedir_internal)'
|
|
|
|
$(INSTALL_DATA) $(srcdir)/libpq/pqcomm.h '$(DESTDIR)$(includedir_internal)/libpq'
|
2023-08-23 04:16:12 +02:00
|
|
|
$(INSTALL_DATA) $(srcdir)/libpq/protocol.h '$(DESTDIR)$(includedir_internal)/libpq'
|
2004-10-06 10:50:02 +02:00
|
|
|
# These headers are needed for server-side development
|
2012-10-08 03:52:07 +02:00
|
|
|
$(INSTALL_DATA) pg_config.h '$(DESTDIR)$(includedir_server)'
|
|
|
|
$(INSTALL_DATA) pg_config_ext.h '$(DESTDIR)$(includedir_server)'
|
|
|
|
$(INSTALL_DATA) pg_config_os.h '$(DESTDIR)$(includedir_server)'
|
2022-07-09 10:20:23 +02:00
|
|
|
$(INSTALL_DATA) nodes/nodetags.h '$(DESTDIR)$(includedir_server)/nodes'
|
2011-02-04 15:28:06 +01:00
|
|
|
$(INSTALL_DATA) utils/errcodes.h '$(DESTDIR)$(includedir_server)/utils'
|
2009-07-20 22:38:55 +02:00
|
|
|
$(INSTALL_DATA) utils/fmgroids.h '$(DESTDIR)$(includedir_server)/utils'
|
2016-12-28 18:00:00 +01:00
|
|
|
$(INSTALL_DATA) utils/fmgrprotos.h '$(DESTDIR)$(includedir_server)/utils'
|
2022-09-12 21:33:59 +02:00
|
|
|
$(INSTALL_DATA) $(srcdir)/*.h '$(DESTDIR)$(includedir_server)'
|
2001-02-10 03:31:31 +01:00
|
|
|
for dir in $(SUBDIRS); do \
|
2022-09-12 21:33:59 +02:00
|
|
|
$(INSTALL_DATA) $(srcdir)/$$dir/*.h '$(DESTDIR)$(includedir_server)'/$$dir || exit; \
|
2001-02-10 03:31:31 +01:00
|
|
|
done
|
2011-11-10 19:52:54 +01:00
|
|
|
ifeq ($(vpath_build),yes)
|
2024-03-14 06:57:16 +01:00
|
|
|
for file in storage/lwlocknames.h utils/probes.h utils/wait_event_types.h; do \
|
2022-09-12 21:33:59 +02:00
|
|
|
$(INSTALL_DATA) $$file '$(DESTDIR)$(includedir_server)'/$$file || exit; \
|
2011-11-10 19:52:54 +01:00
|
|
|
done
|
|
|
|
endif
|
2024-03-14 06:57:16 +01:00
|
|
|
$(MAKE) -C catalog install
|
2001-02-10 03:31:31 +01:00
|
|
|
|
2004-10-06 10:50:02 +02:00
|
|
|
installdirs:
|
2009-08-27 00:24:44 +02:00
|
|
|
$(MKDIR_P) '$(DESTDIR)$(includedir)/libpq' '$(DESTDIR)$(includedir_internal)/libpq'
|
|
|
|
$(MKDIR_P) $(addprefix '$(DESTDIR)$(includedir_server)'/, $(SUBDIRS))
|
2001-02-10 03:31:31 +01:00
|
|
|
|
|
|
|
|
2000-07-06 23:33:45 +02:00
|
|
|
uninstall:
|
2012-10-08 03:52:07 +02:00
|
|
|
rm -f $(addprefix '$(DESTDIR)$(includedir)'/, pg_config.h pg_config_ext.h pg_config_os.h pg_config_manual.h postgres_ext.h libpq/libpq-fs.h)
|
2023-08-23 04:16:12 +02:00
|
|
|
rm -f $(addprefix '$(DESTDIR)$(includedir_internal)'/, c.h port.h postgres_fe.h libpq/pqcomm.h libpq/protocol.h)
|
2001-08-28 16:20:28 +02:00
|
|
|
# heuristic...
|
2005-12-09 22:19:36 +01:00
|
|
|
rm -rf $(addprefix '$(DESTDIR)$(includedir_server)'/, $(SUBDIRS) *.h)
|
2024-03-14 06:57:16 +01:00
|
|
|
$(MAKE) -C catalog uninstall
|
2001-08-28 16:20:28 +02:00
|
|
|
|
2000-07-06 23:33:45 +02:00
|
|
|
|
|
|
|
clean:
|
2018-05-03 23:54:18 +02:00
|
|
|
rm -f utils/fmgroids.h utils/fmgrprotos.h utils/errcodes.h utils/header-stamp
|
Generate automatically code and documentation related to wait events
The documentation and the code is generated automatically from a new
file called wait_event_names.txt, formatted in sections dedicated to
each wait event class (Timeout, Lock, IO, etc.) with three tab-separated
fields:
- C symbol in enums
- Format in the system views
- Description in the docs
Using this approach has several advantages, as we have proved to be
rather bad in maintaining this area of the tree across the years:
- The order of each item in the documentation and the code, which should
be alphabetical, has become incorrect multiple times, and the script
generating the code and documentation has a few rules to enforce that,
making the maintenance a no-brainer.
- Some wait events were added to the code, but not documented, so this
cannot be missed now.
- The order of the tables for each wait event class is enforced in the
documentation (the input .txt file does so as well for clarity, though
this is not mandatory).
- Less code, shaving 1.2k lines from the tree, with 1/3 of the savings
coming from the code, the rest from the documentation.
The wait event types "Lock" and "LWLock" still have their own code path
for their code, hence only the documentation is created for them. These
classes are listed with a special marker called WAIT_EVENT_DOCONLY in
the input file.
Adding a new wait event now requires only an update of
wait_event_names.txt, with "Lock" and "LWLock" treated as exceptions.
This commit has been tested with configure/Makefile, the CI and VPATH
build. clean, distclean and maintainer-clean were working fine.
Author: Bertrand Drouvot, Michael Paquier
Discussion: https://postgr.es/m/77a86b3a-c4a8-5f5d-69b9-d70bbf2e9b98@gmail.com
2023-07-05 03:53:11 +02:00
|
|
|
rm -f storage/lwlocknames.h utils/probes.h utils/wait_event_types.h
|
Automatically generate node support functions
Add a script to automatically generate the node support functions
(copy, equal, out, and read, as well as the node tags enum) from the
struct definitions.
For each of the four node support files, it creates two include files,
e.g., copyfuncs.funcs.c and copyfuncs.switch.c, to include in the main
file. All the scaffolding of the main file stays in place.
I have tried to mostly make the coverage of the output match what is
currently there. For example, one could now do out/read coverage of
utility statement nodes, but I have manually excluded those for now.
The reason is mainly that it's easier to diff the before and after,
and adding a bunch of stuff like this might require a separate
analysis and review.
Subtyping (TidScan -> Scan) is supported.
For the hard cases, you can just write a manual function and exclude
generating one. For the not so hard cases, there is a way of
annotating struct fields to get special behaviors. For example,
pg_node_attr(equal_ignore) has the field ignored in equal functions.
(In this patch, I have only ifdef'ed out the code to could be removed,
mainly so that it won't constantly have merge conflicts. It will be
deleted in a separate patch. All the code comments that are worth
keeping from those sections have already been moved to the header
files where the structs are defined.)
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://www.postgresql.org/message-id/flat/c1097590-a6a4-486a-64b1-e1f9cc0533ce%40enterprisedb.com
2022-07-09 08:52:19 +02:00
|
|
|
rm -f nodes/nodetags.h nodes/header-stamp
|
2024-03-14 06:57:16 +01:00
|
|
|
$(MAKE) -C catalog clean
|
2000-07-06 23:33:45 +02:00
|
|
|
|
Remove distprep
A PostgreSQL release tarball contains a number of prebuilt files, in
particular files produced by bison, flex, perl, and well as html and
man documentation. We have done this consistent with established
practice at the time to not require these tools for building from a
tarball. Some of these tools were hard to get, or get the right
version of, from time to time, and shipping the prebuilt output was a
convenience to users.
Now this has at least two problems:
One, we have to make the build system(s) work in two modes: Building
from a git checkout and building from a tarball. This is pretty
complicated, but it works so far for autoconf/make. It does not
currently work for meson; you can currently only build with meson from
a git checkout. Making meson builds work from a tarball seems very
difficult or impossible. One particular problem is that since meson
requires a separate build directory, we cannot make the build update
files like gram.h in the source tree. So if you were to build from a
tarball and update gram.y, you will have a gram.h in the source tree
and one in the build tree, but the way things work is that the
compiler will always use the one in the source tree. So you cannot,
for example, make any gram.y changes when building from a tarball.
This seems impossible to fix in a non-horrible way.
Second, there is increased interest nowadays in precisely tracking the
origin of software. We can reasonably track contributions into the
git tree, and users can reasonably track the path from a tarball to
packages and downloads and installs. But what happens between the git
tree and the tarball is obscure and in some cases non-reproducible.
The solution for both of these issues is to get rid of the step that
adds prebuilt files to the tarball. The tarball now only contains
what is in the git tree (*). Getting the additional build
dependencies is no longer a problem nowadays, and the complications to
keep these dual build modes working are significant. And of course we
want to get the meson build system working universally.
This commit removes the make distprep target altogether. The make
dist target continues to do its job, it just doesn't call distprep
anymore.
(*) - The tarball also contains the INSTALL file that is built at make
dist time, but not by distprep. This is unchanged for now.
The make maintainer-clean target, whose job it is to remove the
prebuilt files in addition to what make distclean does, is now just an
alias to make distprep. (In practice, it is probably obsolete given
that git clean is available.)
The following programs are now hard build requirements in configure
(they were already required by meson.build):
- bison
- flex
- perl
Reviewed-by: Michael Paquier <michael@paquier.xyz>
Reviewed-by: Andres Freund <andres@anarazel.de>
Discussion: https://www.postgresql.org/message-id/flat/e07408d9-e5f2-d9fd-5672-f53354e9305e@eisentraut.org
2023-11-06 14:51:52 +01:00
|
|
|
distclean: clean
|
2018-09-06 10:07:24 +02:00
|
|
|
rm -f pg_config.h pg_config_ext.h pg_config_os.h stamp-h stamp-ext-h
|