Make install-tests target work with vpath builds
authorAndrew Dunstan
Sun, 31 May 2020 22:33:00 +0000 (18:33 -0400)
committerAndrew Dunstan
Sun, 31 May 2020 22:35:08 +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 d7579c93a5444676319803b1cb8702ff839a874d..99d0426622f127614ddb39439323953ba6baa04a 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 a24cfd4e016200b83c8847a2d1a8aec921c1516b..d94ca56b27bc54c6d30ceb0c9a2edeb75505da06 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