From 162541df8e380b53c3cc5f01a4d544e541002804 Mon Sep 17 00:00:00 2001
From: Sebastian Freundt <freundt@ga-group.nl>
Date: Fri, 10 Aug 2012 10:14:32 +0000
Subject: [PATCH] facilitate out of tree builds, esp. in doc/

This changeset removes the cd'ing into $(srcdir) when building the doc
target files (.dvi, .info, etc.).  That way relative paths (like TEXI2HTML)
still work, as their value solely depends on $(srcdir) and disregard
the cd'ing.
---
 doc/Makefile.in |   52 ++++++++++++++++++++++++++--------------------------
 1 file changed, 26 insertions(+), 26 deletions(-)

diff --git a/doc/Makefile.in b/doc/Makefile.in
index bca44f5..a909256 100644
--- a/doc/Makefile.in
+++ b/doc/Makefile.in
@@ -66,65 +66,65 @@ VPATH = $(srcdir)
 all : info ps pdf html man
 
 
-info : $(srcdir)/gperf.info
+info : gperf.info
 
-$(srcdir)/gperf.info : $(srcdir)/gperf.texi $(srcdir)/gpl-3.0.texi
-	cd $(srcdir) && $(MAKEINFO) --no-split gperf.texi
+gperf.info : $(srcdir)/gperf.texi $(srcdir)/gpl-3.0.texi
+	$(MAKEINFO) --no-split $<
 
 
-dvi : $(srcdir)/gperf.dvi
+dvi : gperf.dvi
 
-$(srcdir)/gperf.dvi : $(srcdir)/gperf.texi $(srcdir)/gpl-3.0.texi
-	cd $(srcdir) && $(RM) gperf.aux gperf.toc gperf.cp gperf.fn gperf.ky gperf.pg gperf.tp gperf.vr gperf.log gperf.cps
-	cd $(srcdir) && $(TEXI2DVI) gperf.texi
-	cd $(srcdir) && $(RM) gperf.aux gperf.toc gperf.cp gperf.fn gperf.ky gperf.pg gperf.tp gperf.vr gperf.log gperf.cps
+gperf.dvi : $(srcdir)/gperf.texi $(srcdir)/gpl-3.0.texi
+	$(RM) gperf.aux gperf.toc gperf.cp gperf.fn gperf.ky gperf.pg gperf.tp gperf.vr gperf.log gperf.cps
+	$(TEXI2DVI) $<
+	$(RM) gperf.aux gperf.toc gperf.cp gperf.fn gperf.ky gperf.pg gperf.tp gperf.vr gperf.log gperf.cps
 
 
-ps : $(srcdir)/gperf.ps
+ps : gperf.ps
 
-$(srcdir)/gperf.ps : $(srcdir)/gperf.dvi
-	$(DVIPS) -o $@ $(srcdir)/gperf.dvi
+gperf.ps : gperf.dvi
+	$(DVIPS) -o $@ $<
 
 
-pdf : $(srcdir)/gperf.pdf
+pdf : gperf.pdf
 
-$(srcdir)/gperf.pdf : $(srcdir)/gperf.texi $(srcdir)/gpl-3.0.texi
-	cd $(srcdir) && $(RM) gperf.aux gperf.toc gperf.cp gperf.fn gperf.ky gperf.pg gperf.tp gperf.vr gperf.log gperf.cps
-	cd $(srcdir) && $(TEXI2PDF) gperf.texi
-	cd $(srcdir) && $(RM) gperf.aux gperf.toc gperf.cp gperf.fn gperf.ky gperf.pg gperf.tp gperf.vr gperf.log gperf.cps
+gperf.pdf : $(srcdir)/gperf.texi $(srcdir)/gpl-3.0.texi
+	$(RM) gperf.aux gperf.toc gperf.cp gperf.fn gperf.ky gperf.pg gperf.tp gperf.vr gperf.log gperf.cps
+	$(TEXI2PDF) $<
+	$(RM) gperf.aux gperf.toc gperf.cp gperf.fn gperf.ky gperf.pg gperf.tp gperf.vr gperf.log gperf.cps
 
 
 html : gperf.html gperf_toc.html
 
 gperf.html : $(srcdir)/gperf.texi $(srcdir)/gpl-3.0.texi
-	cd $(srcdir) && $(TEXI2HTML) -number -monolithic gperf.texi
+	$(TEXI2HTML) -number -monolithic $<
 
 gperf_toc.html : $(srcdir)/gperf.texi $(srcdir)/gpl-3.0.texi
-	cd $(srcdir) && $(RM) gperf_*.html
-	cd $(srcdir) && $(TEXI2HTML) -number -split_chapter gperf.texi
+	$(RM) gperf_*.html
+	$(TEXI2HTML) -number -split_chapter $<
 
 
 man : gperf.1
 
 gperf.1 gperf.1-update :
-	./help2man --name='generate a perfect hash function from a key set' --section=1 ../src/gperf > gperf.1
+	$(srcdir)/help2man --name='generate a perfect hash function from a key set' --section=1 ../src/gperf > gperf.1
 
 gperf.1-update : force
 
 
 install : all force
 	$(MKINSTALLDIRS) $(DESTDIR)$(infodir)
-	$(INSTALL_DATA) $(srcdir)/gperf.info $(DESTDIR)$(infodir)/gperf.info
+	$(INSTALL_DATA) gperf.info $(DESTDIR)$(infodir)/gperf.info
 	$(MKINSTALLDIRS) $(DESTDIR)$(man1dir)
-	$(INSTALL_DATA) $(srcdir)/gperf.1 $(DESTDIR)$(man1dir)/gperf.1
+	$(INSTALL_DATA) gperf.1 $(DESTDIR)$(man1dir)/gperf.1
 #	$(MKINSTALLDIRS) $(DESTDIR)$(dvidir)
-#	$(INSTALL_DATA) $(srcdir)/gperf.dvi $(DESTDIR)$(dvidir)/gperf.dvi
+#	$(INSTALL_DATA) gperf.dvi $(DESTDIR)$(dvidir)/gperf.dvi
 #	$(MKINSTALLDIRS) $(DESTDIR)$(psdir)
-#	$(INSTALL_DATA) $(srcdir)/gperf.ps $(DESTDIR)$(psdir)/gperf.ps
+#	$(INSTALL_DATA) gperf.ps $(DESTDIR)$(psdir)/gperf.ps
 #	$(MKINSTALLDIRS) $(DESTDIR)$(pdfdir)
-#	$(INSTALL_DATA) $(srcdir)/gperf.pdf $(DESTDIR)$(pdfdir)/gperf.pdf
+#	$(INSTALL_DATA) gperf.pdf $(DESTDIR)$(pdfdir)/gperf.pdf
 	$(MKINSTALLDIRS) $(DESTDIR)$(htmldir)
-	$(INSTALL_DATA) $(srcdir)/gperf.html $(DESTDIR)$(htmldir)/gperf.html
+	$(INSTALL_DATA) gperf.html $(DESTDIR)$(htmldir)/gperf.html
 
 installdirs : force
 	$(MKINSTALLDIRS) $(DESTDIR)$(infodir)
-- 
1.7.10.227.gd1ca7

