This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch] Implement "make pdf" and "make install-pdf" targets.
- From: Brooks Moses <brooks dot moses at codesourcery dot com>
- To: gdb-patches at sources dot redhat dot com
- Date: Fri, 23 Feb 2007 01:26:11 -0800
- Subject: Re: [patch] Implement "make pdf" and "make install-pdf" targets.
- References: <45DE9FE6.8090507@codesourcery.com>
Brooks Moses wrote:
The attached patch implements "make pdf" in all of the parts of src/
included in the GDB source tarball, and also implements "make
install-pdf" within src/gdb.
[...]
etc/ChangeLog -------------------------------------------------
2007-02-20 Brooks Moses <brooks.moses@codesourcery.com>
* Makefile.in: Add support for a "pdf" target.
Argh -- I just realized that this bit of the patch doesn't actually do
what it's supposed to, though the "make dvi" rules in etc/Makefile.in
that I copied are too clever by half and thus fail silently rather than
breaking. The attached revised patch does the right thing, and also
implements an "install-pdf" target (based off the "install-info"
target). Thus, the revised ChangeLog line:
etc/ChangeLog -------------------------------------------------
2007-02-20 Brooks Moses <brooks.moses@codesourcery.com>
* Makefile.in: Add support for "pdf" and "install-pdf" targets.
---------------------------------------------------------------
One relevant note is that this now depends on epstopdf to generate the
figures for configure.pdf from the .eps versions. This is a script
included with the standard TeX distribution (needed for texi2dvi to
run), though, so I don't think it's a worrisome extra dependency.
Again, tested on i686-pc-linux-gnu, and this time I made sure _all_ the
pdf files were generated correctly! :)
- Brooks
Index: etc/Makefile.in
===================================================================
RCS file: /cvs/src/src/etc/Makefile.in,v
retrieving revision 1.6
diff -U3 -r1.6 Makefile.in
--- etc/Makefile.in 6 Apr 2006 21:49:30 -0000 1.6
+++ etc/Makefile.in 23 Feb 2007 09:09:03 -0000
@@ -28,6 +28,7 @@
datarootdir = @datarootdir@
docdir = @docdir@
infodir = @infodir@
+pdfdir = @docdir@
htmldir = @htmldir@
SHELL = /bin/sh
@@ -42,6 +43,9 @@
TEXI2DVI = `if [ -f ../texinfo/util/texi2dvi ]; \
then echo ../texinfo/util/texi2dvi; \
else echo texi2dvi; fi`
+TEXI2PDF = `if [ -f ../texinfo/util/texi2dvi ]; \
+ then echo "../texinfo/util/texi2dvi --pdf"; \
+ else echo "texi2dvi --pdf"; fi`
TEXI2HTML = `if [ -f ../texinfo/makeinfo/makeinfo ]; \
then echo "../texinfo/makeinfo/makeinfo --html"; \
else echo "makeinfo --html"; fi`
@@ -56,6 +60,7 @@
INFOFILES = standards.info configure.info
DVIFILES = standards.dvi configure.dvi
+PDFFILES = standards.pdf configure.pdf
HTMLFILES = standards.html configure.html
all: info
@@ -126,6 +131,32 @@
fi; \
done
+pdf:
+ for f in $(PDFFILES); do \
+ if test -f $(srcdir)/`echo $$f | sed -e 's/.pdf$$/.texi/'`; then \
+ if $(MAKE) "TEXI2PDF=$(TEXI2PDF)" $$f; then \
+ true; \
+ else \
+ exit 1; \
+ fi; \
+ fi; \
+ done
+
+install-pdf: pdf
+ $(SHELL) $(srcdir)/../mkinstalldirs $(DESTDIR)$(pdfdir)/etc
+ if test ! -f standards.pdf; then cd $(srcdir); fi; \
+ if test -f standards.pdf; then \
+ for i in standards.pdf*; do \
+ $(INSTALL_DATA) $$i $(DESTDIR)$(pdfdir)/etc/$$i; \
+ done; \
+ fi
+ if test ! -f configure.pdf; then cd $(srcdir); fi; \
+ if test -f configure.pdf; then \
+ for i in configure.pdf*; do \
+ $(INSTALL_DATA) $$i $(DESTDIR)$(pdfdir)/etc/$$i; \
+ done; \
+ fi
+
standards.info: $(srcdir)/standards.texi $(srcdir)/make-stds.texi
$(MAKEINFO) --no-split -I$(srcdir) -o standards.info $(srcdir)/standards.texi
@@ -138,6 +169,9 @@
standards.ps: standards.dvi
$(DVIPS) standards.dvi -o standards.ps
+standards.pdf: $(srcdir)/standards.texi
+ TEXINPUTS=$(TEXIDIR):$$TEXINPUTS $(TEXI2PDF) $(srcdir)/standards.texi
+
# makeinfo requires images to be in the current directory.
configure.info: $(srcdir)/configure.texi $(srcdir)/configdev.tin $(srcdir)/configbuild.tin
rm -f configdev.txt configbuild.txt
@@ -166,6 +200,13 @@
$(DVIPS) configure.dvi -o configure.ps
rm -f configdev.eps configbuild.eps
+configure.pdf: $(srcdir)/configure.texi $(srcdir)/configdev.tin $(srcdir)/configbuild.tin $(srcdir)/configdev.ein $(srcdir)/configbuild.ein
+ rm -f configdev.pdf configbuild.pdf
+ epstopdf $(srcdir)/configdev.ein -outfile=configdev.pdf
+ epstopdf $(srcdir)/configbuild.ein -outfile=configbuild.pdf
+ TEXINPUTS=$(TEXIDIR):$$TEXINPUTS $(TEXI2PDF) $(srcdir)/configure.texi
+ rm -f configdev.pdf configbuild.pdf
+
configure.html: $(srcdir)/configure.texi
cp $(srcdir)/configdev.jin configdev.jpg
cp $(srcdir)/configbuild.jin configbuild.jpg