From 65ed4ac7d7101be1700c4427b57a2fceee14eb01 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Sun, 28 Jan 2018 12:25:02 -0500 Subject: [PATCH 3/3] Add TEMP_INSTALL_SYMLINKS mode Running make install INSTALL_SYMLINKS=1 installs files by making relative symlinks into the source tree instead of copying. That way, the installation is automatically up to date after each build. make check TEMP_INSTALL_SYMLINKS=1 creates the temporary installation for the tests using symlinks, skipping the installation if the temporary installation already exists. This speeds up testing. This currently requires the "ln" program from GNU coreutils. --- src/Makefile.global.in | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/Makefile.global.in b/src/Makefile.global.in index d980f81046..78e7ef1f4f 100644 --- a/src/Makefile.global.in +++ b/src/Makefile.global.in @@ -326,15 +326,22 @@ BZIP2 = bzip2 check: temp-install .PHONY: temp-install + +ifneq (,$(TEMP_INSTALL_SYMLINKS)) +temp-install: INSTALL_SYMLINKS=1 +endif + temp-install: ifndef NO_TEMP_INSTALL ifneq ($(abs_top_builddir),) ifeq ($(MAKELEVEL),0) +ifeq (,$(and $(TEMP_INSTALL_SYMLINKS),$(wildcard $(abs_top_builddir)/tmp_install))) rm -rf '$(abs_top_builddir)'/tmp_install $(MKDIR_P) '$(abs_top_builddir)'/tmp_install/log - $(MAKE) -C '$(top_builddir)' DESTDIR='$(abs_top_builddir)'/tmp_install install >'$(abs_top_builddir)'/tmp_install/log/install.log 2>&1 + $(MAKE) -C '$(top_builddir)' DESTDIR='$(abs_top_builddir)'/tmp_install INSTALL_SYMLINKS=$(INSTALL_SYMLINKS) install >'$(abs_top_builddir)'/tmp_install/log/install.log 2>&1 endif - $(if $(EXTRA_INSTALL),for extra in $(EXTRA_INSTALL); do $(MAKE) -C '$(top_builddir)'/$$extra DESTDIR='$(abs_top_builddir)'/tmp_install install >>'$(abs_top_builddir)'/tmp_install/log/install.log || exit; done) +endif + $(if $(EXTRA_INSTALL),for extra in $(EXTRA_INSTALL); do $(MAKE) -C '$(top_builddir)'/$$extra DESTDIR='$(abs_top_builddir)'/tmp_install INSTALL_SYMLINKS=$(INSTALL_SYMLINKS) install >>'$(abs_top_builddir)'/tmp_install/log/install.log || exit; done) endif endif @@ -394,6 +401,15 @@ INSTALL_SHLIB = $(INSTALL_SHLIB_ENV) $(INSTALL) $(INSTALL_SHLIB_OPTS) $(INSTALL_ # Override in Makefile.port if necessary INSTALL_SHLIB_OPTS = -m 755 +ifneq ($(INSTALL_SYMLINKS),) +INSTALL = ln -frs +INSTALL_PROGRAM = $(INSTALL) +INSTALL_SCRIPT = $(INSTALL) +INSTALL_DATA = $(INSTALL) +INSTALL_STLIB = $(INSTALL) +INSTALL_SHLIB = $(INSTALL) +endif + MKDIR_P = @MKDIR_P@ missing = $(SHELL) $(top_srcdir)/config/missing -- 2.16.2