Mercurial Queues Emulation for Git
修訂 | 053bd84260104ac597d2f97b1b0dba0145419fe5 (tree) |
---|---|
時間 | 2019-06-26 14:47:51 |
作者 | Keith Marshall <keith@user...> |
Commiter | Keith Marshall |
Automate publication of documentation in optional formats.
* Makefile.in (pdf, all-pdf, install-pdf): Define new rules; these
format the man-pages, and store them as publication-ready PDF files.
(ps, all-ps, install-ps): Likewise, storing as PostScript files.
(dvi, all-dvi, install-dvi, html, all-html, install-html)
(info, all-info, install-info): Decline to publish.
@@ -156,6 +156,7 @@ ${bindir} ${package_hooksdir} ${package_libexecdir} ${man1dir}: | ||
156 | 156 | $(MKDIR_P) $@ |
157 | 157 | |
158 | 158 | INSTALL := @INSTALL@ |
159 | +INSTALL_DATA := @INSTALL_DATA@ | |
159 | 160 | install: installdirs install-bin-scripts install-libexec-scripts |
160 | 161 | |
161 | 162 | INSTALL_SCRIPTS = for script in $1; do $(call DO_INSTALL,$2 $$script,$3); done |
@@ -228,6 +229,52 @@ manpage_installer_script = sed \ | ||
228 | 229 | manpage_template_subst = 's/@$1@/$($(if $2,$2,$1))/' |
229 | 230 | |
230 | 231 | |
232 | +# Documentation | |
233 | +# ============= | |
234 | +# | |
235 | +# Man-page documentation is required, to support "git help"; | |
236 | +# it is automatically provided when the package is installed. | |
237 | +# The following will deliver copies of this documentation, in | |
238 | +# optional PostScript and PDF formats, as built by invoking | |
239 | +# GNU standard "ps", "install-ps", "pdf", and "install-pdf" | |
240 | +# make objectives. | |
241 | +# | |
242 | +.PHONY: pdf install-pdf ps install-ps | |
243 | +PACKAGE_DOCDIR := @docdir@/$(PACKAGE_VERSION) | |
244 | + | |
245 | +all_manpages := $(notdir $(wildcard ${srcdir}/man/*.man)) | |
246 | +all-pdf-internal all-ps-internal: all-%-internal: $(all_manpages:.man=.%) | |
247 | + | |
248 | +pdf ps: %: all-% | |
249 | +all-pdf all-ps: all-%: ${CURDIR}/tmp/share/man/man1/timestamp | |
250 | + $(QUIET_MAKE) all-$*-internal prefix=${CURDIR}/tmp | |
251 | + | |
252 | +install-pdf install-ps: install-%: $(all_manpages:.man=.%) | |
253 | + $(MKDIR_P) ${PACKAGE_DOCDIR}/$* | |
254 | + $(INSTALL_DATA) $^ ${PACKAGE_DOCDIR}/$* | |
255 | + | |
256 | +${CURDIR}/tmp/share/man/man1/timestamp: configure | |
257 | + rm -rf $(dir $@) && $(MKDIR_P) $(dir $@) && > $@ | |
258 | + | |
259 | +%.1: %.1.man ${CURDIR}/tmp/share/man/man1/timestamp | |
260 | + $(QUIET_MAKE) ${CURDIR}/tmp/share/man/man1/$@ prefix=${CURDIR}/tmp | |
261 | + rm -f $@; ln ${CURDIR}/tmp/share/man/man1/$@ $@ | |
262 | + | |
263 | +%.1.pdf: %.1 | |
264 | + MANPATH=${CURDIR}/tmp/share/man man -t $* | ps2pdf - $@ | |
265 | + | |
266 | +%.1.ps: %.1 | |
267 | + MANPATH=${CURDIR}/tmp/share/man man -t $* > $@ | |
268 | + | |
269 | +# OTOH, we simply decline to support the other GNU standard | |
270 | +# documentation formats, namely "info", "dvi", and "html". | |
271 | +# | |
272 | +dvi html info: %: all-% | |
273 | +all-dvi all-html all-info: all-%: install-% | |
274 | +install-dvi install-html install-info: install-%: | |
275 | + $(error "Sorry: '$*' documentation is unsupported for this package!") | |
276 | + | |
277 | + | |
231 | 278 | # Distribution |
232 | 279 | # ============ |
233 | 280 | # |
@@ -264,7 +311,6 @@ bindist: $(PACKAGE_TMPDIR) | ||
264 | 311 | cd $^; tar cf - * | xz -c > ../$(PACKAGE_DISTNAME)-bin.tar.xz |
265 | 312 | rm -rf $(PACKAGE_TMPDIR) |
266 | 313 | |
267 | -PACKAGE_DOCDIR := @docdir@/$(PACKAGE_VERSION) | |
268 | 314 | bindist-licence: LICENCE FDL-1.3 |
269 | 315 | $(MKDIR_P) ${PACKAGE_DOCDIR} |
270 | 316 | $(call INSTALL_SCRIPTS,$^,-m 644,${PACKAGE_DOCDIR}) |