[PATCH] Add support for building documentation in separate build-dir too.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>From 6969e092758f65e8b4b3875ab3050cd0c049cc60 Mon Sep 17 00:00:00 2001
From: Han-Wen Nienhuys <hanwen@xxxxxxxxx>
Date: Fri, 8 Dec 2006 18:09:23 +0100


Signed-off-by: Han-Wen Nienhuys <hanwen@xxxxxxxxx>
---
 Documentation/Makefile |   33 ++++++++++++++++++++-------------
 1 files changed, 20 insertions(+), 13 deletions(-)

diff --git a/Documentation/Makefile b/Documentation/Makefile
index c00f5f6..51cd707 100644
--- a/Documentation/Makefile
+++ b/Documentation/Makefile
@@ -1,6 +1,6 @@
 MAN1_TXT= \
 	$(filter-out $(addsuffix .txt, $(ARTICLES) $(SP_ARTICLES)), \
-		$(wildcard git-*.txt)) \
+		$(wildcard $(here-srcdir)/git-*.txt)) \
 	gitk.txt
 MAN7_TXT=git.txt
 
@@ -33,8 +33,15 @@ man7dir=$(mandir)/man7
 
 INSTALL?=install
 
--include ../config.mak.autogen
+ifndef srcdir
+srcdir=..
+endif
+
+here-srcdir=$(srcdir)/Documentation
 
+ASCIIDOC_CONF=$(here-srcdir)/asciidoc.conf
+
+-include ../config.mak.autogen
 #
 # Please note that there is a minor bug in asciidoc.
 # The version after 6.0.3 _will_ include the patch found here:
@@ -63,9 +70,9 @@ install: man
 #
 # Determine "include::" file references in asciidoc files.
 #
-doc.dep : $(wildcard *.txt) build-docdep.perl
+doc.dep : $(wildcard $(here-srcdir)/*.txt) build-docdep.perl
 	rm -f $@+ $@
-	perl ./build-docdep.perl >$@+
+	perl $(lastword $^) >$@+
 	mv $@+ $@
 
 -include doc.dep
@@ -80,35 +87,35 @@ clean:
 	rm -f *.xml *.html *.1 *.7 howto-index.txt howto/*.html doc.dep README
 
 %.html : %.txt
-	asciidoc -b xhtml11 -d manpage -f asciidoc.conf $<
+	asciidoc -b xhtml11 -d manpage -f $(ASCIIDOC_CONF) $<
 
 %.1 %.7 : %.xml
-	xmlto -m callouts.xsl man $<
+	xmlto --searchpath $(here-srcdir)/  -m callouts.xsl man $<
 
 %.xml : %.txt
-	asciidoc -b docbook -d manpage -f asciidoc.conf $<
+	asciidoc -b docbook -d manpage -f $(ASCIIDOC_CONF) $<
 
 git.html: git.txt README
 
 glossary.html : glossary.txt sort_glossary.pl
 	cat $< | \
-	perl sort_glossary.pl | \
+	perl $(lastword $^) | \
 	asciidoc -b xhtml11 - > glossary.html
 
-howto-index.txt: howto-index.sh $(wildcard howto/*.txt)
+howto-index.txt: howto-index.sh $(wildcard $(here-srcdir)/howto/*.txt)
 	rm -f $@+ $@
-	sh ./howto-index.sh $(wildcard howto/*.txt) >$@+
+	sh $^ >$@+
 	mv $@+ $@
 
 $(patsubst %,%.html,$(ARTICLES)) : %.html : %.txt
-	asciidoc -b xhtml11 $*.txt
+	asciidoc -b xhtml11 $<
 
 WEBDOC_DEST = /pub/software/scm/git/docs
 
-$(patsubst %.txt,%.html,$(wildcard howto/*.txt)): %.html : %.txt
+$(patsubst %.txt,%.html,$(wildcard $(here-srcdir)/howto/*.txt)): %.html : %.txt
 	rm -f $@+ $@
 	sed -e '1,/^$$/d' $< | asciidoc -b xhtml11 - >$@+
 	mv $@+ $@
 
 install-webdoc : html
-	sh ./install-webdoc.sh $(WEBDOC_DEST)
+	sh $(here-srcdir)/install-webdoc.sh $(WEBDOC_DEST)
-- 
1.4.4.1.gc9922-dirty


-- 
 Han-Wen Nienhuys - hanwen@xxxxxxxxx - http://www.xs4all.nl/~hanwen

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]