Commit 434c34a5 authored by Michael Hanselmann's avatar Michael Hanselmann

Simplify manpage building

This eliminates one temporary directory in the process.
Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent 33b0062b
...@@ -287,19 +287,11 @@ doc/%.png: doc/%.dot ...@@ -287,19 +287,11 @@ doc/%.png: doc/%.dot
man/%.7.in man/%.8.in: man/%.sgml man/footer.sgml $(DOCBOOK_WRAPPER) man/%.7.in man/%.8.in: man/%.sgml man/footer.sgml $(DOCBOOK_WRAPPER)
@test -n "$(DOCBOOK2MAN)" || { echo 'docbook2man' not found during configure; exit 1; } @test -n "$(DOCBOOK2MAN)" || { echo 'docbook2man' not found during configure; exit 1; }
TMPDIR=`mktemp -d` && { \ $(DOCBOOK_WRAPPER) "$(DOCBOOK2MAN)" $< $(notdir $(@:.in=)) $@
$(DOCBOOK_WRAPPER) "$(DOCBOOK2MAN)" $< $$TMPDIR/$(patsubst man/%.in,%,$@) ; \
mv $$TMPDIR/$(patsubst man/%.in,%,$@) $@ ; \
rm -rf "$$TMPDIR" ; \
}
man/%.html.in: man/%.sgml man/footer.sgml $(DOCBOOK_WRAPPER) man/%.html.in: man/%.sgml man/footer.sgml $(DOCBOOK_WRAPPER)
@test -n "$(DOCBOOK2HTML)" || { echo 'docbook2html' not found during configure; exit 1; } @test -n "$(DOCBOOK2HTML)" || { echo 'docbook2html' not found during configure; exit 1; }
TMPDIR=`mktemp -d` && { \ $(DOCBOOK_WRAPPER) "$(DOCBOOK2HTML) --nochunks" $< $(notdir $(@:.in=)) $@
$(DOCBOOK_WRAPPER) "$(DOCBOOK2HTML) --nochunks" $< $$TMPDIR/$(patsubst man/%.in,%,$@) ; \
mv $$TMPDIR/$(patsubst man/%.in,%,$@) $@ ; \
rm -rf "$$TMPDIR" ; \
}
man/%.7: man/%.7.in stamp-directories $(REPLACE_VARS_SED) man/%.7: man/%.7.in stamp-directories $(REPLACE_VARS_SED)
sed -f $(REPLACE_VARS_SED) < $< > $@ sed -f $(REPLACE_VARS_SED) < $< > $@
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
set -e set -e
if test "$#" != 3 if test "$#" != 4
then then
echo "Wrong number of arguments." >&2 echo "Wrong number of arguments." >&2
exit 1 exit 1
...@@ -10,7 +10,8 @@ fi ...@@ -10,7 +10,8 @@ fi
cmd="${1}" cmd="${1}"
input="${2}" input="${2}"
output="${3}" cmdoutputfile="${3}"
output="${4}"
# docbook2man inserts a date formatted using the current locale into its # docbook2man inserts a date formatted using the current locale into its
# output. Using the "C" locale makes sure it's always in the default format. # output. Using the "C" locale makes sure it's always in the default format.
...@@ -26,7 +27,7 @@ then ...@@ -26,7 +27,7 @@ then
exit 1 exit 1
fi fi
mv "${tmpdir}/`basename "${output}"`" "${output}" mv "${tmpdir}/${cmdoutputfile}" "${output}"
# Needed for make to recognize output file # Needed for make to recognize output file
touch "${output}" touch "${output}"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment