This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] Implement "make pdf" and "make install-pdf" targets.


Hello!

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.

Within gdb, the primary changes to implement a "pdf" target were just adding the targets into the makefiles, although I also added a rule to make refcard.pdf, paralleling the rule to make refcard.dvi. This also required adding page-size information to refcard.tex; the test for whether pdfTeX is in use is based on recommendations in the UK TeX FAQ.

The "install-pdf" rule in the gdb/doc Makefile.in is a slightly-edited copy of the stock rule from automake 1.10. Also, implementing "install-pdf" required specifying an install directory; I chose $(prefix)/share/doc/gdb, because that seems to be the standard from what automake uses, and share/doc is also where the toplevel configure puts the html documentation.

While the "pdf" target within src/gdb can stand alone, it's convenient to be able to issue a "make pdf" command within the top-level build directory, and it doesn't take very much to make this work, so I've tossed in the relevant patches for that. The src/sim and src/readline patches are just dummy targets, and the src/etc patch is a duplicate of its rule for making dvi files. I'm not sure where these bits actually need to go for approval, though; advice would be welcome!

The patch has been tested on i686-pc-linux-gnu, with "make pdf" from the top level of the build directory and "make install-pdf" from the build/gdb directory, and a "make" and "make dvi" from the top level to confirm it doesn't break things.

Ok to commit, at least for the gdb parts? (I don't have commit privileges, so someone else will need to commit this for me, if it's approved. Thanks!)

- Brooks


gdb/ChangeLog ------------------------------------------------- 2007-02-20 Brooks Moses <brooks.moses@codesourcery.com>

	* Makefile.in: Add support for a "pdf" target.
	* doc/Makefile.in: Add "pdfdir" installation
	directory, PDFTEX macro, support for "install-pdf" target,
	and rules for making a pdf version of refcard.texi.
	* doc/refcard.tex: Specify paper size for PDF output.
	* gdbserver/Makefile.in: Add dummy "pdf" and
	"install-pdf" targets.
	* testsuite/Makefile.in: Likewise.

etc/ChangeLog -------------------------------------------------
2007-02-20  Brooks Moses  <brooks.moses@codesourcery.com>

* Makefile.in: Add support for a "pdf" target.

sim/ChangeLog -------------------------------------------------
2007-02-20  Brooks Moses  <brooks.moses@codesourcery.com>

* Makefile.in: Add dummy "pdf" target.

readline/ChangeLog --------------------------------------------
2007-02-20  Brooks Moses  <brooks.moses@codesourcery.com>

* Makefile.in: Add dummy "pdf" target.

---------------------------------------------------------------
Index: gdb/Makefile.in
===================================================================
RCS file: /cvs/src/src/gdb/Makefile.in,v
retrieving revision 1.879
diff -U3 -r1.879 Makefile.in
--- gdb/Makefile.in	20 Feb 2007 16:05:54 -0000	1.879
+++ gdb/Makefile.in	22 Feb 2007 09:08:30 -0000
@@ -42,6 +42,7 @@
 man8dir = $(mandir)/man8
 man9dir = $(mandir)/man9
 infodir = @infodir@
+pdfdir = $(prefix)/share/doc/gdb
 htmldir = $(prefix)/html
 includedir = @includedir@
 
@@ -434,6 +435,7 @@
 	"prefix=$(prefix)" \
 	"exec_prefix=$(exec_prefix)" \
 	"infodir=$(infodir)" \
+	"pdfdir=$(pdfdir)" \
 	"libdir=$(libdir)" \
 	"mandir=$(mandir)" \
 	"datadir=$(datadir)" \
@@ -1050,7 +1052,7 @@
 	    "$$target"; \
 	else true; fi
 
-info dvi install-info clean-info html install-html: force
+info install-info clean-info dvi pdf install-pdf html install-html: force
 	@$(MAKE) $(FLAGS_TO_PASS) DO=$@ "DODIRS=$(SUBDIRS)" subdir_do
 
 gdb.z:gdb.1
