Makefile 2.2 KB
Newer Older
1
MAN1_TXT=$(wildcard git-*.txt) gitk.txt
D
David Greaves 已提交
2
MAN7_TXT=git.txt
3

J
Junio C Hamano 已提交
4
DOC_HTML=$(patsubst %.txt,%.html,$(MAN1_TXT) $(MAN7_TXT))
J
Junio C Hamano 已提交
5

J
Junio C Hamano 已提交
6 7 8 9 10
ARTICLES = tutorial
ARTICLES += cvs-migration
ARTICLES += diffcore
ARTICLES += howto-index
ARTICLES += repository-layout
J
Junio C Hamano 已提交
11
ARTICLES += hooks
J
Junio C Hamano 已提交
12
ARTICLES += everyday
J
Junio C Hamano 已提交
13 14 15 16
# with their own formatting rules.
SP_ARTICLES = glossary howto/revert-branch-rebase

DOC_HTML += $(patsubst %,%.html,$(ARTICLES) $(SP_ARTICLES))
17

D
David Greaves 已提交
18 19 20
DOC_MAN1=$(patsubst %.txt,%.1,$(MAN1_TXT))
DOC_MAN7=$(patsubst %.txt,%.7,$(MAN7_TXT))

21
prefix?=$(HOME)
22 23 24 25
bin=$(prefix)/bin
mandir=$(prefix)/man
man1=$(mandir)/man1
man7=$(mandir)/man7
26
# DESTDIR=
27

28
INSTALL?=install
29

D
David Greaves 已提交
30 31 32 33 34 35 36 37 38 39
#
# Please note that there is a minor bug in asciidoc.
# The version after 6.0.3 _will_ include the patch found here:
#   http://marc.theaimsgroup.com/?l=git&m=111558757202243&w=2
#
# Until that version is released you may have to apply the patch
# yourself - yes, all 6 characters of it!
#

all: html man
40 41 42

html: $(DOC_HTML)

D
David Greaves 已提交
43 44 45 46

man: man1 man7
man1: $(DOC_MAN1)
man7: $(DOC_MAN7)
47

J
Junio C Hamano 已提交
48
install: man
49
	$(INSTALL) -d -m755 $(DESTDIR)/$(man1) $(DESTDIR)/$(man7)
50 51
	$(INSTALL) $(DOC_MAN1) $(DESTDIR)/$(man1)
	$(INSTALL) $(DOC_MAN7) $(DESTDIR)/$(man7)
52

53

54 55 56
#
# Determine "include::" file references in asciidoc files.
#
57
doc.dep : $(wildcard *.txt) build-docdep.perl
58 59 60
	rm -f $@+ $@
	perl ./build-docdep.perl >$@+
	mv $@+ $@
61

62
-include doc.dep
63

J
Junio C Hamano 已提交
64
git.7: ../README
65

66

67
clean:
68
	rm -f *.xml *.html *.1 *.7 howto-index.txt howto/*.html doc.dep
69 70

%.html : %.txt
71
	asciidoc -b xhtml11 -d manpage -f asciidoc.conf $<
72

73
%.1 %.7 : %.xml
74 75 76
	xmlto man $<

%.xml : %.txt
77
	asciidoc -b docbook -d manpage -f asciidoc.conf $<
J
Junio C Hamano 已提交
78

J
Junio C Hamano 已提交
79 80
git.html: git.txt ../README

81 82 83 84 85
glossary.html : glossary.txt sort_glossary.pl
	cat $< | \
	perl sort_glossary.pl | \
	asciidoc -b xhtml11 - > glossary.html

86 87 88 89 90
howto-index.txt: howto-index.sh $(wildcard howto/*.txt)
	rm -f $@+ $@
	sh ./howto-index.sh $(wildcard howto/*.txt) >$@+
	mv $@+ $@

J
Junio C Hamano 已提交
91 92
$(patsubst %,%.html,$(ARTICLES)) : %.html : %.txt
	asciidoc -b xhtml11 $*.txt
93 94 95

WEBDOC_DEST = /pub/software/scm/git/docs

96 97 98 99 100
$(patsubst %.txt,%.html,$(wildcard howto/*.txt)): %.html : %.txt
	rm -f $@+ $@
	sed -e '1,/^$$/d' $? | asciidoc -b xhtml11 - >$@+
	mv $@+ $@

101 102
install-webdoc : html
	sh ./install-webdoc.sh $(WEBDOC_DEST)