Add basic test for stg status
[stgit/ydirson.git] / Documentation / Makefile
blob2e5d23cd32be1766fec455deb9e39116ec314b7d
1 MAN1_TXT=$(wildcard stg*.txt)
2 MAN7_TXT=
4 DOC_HTML=$(patsubst %.txt,%.html,$(MAN1_TXT) $(MAN7_TXT))
6 ARTICLES =
7 # with their own formatting rules.
8 SP_ARTICLES = tutorial
10 DOC_HTML += $(patsubst %,%.html,$(ARTICLES) $(SP_ARTICLES))
11 DOC_PDF += $(patsubst %,%.pdf,$(ARTICLES) $(SP_ARTICLES))
13 DOC_MAN1=$(patsubst %.txt,%.1,$(MAN1_TXT))
14 DOC_MAN7=$(patsubst %.txt,%.7,$(MAN7_TXT))
16 prefix?=$(HOME)
17 mandir?=$(prefix)/man
18 man1dir=$(mandir)/man1
19 man7dir=$(mandir)/man7
20 # DESTDIR=
22 ASCIIDOC=asciidoc --unsafe
23 ASCIIDOC_EXTRA =
24 INSTALL?=install
27 # Please note that there is a minor bug in asciidoc.
28 # The version after 6.0.3 _will_ include the patch found here:
29 # http://marc.theaimsgroup.com/?l=git&m=111558757202243&w=2
31 # Until that version is released you may have to apply the patch
32 # yourself - yes, all 6 characters of it!
35 all: html man
37 html: $(DOC_HTML)
38 pdf: $(DOC_PDF)
40 $(DOC_HTML) $(DOC_MAN1) $(DOC_MAN7): asciidoc.conf
42 man: man1 man7
43 man1: $(DOC_MAN1)
44 man7: $(DOC_MAN7)
46 install: man
47 $(INSTALL) -d -m755 $(DESTDIR)$(man1dir) $(DESTDIR)$(man7dir)
48 $(INSTALL) -m644 $(DOC_MAN1) $(DESTDIR)$(man1dir)
49 $(INSTALL) -m644 $(DOC_MAN7) $(DESTDIR)$(man7dir)
51 # Determine "include::" file references in asciidoc files.
53 doc.dep : $(wildcard *.txt) build-docdep.perl
54 rm -f $@+ $@
55 perl ./build-docdep.perl >$@+
56 mv $@+ $@
58 -include doc.dep
60 clean:
61 rm -f *.xml *.html *.pdf *.1 *.7 doc.dep
63 %.html : %.txt
64 $(ASCIIDOC) -b xhtml11 -d manpage -f asciidoc.conf $(ASCIIDOC_EXTRA) $<
66 %.1 %.7 : %.xml
67 xmlto -m callouts.xsl man $<
69 %.xml : %.txt
70 $(ASCIIDOC) -b docbook -d manpage -f asciidoc.conf $<
72 %.pdf: %.xml
73 xmlto pdf $<
75 # special formatting rules
76 tutorial.html : %.html : %.txt
77 $(ASCIIDOC) -b xhtml11 -d article -f tutorial.conf $(ASCIIDOC_EXTRA) $<
78 tutorial.xml : %.xml : %.txt
79 $(ASCIIDOC) -b docbook -d article -f tutorial.conf $<