Add "make pdf" and "make install-pdf", from Brooks Moses
authorDaniel Jacobowitz <drow@false.org>
Tue, 27 Mar 2007 18:09:36 +0000 (18:09 +0000)
committerDaniel Jacobowitz <drow@false.org>
Tue, 27 Mar 2007 18:09:36 +0000 (18:09 +0000)
<brooks.moses@codesourcery.com>.

15 files changed:
etc/ChangeLog
etc/Makefile.in
gdb/ChangeLog
gdb/Makefile.in
gdb/doc/ChangeLog
gdb/doc/Makefile.in
gdb/doc/refcard.tex
gdb/gdbserver/ChangeLog
gdb/gdbserver/Makefile.in
gdb/testsuite/ChangeLog
gdb/testsuite/Makefile.in
readline/ChangeLog.gdb
readline/Makefile.in
sim/ChangeLog
sim/Makefile.in

index 8cfab9d69c87166ab274a1cd61eda59ec26a48a7..ecddf2a6cc4e1737be994658dd8eded75b948d64 100644 (file)
@@ -1,3 +1,7 @@
+2007-03-27  Brooks Moses  <brooks.moses@codesourcery.com>
+
+       * Makefile.in: Add support for "pdf" and "install-pdf" targets.
+
 2006-12-19  Paolo Bonzini  <bonzini@gnu.org>
 
        * configure.texi: Fix botched commit.
index 7d0607d960c824615e6ab9b33da96b9f5a64c8fe..9642e076c1d1669d49a9682345f49bd6bf4a8423 100644 (file)
@@ -28,6 +28,7 @@ man9dir = $(mandir)/man9
 datarootdir = @datarootdir@
 docdir = @docdir@
 infodir = @infodir@
+pdfdir = @docdir@
 htmldir = @htmldir@
 
 SHELL = /bin/sh
