2000-06-07 02:01:15 +04:00
|
|
|
#
|
|
|
|
# PostgreSQL top level makefile
|
|
|
|
#
|
2010-09-21 00:08:53 +04:00
|
|
|
# GNUmakefile.in
|
2000-06-07 02:01:15 +04:00
|
|
|
#
|
|
|
|
|
2000-06-28 22:30:16 +04:00
|
|
|
subdir =
|
2000-06-07 02:01:15 +04:00
|
|
|
top_builddir = .
|
2000-08-31 20:12:35 +04:00
|
|
|
include $(top_builddir)/src/Makefile.global
|
2000-06-07 02:01:15 +04:00
|
|
|
|
2010-11-12 23:15:16 +03:00
|
|
|
$(call recurse,all install,src config)
|
|
|
|
|
2010-03-30 04:10:46 +04:00
|
|
|
docs:
|
|
|
|
$(MAKE) -C doc all
|
|
|
|
|
2010-11-12 23:15:16 +03:00
|
|
|
$(call recurse,world,doc src config contrib,all)
|
2010-01-29 02:59:52 +03:00
|
|
|
|
2011-08-24 22:34:49 +04:00
|
|
|
# build src/ before contrib/
|
|
|
|
world-contrib-recurse: world-src-recurse
|
|
|
|
|
2021-07-01 21:21:09 +03:00
|
|
|
$(call recurse,world-bin,src config contrib,all)
|
|
|
|
|
|
|
|
# build src/ before contrib/
|
|
|
|
world-bin-contrib-recurse: world-bin-src-recurse
|
|
|
|
|
2009-08-10 02:47:59 +04:00
|
|
|
html man:
|
|
|
|
$(MAKE) -C doc $@
|
|
|
|
|
2010-03-30 04:10:46 +04:00
|
|
|
install-docs:
|
|
|
|
$(MAKE) -C doc install
|
|
|
|
|
2010-11-12 23:15:16 +03:00
|
|
|
$(call recurse,install-world,doc src config contrib,install)
|
2010-01-29 02:59:52 +03:00
|
|
|
|
2011-08-24 22:34:49 +04:00
|
|
|
# build src/ before contrib/
|
|
|
|
install-world-contrib-recurse: install-world-src-recurse
|
|
|
|
|
2021-07-01 21:21:09 +03:00
|
|
|
$(call recurse,install-world-bin,src config contrib,install)
|
|
|
|
|
|
|
|
# build src/ before contrib/
|
|
|
|
install-world-bin-contrib-recurse: install-world-bin-src-recurse
|
|
|
|
|
2016-09-06 00:44:36 +03:00
|
|
|
$(call recurse,installdirs uninstall init-po update-po,doc src config)
|
2000-06-28 22:30:16 +04: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 16:51:52 +03:00
|
|
|
$(call recurse,coverage,doc src config contrib)
|
2006-04-03 22:47:41 +04:00
|
|
|
|
2000-12-04 03:34:40 +03:00
|
|
|
# clean, distclean, etc should apply to contrib too, even though
|
|
|
|
# it's not built by default
|
2010-11-12 23:15:16 +03:00
|
|
|
$(call recurse,clean,doc contrib src config)
|
2000-12-04 03:34:40 +03:00
|
|
|
clean:
|
2022-11-26 18:30:31 +03:00
|
|
|
rm -rf tmp_install/ portlock/
|
2002-03-29 20:32:55 +03:00
|
|
|
# Garbage from autoconf:
|
|
|
|
@rm -rf autom4te.cache/
|
2000-12-04 03:34:40 +03:00
|
|
|
|
|
|
|
# Important: distclean `src' last, otherwise Makefile.global
|
2000-07-18 02:31:59 +04:00
|
|
|
# will be gone too soon.
|
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 16:51:52 +03:00
|
|
|
distclean:
|
2008-03-18 19:24:50 +03:00
|
|
|
$(MAKE) -C doc $@
|
|
|
|
$(MAKE) -C contrib $@
|
|
|
|
$(MAKE) -C config $@
|
|
|
|
$(MAKE) -C src $@
|
2022-11-26 18:30:31 +03:00
|
|
|
rm -rf tmp_install/ portlock/
|
2002-03-29 20:32:55 +03:00
|
|
|
# Garbage from autoconf:
|
|
|
|
@rm -rf autom4te.cache/
|
2015-05-14 01:48:05 +03:00
|
|
|
rm -f config.cache config.log config.status GNUmakefile
|
2000-06-07 02:01:15 +04:00
|
|
|
|
2020-05-26 02:21:04 +03:00
|
|
|
check-tests: | temp-install
|
2019-01-01 00:54:38 +03:00
|
|
|
check check-tests installcheck installcheck-parallel installcheck-tests: CHECKPREP_TOP=src/test/regress
|
2018-07-31 01:04:39 +03:00
|
|
|
check check-tests installcheck installcheck-parallel installcheck-tests: submake-generated-headers
|
2012-03-05 22:19:20 +04:00
|
|
|
$(MAKE) -C src/test/regress $@
|
2000-06-07 02:01:15 +04:00
|
|
|
|
2023-02-12 20:22:21 +03:00
|
|
|
$(call recurse,check-world,src/test src/pl src/interfaces contrib src/bin src/tools/pg_bsd_indent,check)
|
2022-06-03 07:15:20 +03:00
|
|
|
$(call recurse,checkprep, src/test src/pl src/interfaces contrib src/bin)
|
2011-02-14 22:52:32 +03:00
|
|
|
|
2022-06-03 07:15:20 +03:00
|
|
|
$(call recurse,installcheck-world,src/test src/pl src/interfaces contrib src/bin,installcheck)
|
2020-06-01 01:33:00 +03:00
|
|
|
$(call recurse,install-tests,src/test/regress,install-tests)
|
2010-01-29 02:59:52 +03:00
|
|
|
|
2000-06-10 22:02:12 +04:00
|
|
|
GNUmakefile: GNUmakefile.in $(top_builddir)/config.status
|
2002-03-29 20:32:55 +03:00
|
|
|
./config.status $@
|
2000-06-10 22:02:12 +04:00
|
|
|
|
2020-01-09 11:54:47 +03:00
|
|
|
update-unicode: | submake-generated-headers submake-libpgport
|
|
|
|
$(MAKE) -C src/common/unicode $@
|
|
|
|
$(MAKE) -C contrib/unaccent $@
|
|
|
|
|
2000-06-10 22:02:12 +04:00
|
|
|
|
2000-07-19 20:30:27 +04:00
|
|
|
##########################################################################
|
|
|
|
|
2007-02-09 18:56:00 +03:00
|
|
|
distdir = postgresql-$(VERSION)
|
|
|
|
dummy = =install=
|
2000-07-19 20:30:27 +04:00
|
|
|
|
make dist uses git archive
This changes "make dist" to directly use "git archive", rather than
the custom shell script it currently runs.
This is to make the creation of the distribution tarball more directly
traceable to the git repository. That is why we removed the "make
distprep" step.
"make dist" continues to produce a .gz and a .bz2 tarball as before.
The archives produced this way are deterministic and reproducible,
meaning for a given commit the result file should always be
bit-for-bit identical. The exception is that if you use a git version
older than 2.38.0, gzip records the platform in the archive, so you'd
get a different output on Windows vs. macOS vs. "UNIX" (everything
else). In git 2.38.0, this was changed so that everything is recorded
as "UNIX" now. This is just something to keep in mind. This issue is
specific to the gzip format, it does not affect other compression
formats.
Meson has its own distribution building command (meson dist), but we
are not using that at this point. The main problem is that, the way
they have implemented it, it is not deterministic in the above sense.
Also, we want a "make" version for the time being. But the target
name "dist" in meson is reserved for that reason, so we call the
custom target "pgdist" (so call something like "meson compile -C build
pgdist").
Reviewed-by: Tristan Partin <tristan@neon.tech>
Discussion: https://www.postgresql.org/message-id/flat/40e80f77-a294-4f29-a16f-e21bc7bc75fc%40eisentraut.org
2024-03-25 08:28:19 +03:00
|
|
|
GIT = git
|
2000-07-19 20:30:27 +04:00
|
|
|
|
make dist uses git archive
This changes "make dist" to directly use "git archive", rather than
the custom shell script it currently runs.
This is to make the creation of the distribution tarball more directly
traceable to the git repository. That is why we removed the "make
distprep" step.
"make dist" continues to produce a .gz and a .bz2 tarball as before.
The archives produced this way are deterministic and reproducible,
meaning for a given commit the result file should always be
bit-for-bit identical. The exception is that if you use a git version
older than 2.38.0, gzip records the platform in the archive, so you'd
get a different output on Windows vs. macOS vs. "UNIX" (everything
else). In git 2.38.0, this was changed so that everything is recorded
as "UNIX" now. This is just something to keep in mind. This issue is
specific to the gzip format, it does not affect other compression
formats.
Meson has its own distribution building command (meson dist), but we
are not using that at this point. The main problem is that, the way
they have implemented it, it is not deterministic in the above sense.
Also, we want a "make" version for the time being. But the target
name "dist" in meson is reserved for that reason, so we call the
custom target "pgdist" (so call something like "meson compile -C build
pgdist").
Reviewed-by: Tristan Partin <tristan@neon.tech>
Discussion: https://www.postgresql.org/message-id/flat/40e80f77-a294-4f29-a16f-e21bc7bc75fc%40eisentraut.org
2024-03-25 08:28:19 +03:00
|
|
|
dist: $(distdir).tar.gz $(distdir).tar.bz2
|
2000-07-19 20:30:27 +04:00
|
|
|
|
make dist uses git archive
This changes "make dist" to directly use "git archive", rather than
the custom shell script it currently runs.
This is to make the creation of the distribution tarball more directly
traceable to the git repository. That is why we removed the "make
distprep" step.
"make dist" continues to produce a .gz and a .bz2 tarball as before.
The archives produced this way are deterministic and reproducible,
meaning for a given commit the result file should always be
bit-for-bit identical. The exception is that if you use a git version
older than 2.38.0, gzip records the platform in the archive, so you'd
get a different output on Windows vs. macOS vs. "UNIX" (everything
else). In git 2.38.0, this was changed so that everything is recorded
as "UNIX" now. This is just something to keep in mind. This issue is
specific to the gzip format, it does not affect other compression
formats.
Meson has its own distribution building command (meson dist), but we
are not using that at this point. The main problem is that, the way
they have implemented it, it is not deterministic in the above sense.
Also, we want a "make" version for the time being. But the target
name "dist" in meson is reserved for that reason, so we call the
custom target "pgdist" (so call something like "meson compile -C build
pgdist").
Reviewed-by: Tristan Partin <tristan@neon.tech>
Discussion: https://www.postgresql.org/message-id/flat/40e80f77-a294-4f29-a16f-e21bc7bc75fc%40eisentraut.org
2024-03-25 08:28:19 +03:00
|
|
|
.PHONY: $(distdir).tar.gz $(distdir).tar.bz2
|
2009-11-04 00:28:10 +03:00
|
|
|
|
2009-08-15 01:37:18 +04:00
|
|
|
distdir-location:
|
|
|
|
@echo $(distdir)
|
|
|
|
|
make dist uses git archive
This changes "make dist" to directly use "git archive", rather than
the custom shell script it currently runs.
This is to make the creation of the distribution tarball more directly
traceable to the git repository. That is why we removed the "make
distprep" step.
"make dist" continues to produce a .gz and a .bz2 tarball as before.
The archives produced this way are deterministic and reproducible,
meaning for a given commit the result file should always be
bit-for-bit identical. The exception is that if you use a git version
older than 2.38.0, gzip records the platform in the archive, so you'd
get a different output on Windows vs. macOS vs. "UNIX" (everything
else). In git 2.38.0, this was changed so that everything is recorded
as "UNIX" now. This is just something to keep in mind. This issue is
specific to the gzip format, it does not affect other compression
formats.
Meson has its own distribution building command (meson dist), but we
are not using that at this point. The main problem is that, the way
they have implemented it, it is not deterministic in the above sense.
Also, we want a "make" version for the time being. But the target
name "dist" in meson is reserved for that reason, so we call the
custom target "pgdist" (so call something like "meson compile -C build
pgdist").
Reviewed-by: Tristan Partin <tristan@neon.tech>
Discussion: https://www.postgresql.org/message-id/flat/40e80f77-a294-4f29-a16f-e21bc7bc75fc%40eisentraut.org
2024-03-25 08:28:19 +03:00
|
|
|
# Note: core.autocrlf=false is needed to avoid line-ending conversion
|
|
|
|
# in case the environment has a different setting. Without this, a
|
|
|
|
# tarball created on Windows might be different than on, and unusable
|
|
|
|
# on, Unix machines.
|
|
|
|
|
|
|
|
$(distdir).tar.gz:
|
|
|
|
$(GIT) -C $(srcdir) -c core.autocrlf=false archive --format tar.gz -9 --prefix $(distdir)/ HEAD -o $(abs_top_builddir)/$@
|
|
|
|
|
|
|
|
$(distdir).tar.bz2:
|
|
|
|
$(GIT) -C $(srcdir) -c core.autocrlf=false -c tar.tar.bz2.command='$(BZIP2) -c' archive --format tar.bz2 --prefix $(distdir)/ HEAD -o $(abs_top_builddir)/$@
|
2000-07-19 20:30:27 +04:00
|
|
|
|
2009-11-04 00:28:10 +03:00
|
|
|
distcheck: dist
|
2008-03-18 19:24:50 +03:00
|
|
|
rm -rf $(dummy)
|
2000-07-19 20:30:27 +04:00
|
|
|
mkdir $(dummy)
|
2009-11-04 00:28:10 +03:00
|
|
|
$(GZIP) -d -c $(distdir).tar.gz | $(TAR) xf -
|
2000-07-19 20:30:27 +04:00
|
|
|
install_prefix=`cd $(dummy) && pwd`; \
|
|
|
|
cd $(distdir) \
|
|
|
|
&& ./configure --prefix="$$install_prefix"
|
|
|
|
$(MAKE) -C $(distdir)
|
|
|
|
$(MAKE) -C $(distdir) install
|
|
|
|
$(MAKE) -C $(distdir) uninstall
|
|
|
|
@echo "checking whether \`$(MAKE) uninstall' works"
|
2001-01-07 00:24:01 +03:00
|
|
|
test `find $(dummy) ! -type d | wc -l` -eq 0
|
2000-07-19 20:30:27 +04:00
|
|
|
$(MAKE) -C $(distdir) dist
|
|
|
|
# Room for improvement: Check here whether this distribution tarball
|
|
|
|
# is sufficiently similar to the original one.
|
2008-03-18 19:24:50 +03:00
|
|
|
rm -rf $(distdir) $(dummy)
|
2000-07-19 20:30:27 +04:00
|
|
|
@echo "Distribution integrity checks out."
|
|
|
|
|
2019-08-19 21:22:56 +03:00
|
|
|
headerscheck: submake-generated-headers
|
|
|
|
$(top_srcdir)/src/tools/pginclude/headerscheck $(top_srcdir) $(abs_top_builddir)
|
|
|
|
|
2019-05-31 22:36:17 +03:00
|
|
|
cpluspluscheck: submake-generated-headers
|
2024-03-10 09:33:57 +03:00
|
|
|
$(top_srcdir)/src/tools/pginclude/headerscheck --cplusplus $(top_srcdir) $(abs_top_builddir)
|
2019-05-31 22:36:17 +03:00
|
|
|
|
make dist uses git archive
This changes "make dist" to directly use "git archive", rather than
the custom shell script it currently runs.
This is to make the creation of the distribution tarball more directly
traceable to the git repository. That is why we removed the "make
distprep" step.
"make dist" continues to produce a .gz and a .bz2 tarball as before.
The archives produced this way are deterministic and reproducible,
meaning for a given commit the result file should always be
bit-for-bit identical. The exception is that if you use a git version
older than 2.38.0, gzip records the platform in the archive, so you'd
get a different output on Windows vs. macOS vs. "UNIX" (everything
else). In git 2.38.0, this was changed so that everything is recorded
as "UNIX" now. This is just something to keep in mind. This issue is
specific to the gzip format, it does not affect other compression
formats.
Meson has its own distribution building command (meson dist), but we
are not using that at this point. The main problem is that, the way
they have implemented it, it is not deterministic in the above sense.
Also, we want a "make" version for the time being. But the target
name "dist" in meson is reserved for that reason, so we call the
custom target "pgdist" (so call something like "meson compile -C build
pgdist").
Reviewed-by: Tristan Partin <tristan@neon.tech>
Discussion: https://www.postgresql.org/message-id/flat/40e80f77-a294-4f29-a16f-e21bc7bc75fc%40eisentraut.org
2024-03-25 08:28:19 +03:00
|
|
|
.PHONY: dist distcheck docs install-docs world check-world install-world installcheck-world headerscheck cpluspluscheck
|