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:52 +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 97c0d4e69ea8e0d2a3924852e054e3865155d876..b97d75e6c2e1bdfc353ac9948e99efeb53c23930 100644 (file)
@@ -70,6 +70,7 @@ check check-tests installcheck installcheck-parallel installcheck-tests:
 $(call recurse,check-world,src/test src/pl src/interfaces/ecpg contrib src/bin,check)
 
 $(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 487d6589b452e17e5fb34445df544dbbb2c20ca3..dd54aedd9ab73738655ec2eaf2c6c696b3f75226 100644 (file)
@@ -89,8 +89,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