From 53121a9100463959968d21a7f9372844d71dfb6a Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 16 Feb 2020 18:06:23 +0000 Subject: [PATCH] Makefiles: Use Final.sd.mk to implementing RECHECK_RM 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 --- Dir.sd.mk | 11 ----------- Final.sd.mk | 25 +++++++++++++++++++++++++ test-common.sd.mk | 2 ++ 3 files changed, 27 insertions(+), 11 deletions(-) create mode 100644 Final.sd.mk diff --git a/Dir.sd.mk b/Dir.sd.mk index 7671a38..a2c54eb 100644 --- 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 index 0000000..fc26601 --- /dev/null +++ b/Final.sd.mk @@ -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) ))) diff --git a/test-common.sd.mk b/test-common.sd.mk index 0b7f4df..2bc48eb 100644 --- a/test-common.sd.mk +++ b/test-common.sd.mk @@ -15,6 +15,8 @@ endif &check-real: $(foreach t,$(&TESTNAMES),&d-$t/ok) +RECHECK_RM += &d-* + CHECK_SILENT ?= @ &d-%/ok: &^/t-% $(&DEPS) -- 2.30.2