Merge from vendor branch GCC:
[dragonfly.git] / contrib / awk / doc / Makefile.in
1 # Makefile for GNU Awk documentation.
2 #
3 # Copyright (C) 1993-2000 the Free Software Foundation, Inc.
4
5 # This file is part of GAWK, the GNU implementation of the
6 # AWK Programming Language.
7
8 # GAWK is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 2 of the License, or
11 # (at your option) any later version.
12
13 # GAWK is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 # GNU General Public License for more details.
17
18 # You should have received a copy of the GNU General Public License
19 # along with this program; if not, write to the Free Software
20 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA
21
22 SHELL = /bin/sh
23
24 srcdir = @srcdir@
25 VPATH = @srcdir@
26
27 INSTALL = @INSTALL@
28 INSTALL_PROGRAM = @INSTALL_PROGRAM@
29 INSTALL_DATA = @INSTALL_DATA@
30
31 prefix = @prefix@
32 exec_prefix = @exec_prefix@
33 binprefix =
34 manprefix =
35
36 bindir = @bindir@
37 libdir = @libdir@
38 mandir = @mandir@/man1
39 manext = .1
40 infodir = @infodir@
41 datadir = @datadir@/awk
42
43 TEXI2DVI = texi2dvi
44 TEX = tex
45 MAKEINFO = makeinfo --no-split
46 TROFF = groff -t -Tps
47 SEDME = sed -e "s/^level0 restore/level0 restore flashme 100 72 moveto (Copyright `date '+%m-%d-%y %T'`, FSF, Inc. (all)) show/" \
48                 -e "s/^\/level0 save def/\/level0 save def 30 -48 translate/"
49
50 DOCS= gawk.1 igawk.1 gawk.texi
51
52 TEXFILES= gawk.aux gawk.cp gawk.cps gawk.fn gawk.fns gawk.ky gawk.kys \
53            gawk.pg gawk.pgs gawk.toc gawk.tp gawk.tps gawk.vr gawk.vrs
54
55 ALLDOC= gawk.dvi $(TEXFILES) gawk.log awkcard.tr
56
57 CARDSRC = $(srcdir)/macros $(srcdir)/cardfonts $(srcdir)/colors awkcard.tr
58 CARDSRC_N = $(srcdir)/macros $(srcdir)/cardfonts $(srcdir)/no.colors awkcard.tr
59 CARDFILES= $(CARDSRC) ad.block awkcard.in setter.outline
60
61 # Use this if your troff can correctly handle macros from 'colors' file
62 AWKCARD = awkcard.ps
63
64 # Uncomment the following definition of AWKCARD if your troff can produce
65 # Postscript but still has troubles with macros from 'colors'.  As this
66 # is not groff you will have to change TROFF macro as well.  Do not forget
67 # to ensure that awkcard.tr is processed by tbl.
68 #AWKCARD = awkcard.nc
69
70 all: $(DOCS) info
71
72 install: $(mandir)/gawk$(manext) $(mandir)/igawk$(manext) $(infodir)/gawk.info
73
74 $(infodir)/gawk.info::
75         -if test -f gawk.info; then d=.; \
76         else d=$(srcdir); fi; \
77         if    [ -f $(infodir)/dir -a -f $(infodir)/gawk.info ] \
78            && cmp $$d/gawk.info $(infodir)/gawk.info > /dev/null \
79            && grep '(gawk)' $(infodir)/dir  > /dev/null; then \
80                 exit 0; \
81         fi; \
82         $(INSTALL_DATA) $$d/gawk.info $(infodir)/gawk.info ; \
83         if $(SHELL) -c 'install-info --version' > /dev/null 2>&1 ; \
84         then install-info --info-dir=$(infodir) gawk.info ; \
85         else true ; fi; exit 0
86
87 $(mandir)/gawk$(manext):: gawk.1
88         $(INSTALL_DATA) $(srcdir)/gawk.1 $(mandir)/gawk$(manext)
89
90 $(mandir)/igawk$(manext):: igawk.1
91         $(INSTALL_DATA) $(srcdir)/igawk.1 $(mandir)/igawk$(manext)
92
93 uninstall:
94         rm -f $(mandir)/gawk$(manext) $(mandir)/igawk$(manext) $(infodir)/gawk.info*
95
96 dvi:    gawk.dvi
97
98 gawk.dvi: gawk.texi
99         -TEXINPUTS=$(srcdir):$$TEXINPUTS $(TEXI2DVI) $(srcdir)/gawk.texi
100
101 info:   gawk.info
102
103 gawk.info: gawk.texi
104         $(MAKEINFO) $(srcdir)/gawk.texi
105
106 postscript: dvi gawk.1 igawk.1 $(AWKCARD)
107         -groff -man $(srcdir)/gawk.1 > gawk.1.ps
108         -groff -man $(srcdir)/igawk.1 > igawk.1.ps
109         dvips -o gawk.ps gawk.dvi
110
111 awkcard.tr: awkcard.in
112         sed 's:SRCDIR:$(srcdir):' < $(srcdir)/awkcard.in > awkcard.tr
113
114 awkcard.ps: $(CARDFILES)
115         $(TROFF) $(CARDSRC) | $(SEDME) | cat $(srcdir)/setter.outline - > awkcard.ps
116
117 awkcard.nc: $(CARDFILES)
118         $(TROFF) $(CARDSRC_N) | $(SEDME) | cat $(srcdir)/setter.outline - > awkcard.ps && touch awkcard.nc
119
120 clean:
121         rm -f *.ps $(ALLDOC) *~ awkcard.nc
122
123 distclean: clean
124         rm -f Makefile
125
126 maintainer-clean: distclean
127         @echo "This command is intended for maintainers to use; it"
128         @echo "deletes files that may require special tools to rebuild."
129         rm -f gawk.info