Make install-tests target work with vpath builds
authorAndrew Dunstan <[email protected]>
Sun, 31 May 2020 22:33:00 +0000 (18:33 -0400)
committerAndrew Dunstan <[email protected]>
Sun, 31 May 2020 22:35:31 +0000 (18:35 -0400)
Also add a top-level install-tests target.

Backpatch to all live branches.

Craig Ringer, tweaked by me.

GNUmakefile.in
src/test/regress/GNUmakefile

index 7bf6147b72ec638293a14d639445ad51213ead70..43eeb1ba8dd8ff922f94b6677d0f293948a94901 100644 (file)
@@ -72,6 +72,7 @@ $(call recurse,check-world,src/test src/pl src/interfaces/ecpg contrib src/bin,c
 $(call recurse,checkprep,  src/test src/pl src/interfaces/ecpg contrib src/bin)
 
 $(call recurse,installcheck-world,src/test src/pl src/interfaces/ecpg contrib src/bin,installcheck)
+$(call recurse,install-tests,src/test/regress,install-tests)
 
 GNUmakefile: GNUmakefile.in $(top_builddir)/config.status
    ./config.status $@
index 3ab5d7c72328935a6aabb34d86bd91fd274914bf..a34889cd2a7e9407767fcb088921c686ec9fc775 100644 (file)
@@ -85,8 +85,8 @@ regress_data_files = \
 
 install-tests: all install install-lib installdirs-tests
    $(MAKE) -C $(top_builddir)/contrib/spi install
-   for file in $(regress_data_files); do \
-     $(INSTALL_DATA) $$file '$(DESTDIR)$(pkglibdir)/regress/'$$file || exit; \
+   for file in $(subst $(srcdir)/,,$(regress_data_files)); do \
+       $(INSTALL_DATA) $(srcdir)/$$file '$(DESTDIR)$(pkglibdir)/regress/'$$file || exit; \
    done
 
 installdirs-tests: installdirs