bug-gawk
[Top][All Lists]
Advanced

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

[bug-gawk] [patch] doc target for pc/Makefile (djgpp specific)


From: Juan Manuel Guerrero
Subject: [bug-gawk] [patch] doc target for pc/Makefile (djgpp specific)
Date: Tue, 18 Oct 2011 21:44:55 +0200
User-agent: KMail/1.9.10

The patch below will provide a doc target for pc/Makefile allowing to generate
all documentation files in the info, html, ps and pdf format.  It will also
allow to produce the reference cards (no color support).  The code has been
produced for djgpp and has only been tested with it but I hope it will be
usefull for the other 32 bit platforms too.  I cannot test those plattforms.
To build the documentation a working TeX installation will be required and
a working port groff.
Suggestions, objections, comments are welcome.

Regards,
Juan M. Guerrero



2011-10-18  Juan Manuel Guerrero  <address@hidden>

        * pc/Makefile: doc target to create all documentation files.





diff -aprNU5 gawk-4.0.0.orig/pc/Makefile gawk-4.0.0/pc/Makefile
--- gawk-4.0.0.orig/pc/Makefile 2011-06-20 17:16:38 +0000
+++ gawk-4.0.0/pc/Makefile      2011-10-18 21:27:40 +0000
@@ -11,14 +11,15 @@ default:
        @echo " where 'target' is chosen from                          "
        @echo "  djgpp ... DOS 32-bit exe [GNU C, Delorie, v2]         "
        @echo "  emx ..... OS/2 32-bit exe [emx/gcc; uses emxlibc.dll] "
        @echo "  emxnt ... NT exe [emx/gcc with RSXNT]                 "
        @echo "  emxbnd .. OS/2 and DOS 32-bit exe [emx/gcc]           "
-       @echo "  mingw32 . Windows32 exe [Mingw32 GNU C]                   "
+       @echo "  mingw32 . Windows32 exe [Mingw32 GNU C]               "
        @echo "  ----------------------------------------------------- "
        @echo "  test .... Perform tests (see README_d/README.pc)      "
        @echo "  install . Install gawk under $(prefix)/               "
+       @echo "  doc ..... Create documentation                        "
 
 # Support dropped in 4.0
 # - for DJGPP v1.x            [DOS 32bit protected-mode executable]
 # - for MS-Visual C/C++ 4.x   [Windows32 executable for Windows 9x/NT]
 # - for Microsoft C 7         [16bit ececutable for DOS]
@@ -26,11 +27,11 @@ default:
 #      @echo "  djgppv1 . DOS 32-bit exe [GNU C, Delorie, v1]         "
 #      @echo "  msc ..... DOS exe [Microsoft C 7 & 8 (AKA 1.52)]      "
 #      @echo "  msc6 .... DOS exe [Microsoft C 6.00a]                 "
 #      @echo "  msc6os2 . OS/2 exe [Microsoft C 6.00a]                "
 #      @echo "  msc6bnd . OS/2 and DOS exe [Microsoft C 6.00a]        "
-#      @echo "  vcWin32 . Windows32 exe [Microsoft Visual C]              "
+#      @echo "  vcWin32 . Windows32 exe [Microsoft Visual C]          "
 # Support dropped in 3.0
 # - for Microsoft C 5.1       [16bit executable for OS/2 or DOS]
 #      @echo "  msc51     DOS exe [Microsoft C 5.1]                   "
 #      @echo "  msc51bnd  OS/2 and DOS exe [Microsoft C 5.1]          "
 
@@ -311,5 +312,70 @@ test:      check
 TAGS:
        etags awk.h *.y custom.h *.c *.h
 
 tags:
        ctags awk.h *.y custom.h *.c *.h
+
+#========================================================================
+#================================= DOC ==================================
+#========================================================================
+
+DVIS = ./doc/gawk.dvi ./doc/gawkinet.dvi
+PDFS = ./doc/gawk.pdf ./doc/gawkinet.pdf
+PSS = ./doc/gawk.ps ./doc/gawkinet.ps
+HTMLS = ./doc/gawk.html ./doc/gawkinet.html
+INFOS = ./doc/gawk.info ./doc/gawkinet.info
+TEXINFOS = ./doc/gawk.texi ./doc/gawkinet.texi
+
+TEXI2DVI = texi2dvi --build-dir=./doc
+TEXI2PDF = $(TEXI2DVI) --pdf --batch
+DVIPS = dvips
+MAKEINFO = makeinfo --no-split --force
+MAKEINFOHTML = $(MAKEINFO) --html
+
+TROFF = groff -t -Tps -U
+#SEDME = sed -e "s/^level0 restore/level0 restore flashme 100 72 moveto 
(Copyright `date '+%m-%d-%y %T'`, FSF, Inc. (all)) show/" \
+#              -e "s/^\/level0 save def/\/level0 save def 30 -48 translate/"
+
+SEDME = sed "s/^\/level0 save def/\/level0 save def 30 -48 translate/"
+
+SEDME2 = sed "/%%Page: 10 10/,/0 Cg EP/d"
+
+.SUFFIXES: .dvi .html .info .pdf .ps .texi
+
+.texi.info:
+       $(MAKEINFO) -o $@ $<
+
+.texi.html:
+       $(MAKEINFOHTML) -o $@ $<
+
+.texi.dvi:
+       $(TEXI2DVI) -o $@ $<
+
+.texi.pdf:
+       $(TEXI2PDF) -o $@ $<
+
+.dvi.ps:
+       $(DVIPS) -o $@ $<
+
+./doc/awkcard.tr: ./doc/awkcard.in
+       cd doc
+       sed "s,SRCDIR,.," < ./awkcard.in > ./awkcard.tr
+       cd ..
+
+./doc/awkcard.nc: export GROFF_TMPDIR ?= .
+./doc/awkcard.nc: ./doc/macros ./doc/cardfonts ./doc/no.colors 
./doc/awkcard.tr ./doc/ad.block ./doc/awkcard.in ./doc/setter.outline
+       cd doc
+       $(TROFF) ./macros ./cardfonts ./no.colors awkcard.tr | $(SEDME) | cat 
./setter.outline - | $(SEDME2) > awkcard.ps
+       cd ..
+
+./doc/awkcard.ps: ./doc/awkcard.nc
+       cd doc
+       touch awkcard.nc
+       cd ..
+
+./doc/awkcard.pdf: ./doc/awkcard.ps
+       cd doc
+       ps2pdf ./awkcard.ps ./awkcard.pdf
+       cd ..
+
+doc: $(INFOS) $(DVIS) $(HTMLS) $(PSS) $(PDFS) ./doc/awkcard.ps 
./doc/awkcard.pdf



reply via email to

[Prev in Thread] Current Thread [Next in Thread]