Add a Documentation directory inspired by the git one.
[stgit/ydirson.git] / Documentation / Makefile
blob7f5520c760878379f7c44a6abf8f6fd3db681f96
1 MAN1_TXT=$(wildcard stg-*.txt)
2 MAN7_TXT=stg.txt
4 DOC_HTML=$(patsubst %.txt,%.html,$(MAN1_TXT) $(MAN7_TXT))
6 DOC_MAN1=$(patsubst %.txt,%.1,$(MAN1_TXT))
7 DOC_MAN7=$(patsubst %.txt,%.7,$(MAN7_TXT))
9 prefix?=$(HOME)
10 mandir?=$(prefix)/man
11 man1dir=$(mandir)/man1
12 man7dir=$(mandir)/man7
13 # DESTDIR=
15 ASCIIDOC=asciidoc --unsafe
16 ASCIIDOC_EXTRA =
17 INSTALL?=install
20 # Please note that there is a minor bug in asciidoc.
21 # The version after 6.0.3 _will_ include the patch found here:
22 # http://marc.theaimsgroup.com/?l=git&m=111558757202243&w=2
24 # Until that version is released you may have to apply the patch
25 # yourself - yes, all 6 characters of it!
28 all: html man
30 html: $(DOC_HTML)
32 $(DOC_HTML) $(DOC_MAN1) $(DOC_MAN7): asciidoc.conf
34 man: man1 man7
35 man1: $(DOC_MAN1)
36 man7: $(DOC_MAN7)
38 install: man
39 $(INSTALL) -d -m755 $(DESTDIR)$(man1dir) $(DESTDIR)$(man7dir)
40 $(INSTALL) -m644 $(DOC_MAN1) $(DESTDIR)$(man1dir)
41 $(INSTALL) -m644 $(DOC_MAN7) $(DESTDIR)$(man7dir)
43 # Determine "include::" file references in asciidoc files.
45 doc.dep : $(wildcard *.txt) build-docdep.perl
46 rm -f $@+ $@
47 perl ./build-docdep.perl >$@+
48 mv $@+ $@
50 -include doc.dep
52 clean:
53 rm -f *.xml *.html *.1 *.7 doc.dep
55 %.html : %.txt
56 $(ASCIIDOC) -b xhtml11 -d manpage -f asciidoc.conf $(ASCIIDOC_EXTRA) $<
58 %.1 %.7 : %.xml
59 xmlto -m callouts.xsl man $<
61 %.xml : %.txt
62 $(ASCIIDOC) -b docbook -d manpage -f asciidoc.conf $<