chiark / gitweb /
Merge from secnet
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 28 Dec 2019 22:18:19 +0000 (22:18 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 28 Dec 2019 22:18:19 +0000 (22:18 +0000)
README
generate

diff --git a/README b/README
index bbec51884700b9776f8f9491f1b6375b0a9c1e0d..fcf8c000f89a6ea61f92deca0a1aabaa420fce96 100644 (file)
--- a/README
+++ b/README
@@ -371,6 +371,13 @@ makefiles, you may find that just `make' is broken now and cannot get
 far enough to regenerate a working set of makefiles.  If this happens
 just rerun ./config.status by hand.
 
+If you go back and forth between different versions of your code you
+can sometimes find that `make' complains that one of your Subdir.sd.mk
+files is missing: typically, if iot was used and therefore a
+dependency in some other version of your code.  If you run `make
+clean' (or `make realclean') these dependencies are suppressed, which
+will clear up the problem.
+
 
 Legal information
 -----------------
index 7bdbd881c9fab3b3d2f552e6465b73a93dad8c18..9275b25770b818e8346a6c11b0ba532c9e2e4de7 100755 (executable)
--- a/generate
+++ b/generate
@@ -97,12 +97,16 @@ sub write_makefile ($$) {
     #print STDERR "write_makefile @_\n";
     start_output_file("${dir_prefix}Makefile");
     my $cd = $depth ? join('/', ('..',) x $depth) : '.';
+    my $suppress_templates=
+       '$(if $(filter-out clean real-clean, $(subdirmk_targets)),,'.
+       ' MAKEFILE_TEMPLATES=)';
     o <<END;
 default: all
-\$(MAKECMDGOALS) all: run-main.mk
+\$(filter-out all,\$(MAKECMDGOALS)) all: run-main.mk
        \@:
+subdirmk_targets:=\$(or \$(MAKECMDGOALS),all)
 Makefile run-main.mk:
-       \$(MAKE) -C $cd -f main.mk \$(addprefix ${dir_prefix},\$(or \$(MAKECMDGOALS),all))
+       \$(MAKE) -C $cd -f main.mk \$(addprefix ${dir_prefix},\$(subdirmk_targets))$suppress_templates
 .SUFFIXES:
 .PHONY:        run-main.mk
 END