chiark / gitweb /
subdirmk: Honour CONFIG_STATUS_OUTPUTS
[secnet.git] / subdirmk / regen.mk.in
index a6d9ad2544837b83b5d2ee2386b1328fe69cb430..0e2318b52ea7ec56f77cf4750a9ed1fbfd6cd84e 100644 (file)
@@ -3,6 +3,20 @@
 #  Copyright 2019 Ian Jackson
 # SPDX-License-Identifier: LGPL-2.0-or-later
 
+# Usage:
+#   include subdirmk/regen.mk
+# (probably in toplevel Subdir.sd.mk)
+#
+# Arranges that config.status is automatically rerun to update
+# makefiles from templates, whenever a template *.sd.mk or *.mk.in is
+# edited; and that autoconf is rerun if configure's inputs are edited.
+#
+# If you add includes to configure.ac, add them to CONFIGURE_ACS.
+#
+# Also provides a `realclean::' target at the toplevel which deletes
+# the autoconf output.  This may be made into a recursive target
+# by mentioning &TARGETS_realclean in appropriate .sd.mk.
+
 CONFIGURE      ?= configure
 CONFIGURE_AC   ?= $(CONFIGURE).ac
 CONFIG_STATUS  ?= config.status
@@ -21,7 +35,7 @@ MAKEFILE_TEMPLATES += $(addprefix $(top_srcdir)/, $(addsuffix .in, \
        @_SUBDIRMK_MAKEFILES@ \
        ))
 
-main.mk $(MAKEFILES): .makefiles.stamp ;
+main.mk $(MAKEFILES) $(CONFIG_STATUS_OUTPUTS): .makefiles.stamp ;
 .makefiles.stamp:                                              \
                $(top_srcdir)/subdirmk/generate                 \
                $(CONFIG_STATUS)                                \