2006-03-05 17:36:33 +08:00
|
|
|
MAN1_TXT= \
|
|
|
|
$(filter-out $(addsuffix .txt, $(ARTICLES) $(SP_ARTICLES)), \
|
|
|
|
$(wildcard git-*.txt)) \
|
|
|
|
gitk.txt
|
2007-06-12 15:05:21 +08:00
|
|
|
MAN5_TXT=gitattributes.txt gitignore.txt gitmodules.txt
|
2005-05-23 01:44:15 +08:00
|
|
|
MAN7_TXT=git.txt
|
2005-05-11 05:32:39 +08:00
|
|
|
|
2007-04-20 11:47:04 +08:00
|
|
|
DOC_HTML=$(patsubst %.txt,%.html,$(MAN1_TXT) $(MAN5_TXT) $(MAN7_TXT))
|
2005-08-31 04:51:01 +08:00
|
|
|
|
2005-09-02 07:56:13 +08:00
|
|
|
ARTICLES = tutorial
|
2006-05-22 07:49:34 +08:00
|
|
|
ARTICLES += tutorial-2
|
2006-01-23 14:43:59 +08:00
|
|
|
ARTICLES += core-tutorial
|
2005-09-02 07:56:13 +08:00
|
|
|
ARTICLES += cvs-migration
|
|
|
|
ARTICLES += diffcore
|
|
|
|
ARTICLES += howto-index
|
|
|
|
ARTICLES += repository-layout
|
2005-09-03 12:19:26 +08:00
|
|
|
ARTICLES += hooks
|
2005-12-10 15:07:29 +08:00
|
|
|
ARTICLES += everyday
|
2006-03-05 17:36:33 +08:00
|
|
|
ARTICLES += git-tools
|
2007-03-19 05:02:37 +08:00
|
|
|
ARTICLES += glossary
|
2005-08-31 04:51:01 +08:00
|
|
|
# with their own formatting rules.
|
2007-03-19 05:02:37 +08:00
|
|
|
SP_ARTICLES = howto/revert-branch-rebase user-manual
|
2005-08-31 04:51:01 +08:00
|
|
|
|
|
|
|
DOC_HTML += $(patsubst %,%.html,$(ARTICLES) $(SP_ARTICLES))
|
2005-08-30 14:09:22 +08:00
|
|
|
|
2005-05-23 01:44:15 +08:00
|
|
|
DOC_MAN1=$(patsubst %.txt,%.1,$(MAN1_TXT))
|
2007-04-22 15:11:41 +08:00
|
|
|
DOC_MAN5=$(patsubst %.txt,%.5,$(MAN5_TXT))
|
2005-05-23 01:44:15 +08:00
|
|
|
DOC_MAN7=$(patsubst %.txt,%.7,$(MAN7_TXT))
|
|
|
|
|
2005-10-09 06:54:37 +08:00
|
|
|
prefix?=$(HOME)
|
2006-06-30 04:11:25 +08:00
|
|
|
bindir?=$(prefix)/bin
|
2007-05-08 18:49:31 +08:00
|
|
|
mandir?=$(prefix)/share/man
|
2006-06-30 05:26:54 +08:00
|
|
|
man1dir=$(mandir)/man1
|
2007-04-20 11:47:04 +08:00
|
|
|
man5dir=$(mandir)/man5
|
2006-06-30 05:26:54 +08:00
|
|
|
man7dir=$(mandir)/man7
|
2005-08-05 07:56:38 +08:00
|
|
|
# DESTDIR=
|
2005-07-15 09:21:57 +08:00
|
|
|
|
2007-02-11 23:54:40 +08:00
|
|
|
ASCIIDOC=asciidoc
|
2007-02-14 07:15:05 +08:00
|
|
|
ASCIIDOC_EXTRA =
|
2005-10-09 06:54:37 +08:00
|
|
|
INSTALL?=install
|
2007-07-15 01:51:44 +08:00
|
|
|
RM ?= rm -f
|
2006-12-24 00:26:09 +08:00
|
|
|
DOC_REF = origin/man
|
2005-07-15 09:21:57 +08:00
|
|
|
|
2007-08-06 18:22:57 +08:00
|
|
|
infodir?=$(prefix)/share/info
|
|
|
|
MAKEINFO=makeinfo
|
|
|
|
INSTALL_INFO=install-info
|
|
|
|
DOCBOOK2X_TEXI=docbook2x-texi
|
2007-12-01 10:36:34 +08:00
|
|
|
ifndef PERL_PATH
|
|
|
|
PERL_PATH = /usr/bin/perl
|
|
|
|
endif
|
2007-08-06 18:22:57 +08:00
|
|
|
|
2006-09-01 06:31:08 +08:00
|
|
|
-include ../config.mak.autogen
|
2007-03-01 04:57:42 +08:00
|
|
|
-include ../config.mak
|
2006-09-01 06:31:08 +08:00
|
|
|
|
2007-11-14 17:38:46 +08:00
|
|
|
ifdef ASCIIDOC8
|
|
|
|
ASCIIDOC_EXTRA += -a asciidoc7compatible
|
|
|
|
endif
|
|
|
|
ifdef DOCBOOK_XSL_172
|
|
|
|
ASCIIDOC_EXTRA += -a docbook-xsl-172
|
|
|
|
endif
|
|
|
|
|
2005-05-23 01:44:15 +08:00
|
|
|
#
|
|
|
|
# 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
|
2005-05-11 05:32:39 +08:00
|
|
|
|
|
|
|
html: $(DOC_HTML)
|
|
|
|
|
2007-04-20 11:47:04 +08:00
|
|
|
$(DOC_HTML) $(DOC_MAN1) $(DOC_MAN5) $(DOC_MAN7): asciidoc.conf
|
2005-05-23 01:44:15 +08:00
|
|
|
|
2007-04-20 11:47:04 +08:00
|
|
|
man: man1 man5 man7
|
2005-05-23 01:44:15 +08:00
|
|
|
man1: $(DOC_MAN1)
|
2007-04-20 11:47:04 +08:00
|
|
|
man5: $(DOC_MAN5)
|
2005-05-23 01:44:15 +08:00
|
|
|
man7: $(DOC_MAN7)
|
2005-05-11 05:32:39 +08:00
|
|
|
|
2007-08-06 18:22:57 +08:00
|
|
|
info: git.info
|
|
|
|
|
2005-09-22 03:29:59 +08:00
|
|
|
install: man
|
2007-12-02 01:05:40 +08:00
|
|
|
$(INSTALL) -d -m 755 $(DESTDIR)$(man1dir)
|
|
|
|
$(INSTALL) -d -m 755 $(DESTDIR)$(man5dir)
|
|
|
|
$(INSTALL) -d -m 755 $(DESTDIR)$(man7dir)
|
|
|
|
$(INSTALL) -m 644 $(DOC_MAN1) $(DESTDIR)$(man1dir)
|
|
|
|
$(INSTALL) -m 644 $(DOC_MAN5) $(DESTDIR)$(man5dir)
|
|
|
|
$(INSTALL) -m 644 $(DOC_MAN7) $(DESTDIR)$(man7dir)
|
2005-07-15 09:21:57 +08:00
|
|
|
|
2007-08-06 18:22:57 +08:00
|
|
|
install-info: info
|
2007-12-02 01:05:40 +08:00
|
|
|
$(INSTALL) -d -m 755 $(DESTDIR)$(infodir)
|
|
|
|
$(INSTALL) -m 644 git.info $(DESTDIR)$(infodir)
|
2007-08-06 18:22:57 +08:00
|
|
|
if test -r $(DESTDIR)$(infodir)/dir; then \
|
|
|
|
$(INSTALL_INFO) --info-dir=$(DESTDIR)$(infodir) git.info ;\
|
|
|
|
else \
|
|
|
|
echo "No directory found in $(DESTDIR)$(infodir)" >&2 ; \
|
|
|
|
fi
|
2005-11-04 16:06:20 +08:00
|
|
|
|
2007-03-25 19:56:49 +08:00
|
|
|
../GIT-VERSION-FILE: .FORCE-GIT-VERSION-FILE
|
|
|
|
$(MAKE) -C ../ GIT-VERSION-FILE
|
|
|
|
|
|
|
|
-include ../GIT-VERSION-FILE
|
|
|
|
|
2005-11-07 13:30:56 +08:00
|
|
|
#
|
|
|
|
# Determine "include::" file references in asciidoc files.
|
|
|
|
#
|
2005-11-08 14:21:21 +08:00
|
|
|
doc.dep : $(wildcard *.txt) build-docdep.perl
|
2007-07-15 01:51:44 +08:00
|
|
|
$(RM) $@+ $@
|
2007-12-01 10:36:34 +08:00
|
|
|
$(PERL_PATH) ./build-docdep.perl >$@+
|
2005-11-08 10:21:51 +08:00
|
|
|
mv $@+ $@
|
2005-11-07 13:30:56 +08:00
|
|
|
|
2005-11-08 10:21:51 +08:00
|
|
|
-include doc.dep
|
2005-11-04 16:06:20 +08:00
|
|
|
|
2007-01-19 08:02:13 +08:00
|
|
|
cmds_txt = cmds-ancillaryinterrogators.txt \
|
|
|
|
cmds-ancillarymanipulators.txt \
|
|
|
|
cmds-mainporcelain.txt \
|
|
|
|
cmds-plumbinginterrogators.txt \
|
|
|
|
cmds-plumbingmanipulators.txt \
|
2007-01-19 14:32:38 +08:00
|
|
|
cmds-synchingrepositories.txt \
|
|
|
|
cmds-synchelpers.txt \
|
|
|
|
cmds-purehelpers.txt \
|
|
|
|
cmds-foreignscminterface.txt
|
2007-01-19 08:02:13 +08:00
|
|
|
|
2007-04-06 13:17:20 +08:00
|
|
|
$(cmds_txt): cmd-list.made
|
|
|
|
|
2007-12-02 15:39:19 +08:00
|
|
|
cmd-list.made: cmd-list.perl ../command-list.txt $(MAN1_TXT)
|
2007-08-06 21:05:56 +08:00
|
|
|
$(RM) $@
|
2007-12-01 10:36:34 +08:00
|
|
|
$(PERL_PATH) ./cmd-list.perl ../command-list.txt
|
2007-04-06 13:17:20 +08:00
|
|
|
date >$@
|
2005-05-11 05:32:39 +08:00
|
|
|
|
2007-09-03 12:01:19 +08:00
|
|
|
git.7 git.html: git.txt
|
2005-11-07 13:30:56 +08:00
|
|
|
|
2005-05-11 05:32:39 +08:00
|
|
|
clean:
|
2007-08-06 18:22:57 +08:00
|
|
|
$(RM) *.xml *.xml+ *.html *.html+ *.1 *.5 *.7 *.texi *.texi+ howto-index.txt howto/*.html doc.dep
|
2007-07-15 01:51:44 +08:00
|
|
|
$(RM) $(cmds_txt) *.made
|
2005-05-11 05:32:39 +08:00
|
|
|
|
|
|
|
%.html : %.txt
|
2007-07-15 01:51:44 +08:00
|
|
|
$(RM) $@+ $@
|
2007-03-25 19:56:49 +08:00
|
|
|
$(ASCIIDOC) -b xhtml11 -d manpage -f asciidoc.conf \
|
2007-06-01 17:10:30 +08:00
|
|
|
$(ASCIIDOC_EXTRA) -agit_version=$(GIT_VERSION) -o $@+ $<
|
2007-03-25 19:56:49 +08:00
|
|
|
mv $@+ $@
|
2005-05-11 05:32:39 +08:00
|
|
|
|
2007-04-20 11:47:04 +08:00
|
|
|
%.1 %.5 %.7 : %.xml
|
2007-08-02 07:48:44 +08:00
|
|
|
$(RM) $@
|
2006-04-28 21:15:06 +08:00
|
|
|
xmlto -m callouts.xsl man $<
|
2005-05-11 05:32:39 +08:00
|
|
|
|
|
|
|
%.xml : %.txt
|
2007-07-15 01:51:44 +08:00
|
|
|
$(RM) $@+ $@
|
2007-03-25 19:56:49 +08:00
|
|
|
$(ASCIIDOC) -b docbook -d manpage -f asciidoc.conf \
|
2007-06-01 17:10:30 +08:00
|
|
|
$(ASCIIDOC_EXTRA) -agit_version=$(GIT_VERSION) -o $@+ $<
|
2007-03-25 19:56:49 +08:00
|
|
|
mv $@+ $@
|
2005-08-15 08:24:36 +08:00
|
|
|
|
2007-01-08 08:23:49 +08:00
|
|
|
user-manual.xml: user-manual.txt user-manual.conf
|
2007-02-11 23:54:40 +08:00
|
|
|
$(ASCIIDOC) -b docbook -d book $<
|
2007-01-08 08:23:49 +08:00
|
|
|
|
2007-07-24 15:46:35 +08:00
|
|
|
XSLT = docbook.xsl
|
2007-03-16 23:45:29 +08:00
|
|
|
XSLTOPTS = --xinclude --stringparam html.stylesheet docbook-xsl.css
|
2007-03-04 02:33:48 +08:00
|
|
|
|
2007-01-08 08:23:49 +08:00
|
|
|
user-manual.html: user-manual.xml
|
2007-03-04 02:33:48 +08:00
|
|
|
xsltproc $(XSLTOPTS) -o $@ $(XSLT) $<
|
2007-01-08 08:23:49 +08:00
|
|
|
|
2007-08-06 18:22:57 +08:00
|
|
|
git.info: user-manual.xml
|
|
|
|
$(RM) $@ $*.texi $*.texi+
|
|
|
|
$(DOCBOOK2X_TEXI) user-manual.xml --to-stdout >$*.texi+
|
2007-12-01 10:36:34 +08:00
|
|
|
$(PERL_PATH) fix-texi.perl <$*.texi+ >$*.texi
|
2007-08-06 18:22:57 +08:00
|
|
|
$(MAKEINFO) --no-split $*.texi
|
|
|
|
$(RM) $*.texi $*.texi+
|
|
|
|
|
2005-08-25 15:28:18 +08:00
|
|
|
howto-index.txt: howto-index.sh $(wildcard howto/*.txt)
|
2007-07-15 01:51:44 +08:00
|
|
|
$(RM) $@+ $@
|
2005-08-25 15:28:18 +08:00
|
|
|
sh ./howto-index.sh $(wildcard howto/*.txt) >$@+
|
|
|
|
mv $@+ $@
|
|
|
|
|
2005-08-31 04:51:01 +08:00
|
|
|
$(patsubst %,%.html,$(ARTICLES)) : %.html : %.txt
|
2007-02-11 23:54:40 +08:00
|
|
|
$(ASCIIDOC) -b xhtml11 $*.txt
|
2005-08-25 15:28:18 +08:00
|
|
|
|
|
|
|
WEBDOC_DEST = /pub/software/scm/git/docs
|
|
|
|
|
2005-08-30 13:38:12 +08:00
|
|
|
$(patsubst %.txt,%.html,$(wildcard howto/*.txt)): %.html : %.txt
|
2007-07-15 01:51:44 +08:00
|
|
|
$(RM) $@+ $@
|
2007-02-11 23:54:40 +08:00
|
|
|
sed -e '1,/^$$/d' $< | $(ASCIIDOC) -b xhtml11 - >$@+
|
2005-08-30 13:38:12 +08:00
|
|
|
mv $@+ $@
|
|
|
|
|
2005-08-25 15:28:18 +08:00
|
|
|
install-webdoc : html
|
|
|
|
sh ./install-webdoc.sh $(WEBDOC_DEST)
|
2006-12-24 00:26:09 +08:00
|
|
|
|
|
|
|
quick-install:
|
|
|
|
sh ./install-doc-quick.sh $(DOC_REF) $(mandir)
|
2007-03-25 19:56:49 +08:00
|
|
|
|
|
|
|
.PHONY: .FORCE-GIT-VERSION-FILE
|