From c7f52f302d24fb7fc882670510ced599366f275f Mon Sep 17 00:00:00 2001 From: Kamalesh Babulal Date: Mon, 12 Sep 2022 20:13:43 +0530 Subject: [PATCH 1/2] make: use DIST_SUBDIRS As per automake manual[1], DIST_SUBDIRS should be used to recurse into the subdirectories those we want to ship as part of make dist and use SUBDIRS for conditionally building the directories. Adopt this rule across the source. [1] https://www.gnu.org/software/automake/manual/html_node/SUBDIRS-vs-DIST_005fSUBDIRS.html Signed-off-by: Kamalesh Babulal --- Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index b23ba5d8..396d941a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1 +1 @@ -SUBDIRS = ftests gunit +DIST_SUBDIRS = ftests gunit From f7afa90cf0a7d3683ac0692b54f910b18b7c9ae9 Mon Sep 17 00:00:00 2001 From: Kamalesh Babulal Date: Mon, 12 Sep 2022 20:15:01 +0530 Subject: [PATCH 2/2] make: build/run tests, only with --enable-tests Control the building and testing (make check) of the tests using the if/endif WITH_TESTS guard based on the configuration options passed. If the --enable-tests (default on) is passed during ./configure step, the SUBDIRS directories (ftests/gunit) are recused into build and make check are run. Signed-off-by: Kamalesh Babulal --- Makefile.am | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Makefile.am b/Makefile.am index 396d941a..fd4b3354 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1 +1,4 @@ DIST_SUBDIRS = ftests gunit +if WITH_TESTS +SUBDIRS = $(DIST_SUBDIRS) +endif