From 6a2cc67bb62de319aec8db9a4d0a83595bb4dcf8 Mon Sep 17 00:00:00 2001 From: Craig Small Date: Mon, 19 Oct 2020 20:05:41 +1100 Subject: [PATCH] build-sys: Build check programs only on make check noinst_PROGRAMS are built with "make" even though we had the test programs in there and only needed them for "make check". In theory the check target should depend on check_PROGRAMS as check-am target does and the document states it should, but for reasons understood by the automake whisperers only, it doesn't build them. check only depends on BUILT_SOURCES for some reason. check-am: all-am $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-recursive References: https://www.gnu.org/software/automake/manual/html_node/Scripts_002dbased-Testsuites.html --- Makefile.am | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Makefile.am b/Makefile.am index 5f2e026f..60072683 100644 --- a/Makefile.am +++ b/Makefile.am @@ -312,7 +312,7 @@ ps_pscommand_SOURCES = \ # Test programs required for dejagnu or standalone testing -noinst_PROGRAMS = \ +check_PROGRAMS = \ lib/test_strutils \ lib/test_fileutils \ lib/test_process \ @@ -327,7 +327,7 @@ lib_test_process_LDADD = $(CYGWINFLAGS) lib_test_strtod_nol_SOURCES = lib/test_strtod_nol.c lib/strutils.c lib_test_strtod_nol_LDADD = $(CYGWINFLAGS) -noinst_PROGRAMS += \ +check_PROGRAMS += \ proc/test_Itemtables \ proc/test_pids \ proc/test_uptime \ @@ -386,7 +386,8 @@ TESTS = \ lib/test_fileutils \ lib/test_strtod_nol -check_PROGRAMS = $(TESTS) +# Automake should do this, but it doesn't +check: $(check_PROGRAMS) $(top_srcdir)/.version: touch $(top_srcdir)/.version