[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: non-recursive make finished?
From: |
Jim Meyering |
Subject: |
Re: non-recursive make finished? |
Date: |
Fri, 14 Sep 2012 09:49:30 +0200 |
Jim Meyering wrote:
...
> Hey! Here's an even better idea:
This is the same, but also passes make syntax-check.
I had to exempt the new tests/GNUmakefile from the
sc_prohibit_tab_based_indentation rule.
>From 5fba24985d45660a27dace2f19062247871528d8 Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Fri, 14 Sep 2012 09:25:33 +0200
Subject: [PATCH] tests: reenable "make -C tests ..." commands
The README-documented way to run individual tests was invalidated
by the conversion of tests/ to non-recursive make. Add a GNUmakefile
shim to reenable that usage.
* tests/GNUmakefile: New file, so that "make -C tests ..." works
like it did before the conversion of tests/ to non-recursive build.
Reported by Bernhard Voelker.
* Makefile.am (EXTRA_DIST): Add it.
* cfg.mk (sc_prohibit_tab_based_indentation): Also exempt any
GNUmakefile from this syntax-check.
---
Makefile.am | 1 +
cfg.mk | 5 +++--
tests/GNUmakefile | 20 ++++++++++++++++++++
3 files changed, 24 insertions(+), 2 deletions(-)
create mode 100644 tests/GNUmakefile
diff --git a/Makefile.am b/Makefile.am
index dfbb591..0232090 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -53,6 +53,7 @@ EXTRA_DIST = \
cfg.mk \
dist-check.mk \
maint.mk \
+ tests/GNUmakefile \
thanks-gen
gen_progs_lists = $(top_srcdir)/build-aux/gen-lists-of-programs.sh
diff --git a/cfg.mk b/cfg.mk
index 0deb3cb..37fa22e 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -539,10 +539,11 @@ exclude_file_name_regexp--sc_prohibit_fail_0 = \
(^.*/git-hooks/commit-msg|^tests/init\.sh|Makefile\.am|\.mk|.*\.texi)$$
exclude_file_name_regexp--sc_prohibit_atoi_atof = ^lib/euidaccess-stat\.c$$
-tbi_1 =
^tests/pr/|(^gl/lib/reg.*\.c\.diff|Makefile(\.am)?|\.mk|^man/help2man)$$
+tbi_1 = ^tests/pr/|(^gl/lib/reg.*\.c\.diff|\.mk|^man/help2man)$$
tbi_2 = ^scripts/git-hooks/(pre-commit|pre-applypatch|applypatch-msg)$$
+tbi_3 = (GNU)?[Mm]akefile(\.am)?$$
exclude_file_name_regexp--sc_prohibit_tab_based_indentation = \
- $(tbi_1)|$(tbi_2)
+ $(tbi_1)|$(tbi_2)|$(tbi_3)
exclude_file_name_regexp--sc_preprocessor_indentation = \
^(gl/lib/rand-isaac\.[ch]|gl/tests/test-rand-isaac\.c)$$
diff --git a/tests/GNUmakefile b/tests/GNUmakefile
new file mode 100644
index 0000000..3c178a2
--- /dev/null
+++ b/tests/GNUmakefile
@@ -0,0 +1,20 @@
+# Provide a compatibility layer so that the commands used before the
+# conversion of tests/ to non-recursive make still work. To do that, we
+# must rerun the "make check" from the parent, and with tests/ prefixed
+# onto any TESTS values. The SUBDIRS=. is to prevent the top-level check
+# rules from descending into e.g., gnulib-test/.
+
+.PHONY: all
+all:
+ @echo 'tests/GNUmakefile: did you mean to make "check"?' 1>&2
+ @exit 1
+
+ifeq ($(TESTS),)
+tests =
+else
+tests = TESTS=$(addprefix tests/,$(TESTS))
+endif
+
+.PHONY: check
+check:
+ cd .. && $(MAKE) $@ $(tests) SUBDIRS=.
--
1.7.12.363.g53284de