Don't use dangling elses.
[s-roff.git] / doc / Makefile.in
blob4697fb1fefcce45ebf2165d4e4083390e850700b
1 # Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007
2 # Free Software Foundation, Inc.
3 # Written by Werner Lemberg <wl@gnu.org>
4 #
5 # This file is part of groff.
6 #
7 # groff is free software; you can redistribute it and/or modify it under
8 # the terms of the GNU General Public License as published by the Free
9 # Software Foundation; either version 2, or (at your option) any later
10 # version.
12 # groff is distributed in the hope that it will be useful, but WITHOUT ANY
13 # WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 # for more details.
17 # You should have received a copy of the GNU General Public License along
18 # with groff; see the file COPYING. If not, write to the Free Software
19 # Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA.
22 # Use this file to produce documentation in various formats; e.g. you can
23 # say
25 # make groff.pdf
27 # to get the groff texinfo manual as a PDF file.
29 # Note that you have to compile the groff package first.
32 srcdir=@srcdir@
33 top_srcdir=@abs_top_srcdir@
34 VPATH=@srcdir@
35 top_builddir=@abs_top_builddir@
36 pnmtops=@pnmtops_nosetpage@
38 # These may be overridden if cross-compiling.
39 TROFFBIN=$(top_builddir)/src/roff/troff/troff
40 GROFFBIN=$(top_builddir)/src/roff/groff/groff
41 GROFF_BIN_PATH=`echo $(groff_bin_dirs) | sed -e 's| *|:|g'`
43 # info files are distributed with the groff package, so makeinfo is
44 # usually not needed (however, to build from CVS you NEED it!)
45 MAKEINFO=@MAKEINFO@
47 # Users who want to print out the groff manual are expected to have
48 # a working TeX installation.
49 TEXI2DVI=texi2dvi
51 groff_bin_dirs=\
52 $(top_builddir)/src/roff/groff \
53 $(top_builddir)/src/roff/troff \
54 $(top_builddir)/src/preproc/pic \
55 $(top_builddir)/src/preproc/eqn \
56 $(top_builddir)/src/preproc/tbl \
57 $(top_builddir)/src/preproc/grn \
58 $(top_builddir)/src/preproc/refer \
59 $(top_builddir)/src/preproc/soelim \
60 $(top_builddir)/src/preproc/html \
61 $(top_builddir)/src/devices/grops \
62 $(top_builddir)/src/devices/grodvi \
63 $(top_builddir)/src/devices/grotty \
64 $(top_builddir)/src/devices/grolj4 \
65 $(top_builddir)/src/devices/grolbp \
66 $(top_builddir)/src/devices/grohtml
68 version=`cat $(top_srcdir)/VERSION`
69 # No additional number if revision is zero.
70 revision=`sed -e 's/^0$$//' -e 's/^[1-9].*$$/.&/' $(top_srcdir)/REVISION`
72 FFLAG=-F$(top_builddir)/font -F$(top_srcdir)/font
73 TFLAG=-M$(top_builddir)/tmac -M$(top_srcdir)/tmac
75 TROFF=$(TROFFBIN) $(TFLAG) $(FFLAG) -ww
76 GROFF=GROFF_COMMAND_PREFIX=''; \
77 export GROFF_COMMAND_PREFIX; \
78 GROFF_BIN_PATH=$(GROFF_BIN_PATH); \
79 export GROFF_BIN_PATH; \
80 sed -e "s;@VERSION@;$(version)$(revision);" $< \
81 | $(GROFFBIN) $(TFLAG) $(FFLAG) -Upet -ww
83 imagedir=img
85 .SUFFIXES: .me .ms .ps .html .txt .texinfo .dvi .pdf .xhtml
86 .PHONY: all prepare_examples clean distclean realclean extraclean
88 # For simplicity, we always call grn and eqn.
89 .me.txt:
90 $(GROFF) -Tascii -ge -me >$@
91 .me.ps:
92 $(GROFF) -Tps -ge -me >$@
94 .ms.html:
95 $(GROFF) -P-p -P-b -P-I`basename $< | sed -e 's|.ms$$||'` \
96 -P-D$(imagedir) -P-V -Thtml -ms >$@
97 .ms.txt:
98 $(GROFF) -Tascii -ms -mwww >$@
99 .ms.ps:
100 $(GROFF) -Tps -ms -mwww >$@
102 .texinfo.dvi:
103 $(TEXI2DVI) -e $<
104 .texinfo.pdf:
105 $(TEXI2DVI) -e --pdf $<
106 .texinfo.html:
107 $(MAKEINFO) --enable-encoding -I$(srcdir) --html --no-split $< \
108 && $(SHELL) $(srcdir)/fixinfo.sh $@
111 all: prepare_examples
113 prepare_examples: grnexmpl.g groff.css
114 test -f grnexmpl.g || cp $(srcdir)/grnexmpl.g .
115 test -f groff.css || cp $(srcdir)/groff.css .
117 groff.info: groff.texinfo
118 $(MAKEINFO) --enable-encoding -I$(srcdir) $(srcdir)/groff.texinfo
120 gnu.eps: gnu.xpm
121 xpmtoppm $(srcdir)/gnu.xpm | pnmdepth 15 | $(pnmtops) -noturn >$@
122 gnu.png: gnu.xpm
123 xpmtoppm $(srcdir)/gnu.xpm | pnmdepth 15 | pnmtopng >$@
125 pic.html: pic.ms
126 $(GROFF) -P-p -P-I`basename $< | sed -e 's|.ms$$||'` \
127 -P-D$(imagedir) -P-j`basename $< | sed -e 's|.ms$$||'` \
128 -Thtml -P-V -ms >$@
130 webpage.html: webpage.ms gnu.png gnu.eps groff.css
131 $(GROFF) -P-j`basename $< | sed -e 's|.ms$$||'` \
132 -P-nrpb -P-I`basename $< | sed -e 's|.ms$$||'` \
133 -P-D$(imagedir) -Thtml -ms >$@
135 webpage.ps: gnu.eps
137 grnexmpl.ps: grnexmpl.me grnexmpl.g
140 clean:
141 -rm -f *.ps *.html *.txt core
142 -rm -f *.aux *.dvi *.pdf *.log *.toc texput.log
143 -rm -f *.cp *.cps *.cv *.cn *.es *.ess *.fn *.fns *.ky *.kys \
144 *.ma *.mas *.op *.ops *.pg *.pgs *.rq *.rqs *.st *.sts \
145 *.tp *.tps *.tr *.vr *.vrs *.xhtml
146 -rm -rf img
148 distclean: clean
150 realclean: distclean
151 -rm -f *.png *.eps
153 extraclean: distclean
154 -rm -f core *~ \#* junk temp grot