Documentation / Makefileon commit Merge refs/heads/master from paulus (5101710)
   1MAN1_TXT=$(wildcard git-*.txt) gitk.txt
   2MAN7_TXT=git.txt
   3
   4DOC_HTML=$(patsubst %.txt,%.html,$(MAN1_TXT) $(MAN7_TXT))
   5DOC_HTML += glossary.html
   6DOC_HTML += tutorial.html
   7DOC_HTML += howto-index.html
   8DOC_HTML += howto/revert-branch-rebase.html
   9
  10DOC_MAN1=$(patsubst %.txt,%.1,$(MAN1_TXT))
  11DOC_MAN7=$(patsubst %.txt,%.7,$(MAN7_TXT))
  12
  13prefix=$(HOME)
  14bin=$(prefix)/bin
  15mandir=$(prefix)/man
  16man1=$(mandir)/man1
  17man7=$(mandir)/man7
  18# DESTDIR=
  19
  20INSTALL=install
  21
  22#
  23# Please note that there is a minor bug in asciidoc.
  24# The version after 6.0.3 _will_ include the patch found here:
  25#   http://marc.theaimsgroup.com/?l=git&m=111558757202243&w=2
  26#
  27# Until that version is released you may have to apply the patch
  28# yourself - yes, all 6 characters of it!
  29#
  30
  31all: html man
  32
  33html: $(DOC_HTML)
  34
  35
  36man: man1 man7
  37man1: $(DOC_MAN1)
  38man7: $(DOC_MAN7)
  39
  40install:
  41        $(INSTALL) -m755 -d $(DESTDIR)/$(man1) $(DESTDIR)/$(man7)
  42        $(INSTALL) $(DOC_MAN1) $(DESTDIR)/$(man1)
  43        $(INSTALL) $(DOC_MAN7) $(DESTDIR)/$(man7)
  44
  45# 'include' dependencies
  46git-diff-%.txt: diff-format.txt diff-options.txt
  47        touch $@
  48
  49clean:
  50        rm -f *.xml *.html *.1 *.7 howto-index.txt howto/*.html
  51
  52%.html : %.txt
  53        asciidoc -b xhtml11 -d manpage $<
  54
  55%.1 %.7 : %.xml
  56        xmlto man $<
  57
  58%.xml : %.txt
  59        asciidoc -b docbook -d manpage $<
  60
  61glossary.html : glossary.txt sort_glossary.pl
  62        cat $< | \
  63        perl sort_glossary.pl | \
  64        asciidoc -b xhtml11 - > glossary.html
  65
  66tutorial.html : tutorial.txt
  67        asciidoc -b xhtml11 tutorial.txt
  68
  69howto-index.txt: howto-index.sh $(wildcard howto/*.txt)
  70        rm -f $@+ $@
  71        sh ./howto-index.sh $(wildcard howto/*.txt) >$@+
  72        mv $@+ $@
  73
  74howto-index.html: howto-index.txt
  75        asciidoc -b xhtml11 howto-index.txt
  76
  77WEBDOC_DEST = /pub/software/scm/git/docs
  78
  79$(patsubst %.txt,%.html,$(wildcard howto/*.txt)): %.html : %.txt
  80        rm -f $@+ $@
  81        sed -e '1,/^$$/d' $? | asciidoc -b xhtml11 - >$@+
  82        mv $@+ $@
  83
  84install-webdoc : html
  85        sh ./install-webdoc.sh $(WEBDOC_DEST)