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