Index: gdb/doc/Makefile.in
===================================================================
RCS file: /cvs/src/src/gdb/doc/Makefile.in,v
retrieving revision 1.37
diff -U3 -r1.37 Makefile.in
--- gdb/doc/Makefile.in	9 Jan 2007 17:59:07 -0000	1.37
+++ gdb/doc/Makefile.in	22 Feb 2007 09:08:46 -0000
@@ -24,6 +24,7 @@
 prefix = @prefix@
 
 infodir = @infodir@
+pdfdir = $(prefix)/share/doc/gdb
 htmldir = $(prefix)/html
 
 SHELL = @SHELL@
@@ -34,6 +35,8 @@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_DATA = @INSTALL_DATA@
 
+mkinstalldirs = $(SHELL) $(srcdir)/../../mkinstalldirs
+
 # main GDB source directory
 gdbdir = $(srcdir)/..
 
@@ -69,6 +72,9 @@
 # Files which should be generated via 'info' and installed by 'install-info'
 INFO_DEPS = gdb.info gdbint.info stabs.info annotate.info
 
+# Files which should be generated via 'pdf' and installed by 'install-pdf'
+PDFFILES = gdb.pdf gdbint.pdf stabs.pdf refcard.pdf annotate.pdf
+
 # There may be alternate predefined collections of switches to configure
 # the GDB manual.  Normally this is not done in synch with the software
 # config system, since this choice tends to be independent; most people
@@ -92,6 +98,7 @@
 
 # Don Knuth's TeX formatter
 TEX = tex
+PDFTEX = pdftex
 
 # Program to generate Postscript files from DVI files.
 DVIPS = dvips
@@ -151,7 +158,7 @@
 dvi: gdb.dvi gdbint.dvi stabs.dvi refcard.dvi annotate.dvi
 ps: gdb.ps gdbint.ps stabs.ps refcard.ps annotate.ps
 html: gdb_toc.html gdbint_toc.html stabs_toc.html annotate_toc.html
-pdf: gdb.pdf gdbint.pdf stabs.pdf annotate.pdf
+pdf: $(PDFFILES)
 all-doc: info dvi ps # pdf
 diststuff: info
 
@@ -197,6 +204,18 @@
 		$(INSTALL_DATA) $$i $(DESTDIR)$(htmldir)/$$i ; \
 	done
 
+pdf__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+
+install-pdf: $(PDFFILES)
+	@$(NORMAL_INSTALL)
+	test -z "$(pdfdir)" || $(mkinstalldirs) "$(DESTDIR)$(pdfdir)"
+	@list='$(PDFFILES)'; for p in $$list; do \
+	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+	  f=$(pdf__strip_dir) \
+	  echo " $(INSTALL_DATA) '$$d$$p' '$(DESTDIR)$(pdfdir)/$$f'"; \
+	  $(INSTALL_DATA) "$$d$$p" "$(DESTDIR)$(pdfdir)/$$f"; \
+	done
+
 STAGESTUFF = *.info* gdb-all.texi GDBvn.texi *.ps *.dvi *.pdf
 
 # Copy the object files from a particular stage into a subdirectory.
@@ -244,6 +263,17 @@
 refcard.ps : refcard.dvi
 	$(DVIPS) -t landscape -o $@ $?
 
+refcard.pdf : refcard.tex $(REFEDITS)
+	echo > tmp.sed
+	for f in x $(REFEDITS) ; do \
+		test x$$f = xx && continue ; \
+		cat $(srcdir)/$$f >>tmp.sed ; \
+	done
+	sed -f tmp.sed $(srcdir)/refcard.tex >sedref.tex
+	$(SET_TEXINPUTS) $(PDFTEX) sedref.tex
+	mv sedref.pdf refcard.pdf
+	rm -f sedref.log sedref.tex tmp.sed
+
 # File to record current GDB version number (copied from main dir version.in)
 GDBvn.texi : ${gdbdir}/version.in
 	echo "@set GDBVN `sed q $(srcdir)/../version.in`" > ./GDBvn.new
Index: gdb/doc/refcard.tex
===================================================================
RCS file: /cvs/src/src/gdb/doc/refcard.tex,v
retrieving revision 1.5
diff -U3 -r1.5 refcard.tex
--- gdb/doc/refcard.tex	23 Dec 2005 19:26:16 -0000	1.5
+++ gdb/doc/refcard.tex	22 Feb 2007 09:08:51 -0000
@@ -1,7 +1,7 @@
 %%%%%%%%%%%%%%%% gdb-refcard.tex %%%%%%%%%%%%%%%%
 
 %This file is TeX source for a reference card describing GDB, the GNU debugger.
