* Makefile.am ($(srcdir)/headers.mk): Do not recurse on
rule regen-dist and inline its action instead.
---
milena/ChangeLog | 7 +++++++
milena/Makefile.am | 23 +++++++++++++++++++++--
2 files changed, 28 insertions(+), 2 deletions(-)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index 9ff0c15..79da1c0 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,5 +1,12 @@
2009-05-26 Roland Levillain <roland(a)lrde.epita.fr>
+ Get rid of an infinite recursion in Milena's Makefile.
+
+ * Makefile.am ($(srcdir)/headers.mk): Do not recurse on
+ rule regen-dist and inline its action instead.
+
+2009-05-26 Roland Levillain <roland(a)lrde.epita.fr>
+
Fix the regeneration of headers.mk from Makefile.
* Makefile.am (regen-dist): Do not make headers.mk read-only,
diff --git a/milena/Makefile.am b/milena/Makefile.am
index 2fc5ec9..30cf50a 100644
--- a/milena/Makefile.am
+++ b/milena/Makefile.am
@@ -28,13 +28,32 @@ tools:
.PHONY: regen-dist
regen-dist:
cd $(srcdir) && ./generate_dist_headers.sh
+EXTRA_DIST = generate_dist_headers.sh
+# We do not delegate the action of regenerating `headers.mk' to
+# `regen-dist' like this:
+#
+# $(MAKE) $(AM_MAKEFLAGS) regen-dist
+#
+# to avoid an infinite recursion, since
+#
+# - the generation of `headers.mk' would trigger the update
+# (regeneration) of `Makefile' (due to the behavior of Automade
+# Makefiles);
+#
+# and because
+#
+# - `Makefile' depends on `headers.mk' (because of the `include'
+# statement); and
+# - `headers.mk' depends on `generate_dist_headers.sh'.
+#
+# Hence the redundant action. There may be a better solution.
+
# FIXME: Change generate_dist_headers.sh so that the action looks like this:
#
# $< $@.tmp && mv -f $@.tmp $@ && chmod -w $@
#
-EXTRA_DIST = generate_dist_headers.sh
$(srcdir)/headers.mk: $(srcdir)/generate_dist_headers.sh
- $(MAKE) $(AM_MAKEFLAGS) regen-dist
+ cd $(srcdir) && ./generate_dist_headers.sh
include $(srcdir)/headers.mk
--
1.6.1.2