Initial import from FreeBSD RELENG_4:
[dragonfly.git] / contrib / groff / doc / Makefile.in
1 # Copyright (C) 2002 Free Software Foundation, Inc.
2 #      Written by Werner Lemberg <wl@gnu.org>
3
4 # This file is part of groff.
5
6 # groff is free software; you can redistribute it and/or modify it under
7 # the terms of the GNU General Public License as published by the Free
8 # Software Foundation; either version 2, or (at your option) any later
9 # version.
10
11 # groff is distributed in the hope that it will be useful, but WITHOUT ANY
12 # WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14 # for more details.
15
16 # You should have received a copy of the GNU General Public License along
17 # with groff; see the file COPYING.  If not, write to the Free Software
18 # Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19
20
21 # Use this file to produce documentation in various formats; e.g. you can
22 # say
23 #
24 #   make groff.pdf
25 #
26 # to get the groff texinfo manual as a PDF file.
27 #
28 # Note that you have to compile the groff package first.
29
30
31 srcdir=@srcdir@
32 top_srcdir=@top_srcdir@
33 VPATH=@srcdir@
34 top_builddir=@groff_top_builddir@
35
36
37 # Since info files are distributed within the groff package, no
38 # autoconf test for the makeinfo binary is done.
39 MAKEINFO=makeinfo
40
41 # Users who want to print out the groff manual are expected to have
42 # a working TeX installation.
43 TEXI2DVI=texi2dvi
44
45 groff_bin_dirs=\
46   $(top_builddir)/src/roff/groff \
47   $(top_builddir)/src/roff/troff \
48   $(top_builddir)/src/preproc/pic \
49   $(top_builddir)/src/preproc/eqn \
50   $(top_builddir)/src/preproc/tbl \
51   $(top_builddir)/src/preproc/grn \
52   $(top_builddir)/src/preproc/refer \
53   $(top_builddir)/src/preproc/soelim \
54   $(top_builddir)/src/preproc/html \
55   $(top_builddir)/src/devices/grops \
56   $(top_builddir)/src/devices/grodvi \
57   $(top_builddir)/src/devices/grotty \
58   $(top_builddir)/src/devices/grolj4 \
59   $(top_builddir)/src/devices/grolbp \
60   $(top_builddir)/src/devices/grohtml
61 groff_bin_path=`echo $(groff_bin_dirs) | sed -e 's|  *|:|g'`
62
63 version=`cat $(top_srcdir)/VERSION`
64 # No additional number if revision is zero.
65 revision=`sed -e 's/^0$$//' -e 's/^[1-9].*$$/.&/' $(top_srcdir)/REVISION`
66
67 FFLAG=-F$(top_builddir)/font -F$(top_srcdir)/font
68 TFLAG=-M$(top_builddir)/tmac -M$(top_srcdir)/tmac
69
70 TROFF=$(top_builddir)/src/roff/troff/troff $(TFLAG) $(FFLAG) -ww
71 GROFF=GROFF_COMMAND_PREFIX=''; \
72       export GROFF_COMMAND_PREFIX; \
73       GROFF_BIN_PATH=$(groff_bin_path); \
74       export GROFF_BIN_PATH; \
75       sed -e "s;@VERSION@;$(version)$(revision);" $< \
76       | $(top_builddir)/src/roff/groff/groff $(TFLAG) $(FFLAG) -Upet -ww
77
78 imagedir=img
79
80 .SUFFIXES: .me .ms .ps .html .txt .texinfo .dvi .pdf
81
82 # For simplicity, we always call grn and eqn.
83 .me.txt:
84         $(GROFF) -Tascii -ge -me >$@
85 .me.ps:
86         $(GROFF) -Tps -ge -me >$@
87
88 .ms.html:
89         $(GROFF) -P-p -P-b -P-I`basename $< | sed -e 's|.ms$$||'` \
90                  -P-D$(imagedir) -Thtml -ms >$@
91 .ms.txt:
92         $(GROFF) -Tascii -ms -mwww >$@
93 .ms.ps:
94         $(GROFF) -Tps -ms -mwww >$@
95
96 .texinfo.dvi:
97         $(TEXI2DVI) -e $<
98 .texinfo.pdf:
99         $(TEXI2DVI) -e --pdf $<
100 .texinfo.html:
101         $(MAKEINFO) -I$(srcdir) --html --no-split $<
102
103
104 all: prepare_examples
105
106 prepare_examples: grnexmpl.g
107         test -f grnexmpl.g || cp $(srcdir)/grnexmpl.g .
108
109 groff: groff.texinfo
110         $(MAKEINFO) -I$(srcdir) $(srcdir)/groff.texinfo
111
112 gnu.eps: gnu.xpm
113         xpmtoppm $(srcdir)/gnu.xpm | pnmdepth 15 | pnmtops -noturn >$@
114 gnu.png: gnu.xpm
115         xpmtoppm $(srcdir)/gnu.xpm | pnmdepth 15 | pnmtopng >$@
116
117 webpage.html: webpage.ms gnu.png gnu.eps
118 webpage.ps: gnu.eps
119
120 grnexmpl.ps: grnexmpl.me grnexmpl.g
121
122
123 clean:
124         -rm -f *.ps *.html *.txt *.png *.eps *.gif *.dit core
125         -rm -f *.aux *.dvi *.pdf *.log *.toc texput.log
126         -rm -f *.cp *.cps *.cv *.cn *.es *.ess *.fn *.fns *.ky *.kys \
127                *.ma *.mas *.op *.ops *.pg *.pgs *.rq *.rqs *.st *.sts \
128                *.tp *.tps *.tr *.vr *.vrs
129         -rm -rf img
130
131 distclean: clean
132
133 realclean: distclean
134
135 extraclean: clean
136         -rm -f core *~ \#* junk temp grot