chiark / gitweb /
Makefiles: Use Final.sd.mk to implementing RECHECK_RM
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 16 Feb 2020 18:06:23 +0000 (18:06 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 16 Feb 2020 18:51:43 +0000 (18:51 +0000)
This is now read by make after all the other makefiles.  This allows
us to move the addition of {stest,mtest}/d-* to RECHECK_RM from
Dir.sd.mk into test-common.sd.mk, where it belongs.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Dir.sd.mk
Final.sd.mk [new file with mode: 0644]
test-common.sd.mk

index 7671a38b11f5130b4a10429c877c2ba7ec5fbfd4..a2c54eb3eaf9cf26e6425d738907f9da1a5b8abd 100644 (file)
--- a/Dir.sd.mk
+++ b/Dir.sd.mk
@@ -129,17 +129,6 @@ TESTDIRS=stest mtest
 &TARGETS_fullcheck += msgcode-test.confirm
 
 RECHECK_RM += $(&TARGETS_check)
-RECHECK_RM += $(addsuffix /d-*, $(TESTDIRS));
-# Really the eval below should come very late, so that subdirs can add
-# their stuff to RECHECK_RM, but we do not have a way to do that with
-# subdirmk yet.  So we embed ad-hoc knowledge about TESTDIRS.
-
-# This contrives to delete things before make starts, if the user
-# said "recheck".  The alternative is having recheck be a target
-# which contains the rm's and then runs $(MAKE) again but then
-# we recursively re-enter make in parallel, which is Bad.
-$(eval $(if $(filter recheck,$(MAKECMDGOALS)), \
-       $(shell set -x; rm -rf $(RECHECK_RM) )))
 
 recheck: check
 
diff --git a/Final.sd.mk b/Final.sd.mk
new file mode 100644 (file)
index 0000000..fc26601
--- /dev/null
@@ -0,0 +1,25 @@
+# Final.sd.mk for secnet
+#
+# This file is part of secnet.
+# See README for full list of copyright holders.
+#
+# secnet is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+# 
+# secnet is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# version 3 along with secnet; if not, see
+# https://www.gnu.org/licenses/gpl.html.
+
+# This contrives to delete things before make starts, if the user
+# said "recheck".  The alternative is having recheck be a target
+# which contains the rm's and then runs $(MAKE) again but then
+# we recursively re-enter make in parallel, which is Bad.
+$(eval $(if $(filter recheck,$(MAKECMDGOALS)), \
+       $(shell set -x; rm -rf $(RECHECK_RM) )))
index 0b7f4dffe47d4518e9ef6cc894c89c67f0e34104..2bc48eb1b83d3613e3f57e4b1fe2f57dde2c343a 100644 (file)
@@ -15,6 +15,8 @@ endif
 
 &check-real: $(foreach t,$(&TESTNAMES),&d-$t/ok)
 
+RECHECK_RM += &d-*
+
 CHECK_SILENT ?= @
 
 &d-%/ok: &^/t-% $(&DEPS)