On 09/01/2012 10:20 AM, Stefano Lattarini wrote:
>
>   - Ensure the manpages are rebuilt after all the programs have
>     been built; this will require some dirty trick with timestamps
>     and/or recursive make invocation.
>
Something like this perhaps (still untested):

-*-*-*-

diff --git a/man/local.mk b/man/local.mk
index da7de24..088418d 100644
--- a/man/local.mk
+++ b/man/local.mk
@@ -33,7 +33,14 @@ MAINTAINERCLEANFILES += $(ALL_MANS)
 # install a binary, require that all programs be built at distribution
 # time.  We can't use 'dist-hook' for this, since it would run too late:
 # the manpages must be generated before the distdir is created and filled.
-$(EXTRA_MANS): $(all_programs)
+# Also, we can't depend directly an $(all_programs), since that would
+# cause spurious regeneration of these extra manpages.  If we could
+# assume GNU make, we'd just use order-only dependency and avoid an extra
+# recursive make invocation.
+$(EXTRA_MANS): ensure-all-programs
+.PHONY: ensure-all-programs
+ensure-all-programs:
+       $(MAKE) $(all_programs)

 # This is a kludge to remove generated 'man/*.1' from a non-srcdir build.
 # Without this, "make distcheck" might fail.


Reply via email to