aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Hutchings <ben@decadent.org.uk>2015-08-06 18:36:52 -0400
committerJonathan Corbet <corbet@lwn.net>2015-08-14 13:07:34 -0400
commit9ed71e7ad95eb9885420e8d33f33bd4d49e1b775 (patch)
treebdadbf357b74f4ee4d89d859efe4050abe0bb600
parent7bbac697e4a6e64cc4bae26d57310c916aa0da7a (diff)
DocBook: Fix non-determinstic installation of duplicate man pages
Some kernel-doc sections are included in multiple DocBook files. This means the mandocs target will generate the same manual page multiple times with different metadata (author name/address and manual title, taken from the including DocBook file). If it's invoked in a parallel build, the output is non-determinstic. Build the manual pages in a separate subdirectory per DocBook file, then sort and de-duplicate when installing them (which is serialised). Signed-off-by: Ben Hutchings <ben@decadent.org.uk> [jc: fixed conflicts with the docs tree] Signed-off-by: Jonathan Corbet <corbet@lwn.net>
-rw-r--r--Documentation/DocBook/Makefile8
1 files changed, 5 insertions, 3 deletions
diff --git a/Documentation/DocBook/Makefile b/Documentation/DocBook/Makefile
index b7d2110298de..5e9702194dfe 100644
--- a/Documentation/DocBook/Makefile
+++ b/Documentation/DocBook/Makefile
@@ -60,7 +60,9 @@ mandocs: $(MAN)
60 60
61installmandocs: mandocs 61installmandocs: mandocs
62 mkdir -p /usr/local/man/man9/ 62 mkdir -p /usr/local/man/man9/
63 install -m 644 $(obj)/man/*.9.gz /usr/local/man/man9/ 63 find $(obj)/man -name '*.9.gz' -printf '%h %f\n' | \
64 sort -k 2 -k 1 | uniq -f 1 | sed -e 's: :/:' | \
65 xargs install -m 644 -t /usr/local/man/man9/
64 66
65### 67###
66#External programs used 68#External programs used
@@ -150,12 +152,12 @@ quiet_cmd_db2html = HTML $@
150 cp $(PNG-$(basename $(notdir $@))) $(patsubst %.html,%,$@); fi 152 cp $(PNG-$(basename $(notdir $@))) $(patsubst %.html,%,$@); fi
151 153
152quiet_cmd_db2man = MAN $@ 154quiet_cmd_db2man = MAN $@
153 cmd_db2man = if grep -q refentry $<; then xmlto man $(XMLTOFLAGS) -o $(obj)/man $< ; fi 155 cmd_db2man = if grep -q refentry $<; then xmlto man $(XMLTOFLAGS) -o $(obj)/man/$(*F) $< ; fi
154%.9 : %.xml 156%.9 : %.xml
155 @(which xmlto > /dev/null 2>&1) || \ 157 @(which xmlto > /dev/null 2>&1) || \
156 (echo "*** You need to install xmlto ***"; \ 158 (echo "*** You need to install xmlto ***"; \
157 exit 1) 159 exit 1)
158 $(Q)mkdir -p $(obj)/man 160 $(Q)mkdir -p $(obj)/man/$(*F)
159 $(call cmd,db2man) 161 $(call cmd,db2man)
160 @touch $@ 162 @touch $@
161 163