[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Man-db-devel] [PATCH] Fix parallel building by using pattern rules
From: |
Colin Watson |
Subject: |
Re: [Man-db-devel] [PATCH] Fix parallel building by using pattern rules in makefiles |
Date: |
Mon, 21 Sep 2015 22:07:15 +0100 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
On Fri, Sep 18, 2015 at 05:01:24PM +0200, Nikola Forró wrote:
> When building man-db with more simultaneous jobs it could happen
> that the "replace.sed" file was not completely generated at the time
> when substitution was taking place, so the resulting man pages contained
> unsubstituted placeholders.
> This patch fixes it by replacing suffix rules (which cannot have
> prerequisites) with pattern rules that have "replace.sed" file
> as a prerequisite, so they are run only after "replace.sed"
> is completely generated.
Unfortunately, it's my understanding that some people rely on being able
to build man-db with non-GNU versions of make which don't support
pattern rules. Automake supports this provided that you don't ignore
its warnings, which indeed are treated as errors in man-db's tree so you
must have gone to some special effort to ignore them, or perhaps just
not run ./autogen.sh:
automake: warnings are treated as errors
man/Rules.man:37: warning: '%'-style pattern rules are a GNU make extension
man/Makefile.am:44: 'man/Rules.man' included from here
man/Rules.man:41: warning: '%'-style pattern rules are a GNU make extension
man/Makefile.am:44: 'man/Rules.man' included from here
man/Rules.man:44: warning: '%'-style pattern rules are a GNU make extension
man/Makefile.am:44: 'man/Rules.man' included from here
[... much more of the same ...]
autoreconf: automake failed with exit status: 1
Could you please try this patch to man/Rules.man instead (and either run
autoreconf -fi, or propagate the same patch to man/{,*/}Makefile.in if
for some reason you can't do that)? I think it should handle this
without either needing to resort to pattern rules or trying to use
prerequisites with suffix rules, which as you rightly point out is
invalid.
diff --git a/man/Rules.man b/man/Rules.man
index 4ce8ac0..55ff35d 100644
--- a/man/Rules.man
+++ b/man/Rules.man
@@ -34,18 +34,17 @@ endif
replace.sed: $(top_builddir)/man/replace.sin
$(AM_V_GEN)sed -e 's,%REPLACE_CONFIG_FILE%,$(config_file),g'
$(top_builddir)/man/replace.sin > $@
-.man1.1: replace.sed
+$(MANS): replace.sed
+
+.man1.1:
$(AM_V_at)$(MKDIR_P) man1
- @$(MAKE) $(AM_MAKEFLAGS) replace.sed
$(AM_V_GEN)program=`echo '$@' | sed -e 's/\.1//' -e 's,.*/,,' -e
'$(program_transform_name)'`; \
sed -f replace.sed -e "s,%program%,$$program,g" $< > $@
-.man5.5: replace.sed
+.man5.5:
$(AM_V_at)$(MKDIR_P) man5
- @$(MAKE) $(AM_MAKEFLAGS) replace.sed
$(AM_V_GEN)sed -f replace.sed $< > $@
-.man8.8: replace.sed
+.man8.8:
$(AM_V_at)$(MKDIR_P) man8
- @$(MAKE) $(AM_MAKEFLAGS) replace.sed
$(AM_V_GEN)program=`echo '$@' | sed -e 's/\.8//' -e 's,.*/,,' -e
'$(program_transform_name)'`; \
sed -f replace.sed -e "s,%program%,$$program,g" $< > $@
Thanks,
--
Colin Watson address@hidden