linux-perf: Really fix man page generation with asciidoctor

The real problem was not that there were two rules, but that the first
rule didn't work for out-of-tree builds.

After I disabled the second rule, "make man" still succeeded because
of another rule (with no commands) that made all man pages depend on
asciidoc.conf.
This commit is contained in:
Ben Hutchings 2018-07-06 23:22:39 +01:00
parent afa20e4a35
commit e442796757
3 changed files with 24 additions and 34 deletions

View File

@ -1,33 +0,0 @@
From: Ben Hutchings <ben@decadent.org.uk>
Date: Fri, 06 Jul 2018 21:29:17 +0100
Subject: perf Documentation: Fix non-deterministic Makefile rules
When USE_ASCIIDOCTOR is defined, we define a rule to convert from
asciidoc source directly to man pages is defined. However, the rule
to convert from XML to man pages using xmlto is always defined, and
make may still choose to use that. This means that using asciidoctor
does not remove the dependency on xmlto for building man pages, as
was intended.
Only define the second rule using xmlto if USE_ASCIIDOCTOR is not
defined.
Fixes: ffef80ecf89f ("perf Documentation: Support for asciidoctor")
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
--- a/tools/perf/Documentation/Makefile
+++ b/tools/perf/Documentation/Makefile
@@ -290,11 +290,11 @@ $(OUTPUT)%.1 $(OUTPUT)%.5 $(OUTPUT)%.7 :
$(ASCIIDOC) -b manpage -d manpage \
$(ASCIIDOC_EXTRA) -aperf_version=$(PERF_VERSION) -o $@+ $< && \
mv $@+ $@
-endif
-
+else
$(OUTPUT)%.1 $(OUTPUT)%.5 $(OUTPUT)%.7 : $(OUTPUT)%.xml
$(QUIET_XMLTO)$(RM) $@ && \
$(XMLTO) -o $(OUTPUT). -m $(MANPAGE_XSL) $(XMLTO_EXTRA) man $<
+endif
$(OUTPUT)%.xml : %.txt
$(QUIET_ASCIIDOC)$(RM) $@+ $@ && \

View File

@ -0,0 +1,23 @@
From: Ben Hutchings <ben@decadent.org.uk>
Date: Fri, 06 Jul 2018 23:22:10 +0100
Subject: perf Documentation: Fix out-of-tree asciidoctor man page generation
The dependency for the man page rule using asciidoctor incorrectly
specifies a source file in $(OUTPUT). When building out-of-tree, the
source file is not found, resulting in a fall-back to the following
rule which uses xmlto.
Fixes: ffef80ecf89f ("perf Documentation: Support for asciidoctor")
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
--- a/tools/perf/Documentation/Makefile
+++ b/tools/perf/Documentation/Makefile
@@ -285,7 +285,7 @@ $(MAN_HTML): $(OUTPUT)%.html : %.txt
mv $@+ $@
ifdef USE_ASCIIDOCTOR
-$(OUTPUT)%.1 $(OUTPUT)%.5 $(OUTPUT)%.7 : $(OUTPUT)%.txt
+$(OUTPUT)%.1 $(OUTPUT)%.5 $(OUTPUT)%.7 : %.txt
$(QUIET_ASCIIDOC)$(RM) $@+ $@ && \
$(ASCIIDOC) -b manpage -d manpage \
$(ASCIIDOC_EXTRA) -aperf_version=$(PERF_VERSION) -o $@+ $< && \

View File

@ -148,7 +148,7 @@ bugfix/all/tools-perf-man-date.patch
bugfix/all/tools-perf-remove-shebangs.patch
bugfix/all/tools-lib-traceevent-use-ldflags.patch
bugfix/x86/revert-perf-build-fix-libunwind-feature-detection-on.patch
bugfix/all/perf-documentation-fix-non-determinstic-makefile-rules.patch
bugfix/all/perf-documentation-fix-out-of-tree-asciidoctor-man-page-generation.patch
bugfix/all/tools-build-remove-bpf-run-time-check-at-build-time.patch
bugfix/all/cpupower-bump-soname-version.patch
bugfix/all/cpupower-fix-checks-for-cpu-existence.patch