revamp git-clone (take #2).
[git/dscho.git] / Documentation / Makefile
blobf4cbf7e159be721bf17625b07c1d7b4f36c60f78
1 MAN1_TXT= \
2 $(filter-out $(addsuffix .txt, $(ARTICLES) $(SP_ARTICLES)), \
3 $(wildcard git-*.txt)) \
4 gitk.txt
5 MAN7_TXT=git.txt
7 DOC_HTML=$(patsubst %.txt,%.html,$(MAN1_TXT) $(MAN7_TXT))
9 ARTICLES = tutorial
10 ARTICLES += core-tutorial
11 ARTICLES += cvs-migration
12 ARTICLES += diffcore
13 ARTICLES += howto-index
14 ARTICLES += repository-layout
15 ARTICLES += hooks
16 ARTICLES += everyday
17 ARTICLES += git-tools
18 # with their own formatting rules.
19 SP_ARTICLES = glossary howto/revert-branch-rebase
21 DOC_HTML += $(patsubst %,%.html,$(ARTICLES) $(SP_ARTICLES))
23 DOC_MAN1=$(patsubst %.txt,%.1,$(MAN1_TXT))
24 DOC_MAN7=$(patsubst %.txt,%.7,$(MAN7_TXT))
26 prefix?=$(HOME)
27 bin=$(prefix)/bin
28 mandir=$(prefix)/man
29 man1=$(mandir)/man1
30 man7=$(mandir)/man7
31 # DESTDIR=
33 INSTALL?=install
36 # Please note that there is a minor bug in asciidoc.
37 # The version after 6.0.3 _will_ include the patch found here:
38 # http://marc.theaimsgroup.com/?l=git&m=111558757202243&w=2
40 # Until that version is released you may have to apply the patch
41 # yourself - yes, all 6 characters of it!
44 all: html man
46 html: $(DOC_HTML)
49 man: man1 man7
50 man1: $(DOC_MAN1)
51 man7: $(DOC_MAN7)
53 install: man
54 $(INSTALL) -d -m755 $(DESTDIR)/$(man1) $(DESTDIR)/$(man7)
55 $(INSTALL) $(DOC_MAN1) $(DESTDIR)/$(man1)
56 $(INSTALL) $(DOC_MAN7) $(DESTDIR)/$(man7)
60 # Determine "include::" file references in asciidoc files.
62 doc.dep : $(wildcard *.txt) build-docdep.perl
63 rm -f $@+ $@
64 perl ./build-docdep.perl >$@+
65 mv $@+ $@
67 -include doc.dep
69 git.7: README
71 README: ../README
72 cp $< $@
75 clean:
76 rm -f *.xml *.html *.1 *.7 howto-index.txt howto/*.html doc.dep README
78 %.html : %.txt
79 asciidoc -b xhtml11 -d manpage -f asciidoc.conf $<
81 %.1 %.7 : %.xml
82 xmlto man $<
84 %.xml : %.txt
85 asciidoc -b docbook -d manpage -f asciidoc.conf $<
87 git.html: git.txt README
89 glossary.html : glossary.txt sort_glossary.pl
90 cat $< | \
91 perl sort_glossary.pl | \
92 asciidoc -b xhtml11 - > glossary.html
94 howto-index.txt: howto-index.sh $(wildcard howto/*.txt)
95 rm -f $@+ $@
96 sh ./howto-index.sh $(wildcard howto/*.txt) >$@+
97 mv $@+ $@
99 $(patsubst %,%.html,$(ARTICLES)) : %.html : %.txt
100 asciidoc -b xhtml11 $*.txt
102 WEBDOC_DEST = /pub/software/scm/git/docs
104 $(patsubst %.txt,%.html,$(wildcard howto/*.txt)): %.html : %.txt
105 rm -f $@+ $@
106 sed -e '1,/^$$/d' $? | asciidoc -b xhtml11 - >$@+
107 mv $@+ $@
109 install-webdoc : html
110 sh ./install-webdoc.sh $(WEBDOC_DEST)