Fix default install location for manpages
[stgit/dwhite.git] / Documentation / Makefile
blobd4189b927d6e4e0fe806db9c750f11b5ea4618f1
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 mandir?=$(prefix)/share/man
16 man1dir=$(mandir)/man1
17 # DESTDIR=
19 ASCIIDOC=asciidoc --unsafe
20 ASCIIDOC_EXTRA =
21 INSTALL?=install
24 # Please note that there is a minor bug in asciidoc.
25 # The version after 6.0.3 _will_ include the patch found here:
26 # http://marc.theaimsgroup.com/?l=git&m=111558757202243&w=2
28 # Until that version is released you may have to apply the patch
29 # yourself - yes, all 6 characters of it!
32 all: html man
34 html: $(DOC_HTML)
35 pdf: $(DOC_PDF)
37 $(DOC_HTML) $(DOC_MAN1): asciidoc.conf
39 man: man1
40 man1: $(DOC_MAN1)
41 install: man
42 $(INSTALL) -d -m755 $(DESTDIR)$(man1dir)
43 $(INSTALL) -m644 $(DOC_MAN1) $(DESTDIR)$(man1dir)
45 # Determine "include::" file references in asciidoc files.
47 doc.dep : $(wildcard *.txt) build-docdep.perl
48 rm -f $@+ $@
49 perl ./build-docdep.perl >$@+
50 mv $@+ $@
52 -include doc.dep
54 clean:
55 rm -f *.xml *.html *.pdf *.1 doc.dep
57 %.html : %.txt
58 $(ASCIIDOC) -b xhtml11 -d manpage -f asciidoc.conf $(ASCIIDOC_EXTRA) $<
60 %.1 : %.xml
61 xmlto -m callouts.xsl man $<
63 %.xml : %.txt
64 $(ASCIIDOC) -b docbook -d manpage -f asciidoc.conf $<
66 %.pdf: %.xml
67 xmlto pdf $<
69 # special formatting rules
70 tutorial.html : %.html : %.txt
71 $(ASCIIDOC) -b xhtml11 -d article -f tutorial.conf $(ASCIIDOC_EXTRA) $<
72 tutorial.xml : %.xml : %.txt
73 $(ASCIIDOC) -b docbook -d article -f tutorial.conf $<