@@ -42,6 +43,9 @@ MAKEINFO = `if [ -f ../texinfo/makeinfo/makeinfo ]; \
 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 @@ TEXIDIR = $(srcdir)/../texinfo
 
 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 @@ dvi:
          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.dvi: $(srcdir)/standards.texi
 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 @@ configure.ps: configure.dvi $(srcdir)/configdev.ein $(srcdir)/configbuild.ein
        $(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
index bdb281fa4c68f724f116e1dc507432ff246653fd..b69d208eb316e8e283c642fbb5a05a3adf423789 100644 (file)
@@ -1,3 +1,7 @@
+2007-03-27  Brooks Moses  <brooks.moses@codesourcery.com>
+
+       * Makefile.in: Add support for a "pdf" target.
+
 2007-03-27  Daniel Jacobowitz  <dan@codesourcery.com>
 
        * amd64-tdep.c (amd64_init_frame_cache): New function.
index 041f2ebefa8c60d4d01b01451f150dcb8f1197d9..199715c20970a061d1528e4d6de03f94bea54663 100644 (file)
@@ -42,6 +42,7 @@ man7dir = $(mandir)/man7
 man8dir = $(mandir)/man8
 man9dir = $(mandir)/man9
 infodir = @infodir@
+pdfdir = $(prefix)/share/doc/gdb
 htmldir = $(prefix)/html
 includedir = @includedir@
 
@@ -435,6 +436,7 @@ FLAGS_TO_PASS = \
        "prefix=$(prefix)" \
        "exec_prefix=$(exec_prefix)" \
        "infodir=$(infodir)" \
+       "pdfdir=$(pdfdir)" \
        "libdir=$(libdir)" \
        "mandir=$(mandir)" \
        "datadir=$(datadir)" \
@@ -1055,7 +1057,7 @@ check//%: force
            "$$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 ad8c031c708b5623aca11c5b2207d8a4efb9d188..61d07089d52d4a085895bd1293981ad9fd0b7044 100644 (file)
@@ -1,3 +1,10 @@
+2007-03-27  Brooks Moses  <brooks.moses@codesourcery.com>
+
+       * Makefile.in: Add "pdfdir" installation
+       directory, PDFTEX macro, support for "install-pdf" target,
+       and rules for making a pdf version of refcard.texi.
+       * refcard.tex: Specify paper size for PDF output.
+
 2007-03-26  Bob Wilson  <bob.wilson@acm.org>
        
        * gdb.texinfo (Omissions from Ada, Additions to Ada): Wrap long lines.
index 2f5eed5c24b78ab4b669beab5345cea2c5728725..e15939a912bcda3146ad52f9d7fce851cae8b967 100644 (file)
@@ -24,6 +24,7 @@ VPATH = @srcdir@
 prefix = @prefix@
 
 infodir = @infodir@
+pdfdir = $(prefix)/share/doc/gdb
 htmldir = $(prefix)/html
 
 SHELL = @SHELL@
@@ -34,6 +35,8 @@ INSTALL = @INSTALL@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_DATA = @INSTALL_DATA@
 
+mkinstalldirs = $(SHELL) $(srcdir)/../../mkinstalldirs
+
 # main GDB source directory
 gdbdir = $(srcdir)/..
 
@@ -69,6 +72,9 @@ SET_TEXINPUTS = \
 # 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 @@ REFEDITS =
 
 # Don Knuth's TeX formatter
 TEX = tex
+PDFTEX = pdftex
 
 # Program to generate Postscript files from DVI files.
 DVIPS = dvips
@@ -151,7 +158,7 @@ info: $(INFO_DEPS)
 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-html: html
                $(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.dvi : refcard.tex $(REFEDITS)
 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 f6f0a0f1f6b97785bf6acc84d7b01dc94c91f9ac..6d4830275aea77bff5071e33e210d4d36aa5b7c3 100644 (file)
@@ -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
 \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 4d60b8760f45d9fd3b2a4a9bb2e00438220677f1..eb596801d0e2239039b926ccb5b4de74b69c4f56 100644 (file)
@@ -1,3 +1,7 @@
+2007-03-27  Brooks Moses  <brooks.moses@codesourcery.com>
+
+       * Makefile.in: Add dummy "pdf" and "install-pdf" targets.
+
 2007-02-27  Daniel Jacobowitz  <dan@codesourcery.com>
 
        * terminal.h: Check HAVE_SGTTY_H.
index dfb08032ffab1a5d0b8155985b4ce54ecea52a3e..5b2a3ed0e2e27bc64db7e1b5777b6f8c2061f475 100644 (file)
@@ -177,8 +177,9 @@ uninstall: force
 
 installcheck:
 check:
-info dvi:
+info dvi pdf:
 install-info:
+install-pdf:
 html:
 install-html:
 clean-info:
index bc82912d630151d309781aa8aaf8e175e878ba13..3d3af041411402e477a7536921bf92944ff7b7e4 100644 (file)
@@ -1,3 +1,7 @@
+2007-03-27  Brooks Moses  <brooks.moses@codesourcery.com>
+
+       * Makefile.in: Add dummy "pdf" and "install-pdf" targets.
+
 2007-03-27  Daniel Jacobowitz  <dan@codesourcery.com>
 
        * config/gdbserver.exp (gdbserver_gdb_load): Update argument list.
index 44dc0a1336b4681a4a6e98e4781f9cce5523b476..edcd35cfb42c72b67b71e457428489304781bc30 100644 (file)
@@ -91,6 +91,8 @@ INFODIRS=doc
 info:
 install-info:
 dvi:
+pdf:
+install-pdf:
 html:
 install-html:
 
index 67514730306540e6db4c303f525f4d4a525d3b17..e185fdfadc0d75e30a4be2fa2dd5213d7da95fef 100644 (file)
@@ -1,3 +1,7 @@
+2007-03-27  Brooks Moses  <brooks.moses@codesourcery.com>
+
+       * Makefile.in: Add dummy "pdf" target.
+
 2006-11-13  Denis Pilat  <denis.pilat@st.com>
 
        * terminal.c (_rl_get_screen_size): use wr and wc variable to store
index e14318b54cb2d9deb9c0a1db65c2a9ecd328cbaa..acf706f0e2e41c4303aab59a3b813880cb283ffa 100644 (file)
@@ -297,7 +297,7 @@ distclean maintainer-clean: clean
        $(RM) $(CREATED_CONFIGURE)
        $(RM) $(CREATED_TAGS)
 
-info dvi:
+info dvi pdf:
        -( cd doc && $(MAKE) $(MFLAGS) $@ )
 
 install-info:
index f34b86250db90952a132b4fe2c4d9912cad36c69..6f110ef5bb29bdaaac1d13b283eaf3232e804c1e 100644 (file)
@@ -1,3 +1,7 @@
+2007-03-27  Brooks Moses  <brooks.moses@codesourcery.com>
+
+       * Makefile.in: Add dummy "pdf" target.
+
 2007-02-20  Hans-Peter Nilsson  <hp@axis.com>
 
        * cris/traps.c (dump_statistics): Change format for cycle numbers
index 86f08e483f6249b678fdca7d1aa42ea282a5f52e..c7a37febc4e27b4d9e11e34b3a08e7a25b054d2b 100644 (file)
@@ -186,6 +186,7 @@ check: force
 info:
 install-info:
 dvi:
+pdf:
 
 ### 
 ### 
This page took 0.043968 seconds and 4 git commands to generate.