Make install-tests target work with vpath builds
authorAndrew Dunstan <andrew@dunslane.net>
Sun, 31 May 2020 22:33:00 +0000 (18:33 -0400)
committerAndrew Dunstan <andrew@dunslane.net>
Sun, 31 May 2020 22:33:00 +0000 (18:33 -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 6d1b5a06c53b54f835cbb6c4c47bb56ee745449c..afdfd9f0a6114c66cb6a7815cf40eda4474055be 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 1a3164065fcd3d49d07234ebbd02cdad1e0bc487..c830627b0009695987889192396afc8bba0b1db6 100644 (file)
@@ -87,8 +87,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