postgresql/GNUmakefile.in

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

138 lines
4.1 KiB
Makefile
Raw Permalink Normal View History

#
# PostgreSQL top level makefile
#
2010-09-21 04:08:53 +08:00
# GNUmakefile.in
#
subdir =
top_builddir = .
include $(top_builddir)/src/Makefile.global
$(call recurse,all install,src config)
docs:
$(MAKE) -C doc all
$(call recurse,world,doc src config contrib,all)
# build src/ before contrib/
world-contrib-recurse: world-src-recurse
$(call recurse,world-bin,src config contrib,all)
# build src/ before contrib/
world-bin-contrib-recurse: world-bin-src-recurse
html man:
$(MAKE) -C doc $@
install-docs:
$(MAKE) -C doc install
$(call recurse,install-world,doc src config contrib,install)
# build src/ before contrib/
install-world-contrib-recurse: install-world-src-recurse
$(call recurse,install-world-bin,src config contrib,install)
# build src/ before contrib/
install-world-bin-contrib-recurse: install-world-bin-src-recurse
$(call recurse,installdirs uninstall init-po update-po,doc src config)
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 21:51:52 +08:00
$(call recurse,coverage,doc src config contrib)
# clean, distclean, etc should apply to contrib too, even though
# it's not built by default
$(call recurse,clean,doc contrib src config)
clean:
rm -rf tmp_install/ portlock/
# Garbage from autoconf:
@rm -rf autom4te.cache/
# Important: distclean `src' last, otherwise Makefile.global
# 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 21:51:52 +08:00
distclean:
$(MAKE) -C doc $@
$(MAKE) -C contrib $@
$(MAKE) -C config $@
$(MAKE) -C src $@
rm -rf tmp_install/ portlock/
# Garbage from autoconf:
@rm -rf autom4te.cache/
rm -f config.cache config.log config.status GNUmakefile
check-tests: | temp-install
check check-tests installcheck installcheck-parallel installcheck-tests: CHECKPREP_TOP=src/test/regress
check check-tests installcheck installcheck-parallel installcheck-tests: submake-generated-headers
$(MAKE) -C src/test/regress $@
$(call recurse,check-world,src/test src/pl src/interfaces contrib src/bin src/tools/pg_bsd_indent,check)
$(call recurse,checkprep, src/test src/pl src/interfaces contrib src/bin)
$(call recurse,installcheck-world,src/test src/pl src/interfaces contrib src/bin,installcheck)
$(call recurse,install-tests,src/test/regress,install-tests)
GNUmakefile: GNUmakefile.in $(top_builddir)/config.status
./config.status $@
update-unicode: | submake-generated-headers submake-libpgport
$(MAKE) -C src/common/unicode $@
$(MAKE) -C contrib/unaccent $@
##########################################################################
distdir = postgresql-$(VERSION)
dummy = =install=
# git revision to be packaged
PG_GIT_REVISION = HEAD
2024-03-25 13:28:19 +08:00
GIT = git
2024-03-25 13:28:19 +08:00
dist: $(distdir).tar.gz $(distdir).tar.bz2
2024-03-25 13:28:19 +08:00
.PHONY: $(distdir).tar.gz $(distdir).tar.bz2
distdir-location:
@echo $(distdir)
2024-03-25 13:28:19 +08: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)/ $(PG_GIT_REVISION) -o $(abs_top_builddir)/$@
2024-03-25 13:28:19 +08:00
$(distdir).tar.bz2:
$(GIT) -C $(srcdir) -c core.autocrlf=false -c tar.tar.bz2.command='$(BZIP2) -c' archive --format tar.bz2 --prefix $(distdir)/ $(PG_GIT_REVISION) -o $(abs_top_builddir)/$@
distcheck: dist
rm -rf $(dummy)
mkdir $(dummy)
$(GZIP) -d -c $(distdir).tar.gz | $(TAR) xf -
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 05:24:01 +08:00
test `find $(dummy) ! -type d | wc -l` -eq 0
$(MAKE) -C $(distdir) dist
# Room for improvement: Check here whether this distribution tarball
# is sufficiently similar to the original one.
rm -rf $(distdir) $(dummy)
@echo "Distribution integrity checks out."
headerscheck: submake-generated-headers
$(top_srcdir)/src/tools/pginclude/headerscheck $(top_srcdir) $(abs_top_builddir)
cpluspluscheck: submake-generated-headers
$(top_srcdir)/src/tools/pginclude/headerscheck --cplusplus $(top_srcdir) $(abs_top_builddir)
2024-03-25 13:28:19 +08:00
.PHONY: dist distcheck docs install-docs world check-world install-world installcheck-world headerscheck cpluspluscheck