From e4427967579e5076ce8378c069c5c8e02fb2198f Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Fri, 6 Jul 2018 23:22:39 +0100 Subject: [PATCH] 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. --- ...-fix-non-determinstic-makefile-rules.patch | 33 ------------------- ...tree-asciidoctor-man-page-generation.patch | 23 +++++++++++++ debian/patches/series | 2 +- 3 files changed, 24 insertions(+), 34 deletions(-) delete mode 100644 debian/patches/bugfix/all/perf-documentation-fix-non-determinstic-makefile-rules.patch create mode 100644 debian/patches/bugfix/all/perf-documentation-fix-out-of-tree-asciidoctor-man-page-generation.patch diff --git a/debian/patches/bugfix/all/perf-documentation-fix-non-determinstic-makefile-rules.patch b/debian/patches/bugfix/all/perf-documentation-fix-non-determinstic-makefile-rules.patch deleted file mode 100644 index f27c60450..000000000 --- a/debian/patches/bugfix/all/perf-documentation-fix-non-determinstic-makefile-rules.patch +++ /dev/null @@ -1,33 +0,0 @@ -From: Ben Hutchings -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 ---- ---- 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) $@+ $@ && \ diff --git a/debian/patches/bugfix/all/perf-documentation-fix-out-of-tree-asciidoctor-man-page-generation.patch b/debian/patches/bugfix/all/perf-documentation-fix-out-of-tree-asciidoctor-man-page-generation.patch new file mode 100644 index 000000000..5d9c9262b --- /dev/null +++ b/debian/patches/bugfix/all/perf-documentation-fix-out-of-tree-asciidoctor-man-page-generation.patch @@ -0,0 +1,23 @@ +From: Ben Hutchings +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 +--- +--- 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 $@+ $< && \ diff --git a/debian/patches/series b/debian/patches/series index 998dfcda2..8009d511e 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -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