1 # Copyright (C) 2002-2014 Free Software Foundation, Inc.
2 # Written by Werner Lemberg <wl@gnu.org>
4 # This file is part of groff.
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 3 of the License, or
9 # (at your option) any later version.
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
16 # You should have received a copy of the GNU General Public License
17 # along with this program. If not, see <http://www.gnu.org/licenses/>.
20 # Use this file to produce documentation in various formats; e.g. you can
25 # to get the groff texinfo manual as a PDF file.
27 # Note that you have to compile the groff package first.
31 top_srcdir=@abs_top_srcdir@
33 top_builddir=@abs_top_builddir@
34 pnmtops=@pnmtops_nosetpage@
36 # These may be overridden if cross-compiling.
37 TROFFBIN=$(top_builddir)/src/roff/troff/troff
38 GROFFBIN=$(top_builddir)/src/roff/groff/groff
39 GROFF_BIN_PATH=`echo $(groff_bin_dirs) \
40 | LANG=C LC_ALL=C sed -e 's| *|:|g'`
42 # info files are distributed with the groff package, so makeinfo is
43 # usually not needed (however, to build from the repo you NEED it!)
46 # Users who want to print out the groff manual are expected to have a
47 # working TeX installation. Note that texi2dvi properly honours the
48 # `MAKEINFO' environment variable.
52 $(top_builddir)/src/roff/groff \
53 $(top_builddir)/src/roff/troff \
54 $(top_builddir)/src/preproc/preconv \
55 $(top_builddir)/src/preproc/pic \
56 $(top_builddir)/src/preproc/eqn \
57 $(top_builddir)/src/preproc/tbl \
58 $(top_builddir)/src/preproc/grn \
59 $(top_builddir)/src/preproc/refer \
60 $(top_builddir)/src/preproc/soelim \
61 $(top_builddir)/src/preproc/html \
62 $(top_builddir)/src/devices/grops \
63 $(top_builddir)/src/devices/gropdf \
64 $(top_builddir)/src/devices/grodvi \
65 $(top_builddir)/src/devices/grotty \
66 $(top_builddir)/src/devices/grolj4 \
67 $(top_builddir)/src/devices/grolbp \
68 $(top_builddir)/src/devices/grohtml
70 version=`cat $(top_srcdir)/VERSION`
71 # No additional number if revision is zero.
72 revision=`sed -e 's/^0$$//' -e 's/^[1-9].*$$/.&/' $(top_srcdir)/REVISION`
74 FFLAG=-F$(top_builddir)/font -F$(top_srcdir)/font
75 TFLAG=-M$(top_builddir)/tmac -M$(top_srcdir)/tmac
77 TROFF=$(TROFFBIN) $(TFLAG) $(FFLAG) -ww
81 sed -e "s;@VERSION@;$(version)$(revision);" $< \
82 | GROFF_COMMAND_PREFIX= \
83 GROFF_BIN_PATH="$(GROFF_BIN_PATH)" \
84 $(GROFFBIN) $(TFLAG) $(FFLAG) -Upet -ww
88 .SUFFIXES: .me .ms .ps .html .txt .texinfo .dvi .pdf .xhtml
89 .PHONY: all prepare_examples clean distclean realclean extraclean
91 # For simplicity, we always call preconv, grn, and eqn.
93 $(GROFF) -k -Tutf8 -ge -me >$@
95 $(GROFF) -k -Tps -ge -me >$@
98 $(GROFF) -P-p -P-b -P-I`basename $< | sed -e 's|.ms$$||'` \
99 -P-D$(imagedir) -P-V -Thtml -ms >$@
101 $(GROFF) -Tascii -ms -mwww >$@
103 $(GROFF) -Tps -ms -mwww >$@
108 $(MAKEINFO) --enable-encoding -I$(srcdir) --plaintext -o $@ $<
112 MAKEINFO=$(MAKEINFO) $(TEXI2DVI) -e $<
116 MAKEINFO=$(MAKEINFO) $(TEXI2DVI) -e --pdf $<
120 $(MAKEINFO) --enable-encoding -I$(srcdir) --html --no-split $< \
121 && $(SHELL) $(srcdir)/fixinfo.sh $@
123 all: prepare_examples
125 prepare_examples: grnexmpl.g groff.css
126 test -f grnexmpl.g || cp $(srcdir)/grnexmpl.g .
127 test -f groff.css || cp $(srcdir)/groff.css .
129 groff.info: groff.texinfo
130 $(MAKEINFO) --enable-encoding -I$(srcdir) $(srcdir)/groff.texinfo
133 xpmtoppm $(srcdir)/gnu.xpm | pnmdepth 15 | $(pnmtops) -noturn >$@
136 $(GROFF) -P-p -P-I`basename $< | sed -e 's|.ms$$||'` \
137 -P-D$(imagedir) -P-j`basename $< | sed -e 's|.ms$$||'` \
140 webpage.html: webpage.ms gnu.eps groff.css
141 $(GROFF) -P-j`basename $< | sed -e 's|.ms$$||'` \
142 -P-nrpb -P-I`basename $< | sed -e 's|.ms$$||'` \
143 -P-D$(imagedir) -Thtml -ms >$@
147 grnexmpl.ps: grnexmpl.me grnexmpl.g
152 $(MAKEINFO) --enable-encoding -I$(srcdir) --html groff.texinfo \
153 && for f in groff/*; do $(SHELL) $(srcdir)/fixinfo.sh $$f; done
156 rm -f *.ps *.html *.txt core
157 rm -f *.aux *.dvi *.pdf *.log *.toc texput.log
158 rm -f *.cp *.cps *.cv *.cn *.es *.ess *.fn *.fns *.ky *.kys \
159 *.ma *.mas *.op *.ops *.pg *.pgs *.rq *.rqs *.st *.sts \
160 *.tp *.tps *.tr *.vr *.vrs *.xhtml
168 extraclean: distclean
169 rm -f core *~ \#* junk temp grot
171 ########################################################################
173 ########################################################################