-%Copyright (C) 1991, 1992, 1993, 1996, 1998, 1999, 2000
+%Copyright (C) 1991, 1992, 1993, 1996, 1998, 1999, 2000, 2007
 %Free Software Foundation, Inc.
 %Permission is granted to make and distribute verbatim copies of
 %this reference provided the copyright notices and permission notices
@@ -98,6 +98,10 @@
 \vmargin=.25in      % vertical margin width
 \secskip=1pc        % space between refcard secs
 \lskip=2pt          % extra skip between \sec entries
+\ifx\pdfoutput\undefined\else   % check if we are using pdfTeX
+  \pdfpagewidth=\totalwidth     % width of paper in pdf output
+  \pdfpageheight=\totalheight   % height of paper in pdf output
+\fi
 %------- end papersize params
 %%
 %%  change according to personal taste, not papersize dependent
Index: gdb/gdbserver/Makefile.in
===================================================================
RCS file: /cvs/src/src/gdb/gdbserver/Makefile.in,v
retrieving revision 1.42
diff -U3 -r1.42 Makefile.in
--- gdb/gdbserver/Makefile.in	8 Feb 2007 21:39:04 -0000	1.42
+++ gdb/gdbserver/Makefile.in	22 Feb 2007 09:08:59 -0000
@@ -176,8 +176,9 @@
 
 installcheck:
 check:
-info dvi:
+info dvi pdf:
 install-info:
+install-pdf:
 html:
 install-html:
 clean-info:
Index: gdb/testsuite/Makefile.in
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/Makefile.in,v
retrieving revision 1.16
diff -U3 -r1.16 Makefile.in
--- gdb/testsuite/Makefile.in	23 Jan 2007 17:11:54 -0000	1.16
+++ gdb/testsuite/Makefile.in	22 Feb 2007 09:09:01 -0000
@@ -91,6 +91,8 @@
 info:
 install-info:
 dvi:
+pdf:
+install-pdf:
 html:
 install-html:
 
Index: readline/Makefile.in
===================================================================
RCS file: /cvs/src/src/readline/Makefile.in,v
retrieving revision 1.8
diff -U3 -r1.8 Makefile.in
--- readline/Makefile.in	21 Oct 2006 20:47:07 -0000	1.8
+++ readline/Makefile.in	22 Feb 2007 09:09:30 -0000
@@ -297,7 +297,7 @@
 	$(RM) $(CREATED_CONFIGURE)
 	$(RM) $(CREATED_TAGS)
 
-info dvi:
+info dvi pdf:
 	-( cd doc && $(MAKE) $(MFLAGS) $@ )
 
 install-info:
Index: sim/Makefile.in
===================================================================
RCS file: /cvs/src/src/sim/Makefile.in,v
retrieving revision 1.12
diff -U3 -r1.12 Makefile.in
--- sim/Makefile.in	16 Feb 2007 18:13:53 -0000	1.12
+++ sim/Makefile.in	22 Feb 2007 09:09:44 -0000
@@ -186,6 +186,7 @@
 info:
 install-info:
 dvi:
+pdf:
 
 ### 
 ### 
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	22 Feb 2007 09:07:59 -0000
@@ -56,6 +56,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 +127,17 @@
 	  fi; \
 	done
 
+pdf:
+	for f in $(PDFFILES); do \
+	  if test -f $(srcdir)/`echo $$f | sed -e 's/.dvi$$/.texi/'`; then \
+	    if $(MAKE) "TEXI2DVI=$(TEXI2DVI)" --pdf $$f; then \
+	      true; \
+	    else \
+	      exit 1; \
+	    fi; \
+	  fi; \
+	done
+
 standards.info: $(srcdir)/standards.texi $(srcdir)/make-stds.texi
 	$(MAKEINFO) --no-split -I$(srcdir) -o standards.info $(srcdir)/standards.texi
 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]