]>
Commit | Line | Data |
---|---|---|
4a5d6939 MW |
1 | MAN1_TXT= \ |
2 | $(filter-out $(addsuffix .txt, $(ARTICLES) $(SP_ARTICLES)), \ | |
3 | $(wildcard git-*.txt)) \ | |
4 | gitk.txt | |
b2bf34d6 | 5 | MAN7_TXT=git.txt |
b790abb8 | 6 | |
2a29da7c | 7 | DOC_HTML=$(patsubst %.txt,%.html,$(MAN1_TXT) $(MAN7_TXT)) |
8db9307c | 8 | |
a1d4aa74 | 9 | ARTICLES = tutorial |
dcc6e28f | 10 | ARTICLES += core-tutorial |
a1d4aa74 JH |
11 | ARTICLES += cvs-migration |
12 | ARTICLES += diffcore | |
13 | ARTICLES += howto-index | |
14 | ARTICLES += repository-layout | |
6d35cc76 | 15 | ARTICLES += hooks |
db9536c8 | 16 | ARTICLES += everyday |
4a5d6939 | 17 | ARTICLES += git-tools |
8db9307c JH |
18 | # with their own formatting rules. |
19 | SP_ARTICLES = glossary howto/revert-branch-rebase | |
20 | ||
21 | DOC_HTML += $(patsubst %,%.html,$(ARTICLES) $(SP_ARTICLES)) | |
789d5774 | 22 | |
b2bf34d6 DG |
23 | DOC_MAN1=$(patsubst %.txt,%.1,$(MAN1_TXT)) |
24 | DOC_MAN7=$(patsubst %.txt,%.7,$(MAN7_TXT)) | |
25 | ||
d2b8593f | 26 | prefix?=$(HOME) |
87a81c83 EB |
27 | bin=$(prefix)/bin |
28 | mandir=$(prefix)/man | |
29 | man1=$(mandir)/man1 | |
30 | man7=$(mandir)/man7 | |
a682ef9f | 31 | # DESTDIR= |
87a81c83 | 32 | |
d2b8593f | 33 | INSTALL?=install |
87a81c83 | 34 | |
b2bf34d6 DG |
35 | # |
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 | |
39 | # | |
40 | # Until that version is released you may have to apply the patch | |
41 | # yourself - yes, all 6 characters of it! | |
42 | # | |
43 | ||
44 | all: html man | |
b790abb8 DG |
45 | |
46 | html: $(DOC_HTML) | |
47 | ||
b2bf34d6 DG |
48 | |
49 | man: man1 man7 | |
50 | man1: $(DOC_MAN1) | |
51 | man7: $(DOC_MAN7) | |
b790abb8 | 52 | |
b163512d | 53 | install: man |
53764ee4 | 54 | $(INSTALL) -d -m755 $(DESTDIR)/$(man1) $(DESTDIR)/$(man7) |
a682ef9f PB |
55 | $(INSTALL) $(DOC_MAN1) $(DESTDIR)/$(man1) |
56 | $(INSTALL) $(DOC_MAN7) $(DESTDIR)/$(man7) | |
87a81c83 | 57 | |
37465016 | 58 | |
93d69d86 JL |
59 | # |
60 | # Determine "include::" file references in asciidoc files. | |
61 | # | |
fb612d54 | 62 | doc.dep : $(wildcard *.txt) build-docdep.perl |
a5ae8e64 JH |
63 | rm -f $@+ $@ |
64 | perl ./build-docdep.perl >$@+ | |
65 | mv $@+ $@ | |
93d69d86 | 66 | |
a5ae8e64 | 67 | -include doc.dep |
37465016 | 68 | |
941c9449 PR |
69 | git.7: README |
70 | ||
71 | README: ../README | |
72 | cp $< $@ | |
b790abb8 | 73 | |
93d69d86 | 74 | |
b790abb8 | 75 | clean: |
941c9449 | 76 | rm -f *.xml *.html *.1 *.7 howto-index.txt howto/*.html doc.dep README |
b790abb8 DG |
77 | |
78 | %.html : %.txt | |
d1c2e113 | 79 | asciidoc -b xhtml11 -d manpage -f asciidoc.conf $< |
b790abb8 | 80 | |
7984eabe | 81 | %.1 %.7 : %.xml |
776e994a | 82 | xmlto -m callouts.xsl man $< |
b790abb8 DG |
83 | |
84 | %.xml : %.txt | |
d1c2e113 | 85 | asciidoc -b docbook -d manpage -f asciidoc.conf $< |
3f971fc4 | 86 | |
941c9449 | 87 | git.html: git.txt README |
8db9307c | 88 | |
23bb8df2 JS |
89 | glossary.html : glossary.txt sort_glossary.pl |
90 | cat $< | \ | |
91 | perl sort_glossary.pl | \ | |
92 | asciidoc -b xhtml11 - > glossary.html | |
93 | ||
e6fc2346 JH |
94 | howto-index.txt: howto-index.sh $(wildcard howto/*.txt) |
95 | rm -f $@+ $@ | |
96 | sh ./howto-index.sh $(wildcard howto/*.txt) >$@+ | |
97 | mv $@+ $@ | |
98 | ||
8db9307c JH |
99 | $(patsubst %,%.html,$(ARTICLES)) : %.html : %.txt |
100 | asciidoc -b xhtml11 $*.txt | |
e6fc2346 JH |
101 | |
102 | WEBDOC_DEST = /pub/software/scm/git/docs | |
103 | ||
8d0991d7 JH |
104 | $(patsubst %.txt,%.html,$(wildcard howto/*.txt)): %.html : %.txt |
105 | rm -f $@+ $@ | |
106 | sed -e '1,/^$$/d' $? | asciidoc -b xhtml11 - >$@+ | |
107 | mv $@+ $@ | |
108 | ||
e6fc2346 JH |
109 | install-webdoc : html |
110 | sh ./install-webdoc.sh $(WEBDOC_DEST) |