From 38fa37816974b5ed05b54c79a2c5fd00c891c829 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Tue, 6 Aug 2013 11:50:02 -0400 Subject: [PATCH] Fix: allow make check to run in VPATH build Signed-off-by: Mathieu Desnoyers --- tests/Makefile.am | 18 +++++++++++++++++- tests/snprintf/Makefile.am | 18 +++++++++++++++++- 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/tests/Makefile.am b/tests/Makefile.am index d9a7a30c..30b0e9a0 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -4,7 +4,23 @@ if CXX_WORKS SUBDIRS += hello.cxx endif -dist_noinst_SCRIPTS = test_loop run.sh unit_tests +SCRIPT_LIST = test_loop run.sh unit_tests + +dist_noinst_SCRIPTS = $(SCRIPT_LIST) + +all-local: + @if [ x"$(srcdir)" != x"$(builddir)" ]; then \ + for script in $(SCRIPT_LIST); do \ + cp -f $(srcdir)/$$script $(builddir); \ + done; \ + fi + +clean-local: + @if [ x"$(srcdir)" != x"$(builddir)" ]; then \ + for script in $(SCRIPT_LIST); do \ + rm -f $(builddir)/$$script; \ + done; \ + fi check-am: ./run.sh unit_tests diff --git a/tests/snprintf/Makefile.am b/tests/snprintf/Makefile.am index 2ceb9487..43021562 100644 --- a/tests/snprintf/Makefile.am +++ b/tests/snprintf/Makefile.am @@ -5,4 +5,20 @@ prog_SOURCES = prog.c prog_LDADD = $(top_builddir)/snprintf/libustsnprintf.la \ $(top_builddir)/tests/utils/libtap.a -dist_noinst_SCRIPTS = test_snprintf +SCRIPT_LIST = test_snprintf + +dist_noinst_SCRIPTS = $(SCRIPT_LIST) + +all-local: + @if [ x"$(srcdir)" != x"$(builddir)" ]; then \ + for script in $(SCRIPT_LIST); do \ + cp -f $(srcdir)/$$script $(builddir); \ + done; \ + fi + +clean-local: + @if [ x"$(srcdir)" != x"$(builddir)" ]; then \ + for script in $(SCRIPT_LIST); do \ + rm -f $(builddir)/$$script; \ + done; \ + fi -- 2.34.1