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

4
DOC_HTML=$(patsubst %.txt,%.html,$(MAN1_TXT) $(MAN7_TXT)) glossary.html
D
David Greaves 已提交
5 6 7 8

DOC_MAN1=$(patsubst %.txt,%.1,$(MAN1_TXT))
DOC_MAN7=$(patsubst %.txt,%.7,$(MAN7_TXT))

9 10 11 12 13
prefix=$(HOME)
bin=$(prefix)/bin
mandir=$(prefix)/man
man1=$(mandir)/man1
man7=$(mandir)/man7
14
# DESTDIR=
15 16 17

INSTALL=install

D
David Greaves 已提交
18 19 20 21 22 23 24 25 26 27
#
# 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
28 29 30

html: $(DOC_HTML)

D
David Greaves 已提交
31 32 33 34

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

36
install:
37 38 39
	$(INSTALL) -m755 -d $(DESTDIR)/$(man1) $(DESTDIR)/$(man7)
	$(INSTALL) $(DOC_MAN1) $(DESTDIR)/$(man1)
	$(INSTALL) $(DOC_MAN7) $(DESTDIR)/$(man7)
40

41
# 'include' dependencies
42
git-diff-%.txt: diff-format.txt diff-options.txt
43
	touch $@
44 45

clean:
46
	rm -f *.xml *.html *.1 *.7
47 48

%.html : %.txt
L
Linus Torvalds 已提交
49
	asciidoc -b xhtml11 -d manpage $<
50

51
%.1 %.7 : %.xml
52 53 54 55
	xmlto man $<

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

57 58 59 60 61
glossary.html : glossary.txt sort_glossary.pl
	cat $< | \
	perl sort_glossary.pl | \
	asciidoc -b xhtml11 - > glossary.html