debian/rules should be producing architecture independent packages
[stgit/dwhite.git] / Documentation / Makefile
blobc53c4afa38b8f05cec9257898b9124f2db0437ef
1 MAN1_TXT=$(wildcard stg*.txt)
3 DOC_HTML=$(patsubst %.txt,%.html,$(MAN1_TXT))
5 ARTICLES =
6 # with their own formatting rules.
7 SP_ARTICLES = tutorial
9 DOC_HTML += $(patsubst %,%.html,$(ARTICLES) $(SP_ARTICLES))
10 DOC_PDF += $(patsubst %,%.pdf,$(ARTICLES) $(SP_ARTICLES))
12 DOC_MAN1=$(patsubst %.txt,%.1,$(MAN1_TXT))
14 prefix?=$(HOME)
15 htmldir?=$(prefix)/share/doc/stgit
16 mandir?=$(prefix)/share/man
17 man1dir=$(mandir)/man1
18 # DESTDIR=
20 ASCIIDOC=asciidoc --unsafe
21 ASCIIDOC_EXTRA =
22 INSTALL?=install
25 # Please note that there is a minor bug in asciidoc.
26 # The version after 6.0.3 _will_ include the patch found here:
27 # http://marc.theaimsgroup.com/?l=git&m=111558757202243&w=2
29 # Until that version is released you may have to apply the patch
30 # yourself - yes, all 6 characters of it!
33 all: html man
35 html: $(DOC_HTML)
36 pdf: $(DOC_PDF)
38 $(DOC_HTML) $(DOC_MAN1): asciidoc.conf
40 man: man1
41 man1: $(DOC_MAN1)
42 install: man
43 $(INSTALL) -d -m755 $(DESTDIR)$(man1dir)
44 $(INSTALL) -m644 $(DOC_MAN1) $(DESTDIR)$(man1dir)
46 install-html: html
47 $(INSTALL) -d -m755 $(DESTDIR)$(htmldir)
48 $(INSTALL) -m644 $(DOC_HTML) $(DESTDIR)$(htmldir)
50 # Determine "include::" file references in asciidoc files.
52 doc.dep : $(wildcard *.txt) build-docdep.perl
53 rm -f $@+ $@
54 perl ./build-docdep.perl >$@+
55 mv $@+ $@
57 -include doc.dep
59 clean:
60 rm -f *.xml *.html *.pdf *.1 doc.dep
62 %.html : %.txt
63 $(ASCIIDOC) -b xhtml11 -d manpage -f asciidoc.conf $(ASCIIDOC_EXTRA) $<
65 %.1 : %.xml
66 xmlto -m callouts.xsl man $<
68 %.xml : %.txt
69 $(ASCIIDOC) -b docbook -d manpage -f asciidoc.conf $<
71 %.pdf: %.xml
72 xmlto pdf $<
74 # special formatting rules
75 tutorial.html : %.html : %.txt
76 $(ASCIIDOC) -b xhtml11 -d article -f tutorial.conf $(ASCIIDOC_EXTRA) $<
77 tutorial.xml : %.xml : %.txt
78 $(ASCIIDOC) -b docbook -d article -f tutorial.conf $<