Documentation / Makefileon commit Merge branch 'jc/fix5500' into next (8a642a7)
   1MAN1_TXT= \
   2        $(filter-out $(addsuffix .txt, $(ARTICLES) $(SP_ARTICLES)), \
   3                $(wildcard git-*.txt)) \
   4        gitk.txt
   5MAN7_TXT=git.txt
   6
   7DOC_HTML=$(patsubst %.txt,%.html,$(MAN1_TXT) $(MAN7_TXT))
   8
   9ARTICLES = tutorial
  10ARTICLES += core-tutorial
  11ARTICLES += cvs-migration
  12ARTICLES += diffcore
  13ARTICLES += howto-index
  14ARTICLES += repository-layout
  15ARTICLES += hooks
  16ARTICLES += everyday
  17ARTICLES += git-tools
  18# with their own formatting rules.
  19SP_ARTICLES = glossary howto/revert-branch-rebase
  20
  21DOC_HTML += $(patsubst %,%.html,$(ARTICLES) $(SP_ARTICLES))
  22
  23DOC_MAN1=$(patsubst %.txt,%.1,$(MAN1_TXT))
  24DOC_MAN7=$(patsubst %.txt,%.7,$(MAN7_TXT))
  25
  26prefix?=$(HOME)
  27bin=$(prefix)/bin
  28mandir=$(prefix)/man
  29man1=$(mandir)/man1
  30man7=$(mandir)/man7
  31# DESTDIR=
  32
  33INSTALL?=install
  34
  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
  44all: html man
  45
  46html: $(DOC_HTML)
  47
  48
  49man: man1 man7
  50man1: $(DOC_MAN1)
  51man7: $(DOC_MAN7)
  52
  53install: man
  54        $(INSTALL) -d -m755 $(DESTDIR)/$(man1) $(DESTDIR)/$(man7)
  55        $(INSTALL) $(DOC_MAN1) $(DESTDIR)/$(man1)
  56        $(INSTALL) $(DOC_MAN7) $(DESTDIR)/$(man7)
  57
  58
  59#
  60# Determine "include::" file references in asciidoc files.
  61#
  62doc.dep : $(wildcard *.txt) build-docdep.perl
  63        rm -f $@+ $@
  64        perl ./build-docdep.perl >$@+
  65        mv $@+ $@
  66
  67-include doc.dep
  68
  69git.7: README
  70
  71README: ../README
  72        cp $< $@
  73
  74
  75clean:
  76        rm -f *.xml *.html *.1 *.7 howto-index.txt howto/*.html doc.dep README
  77
  78%.html : %.txt
  79        asciidoc -b xhtml11 -d manpage -f asciidoc.conf $<
  80
  81%.1 %.7 : %.xml
  82        xmlto man $<
  83
  84%.xml : %.txt
  85        asciidoc -b docbook -d manpage -f asciidoc.conf $<
  86
  87git.html: git.txt README
  88
  89glossary.html : glossary.txt sort_glossary.pl
  90        cat $< | \
  91        perl sort_glossary.pl | \
  92        asciidoc -b xhtml11 - > glossary.html
  93
  94howto-index.txt: howto-index.sh $(wildcard howto/*.txt)
  95        rm -f $@+ $@
  96        sh ./howto-index.sh $(wildcard howto/*.txt) >$@+
  97        mv $@+ $@
  98
  99$(patsubst %,%.html,$(ARTICLES)) : %.html : %.txt
 100        asciidoc -b xhtml11 $*.txt
 101
 102WEBDOC_DEST = /pub/software/scm/git/docs
 103
 104$(patsubst %.txt,%.html,$(wildcard howto/*.txt)): %.html : %.txt
 105        rm -f $@+ $@
 106        sed -e '1,/^$$/d' $? | asciidoc -b xhtml11 - >$@+
 107        mv $@+ $@
 108
 109install-webdoc : html
 110        sh ./install-webdoc.sh $(WEBDOC_DEST)