1 # Copyright (C) 2002, 2003, 2004, 2005 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 2, or (at your option) any later
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 along
17 # with groff; see the file COPYING. If not, write to the Free Software
18 # Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA.
20 # These may be overridden if cross-compiling.
21 GROFFBIN=$(top_builddir)/src/roff/groff/groff
22 GROFF_BIN_PATH=`echo $(groff_bin_dirs) | sed -e 's| *|$(SH_SEP)|g'`
24 # info files are distributed with the groff package, so makeinfo is
25 # usually not needed (however, to build from CVS you NEED it!)
26 # FIXME: Add autoconf test to check whether makeinfo exists.
30 $(top_builddir)/src/roff/groff \
31 $(top_builddir)/src/roff/troff \
32 $(top_builddir)/src/preproc/pic \
33 $(top_builddir)/src/preproc/eqn \
34 $(top_builddir)/src/preproc/tbl \
35 $(top_builddir)/src/preproc/grn \
36 $(top_builddir)/src/preproc/refer \
37 $(top_builddir)/src/preproc/soelim \
38 $(top_builddir)/src/preproc/html \
39 $(top_builddir)/src/devices/grops \
40 $(top_builddir)/src/devices/grohtml
42 FFLAG=-F$(top_builddir)/font -F$(top_srcdir)/font
43 TFLAG=-M$(top_builddir)/tmac -M$(top_srcdir)/tmac
46 GROFF_COMMAND_PREFIX=''; \
47 export GROFF_COMMAND_PREFIX; \
48 GROFF_BIN_PATH=$(GROFF_BIN_PATH); \
49 export GROFF_BIN_PATH; \
50 sed -e "s;@VERSION@;$(version)$(revision);" $< \
51 | $(GROFFBIN) $(TFLAG) $(FFLAG) -Upet -ww
78 PROCESSEDEXAMPLEFILES=\
85 HTMLEXAMPLEIMAGEFILES=\
89 htmldocimagedir=$(htmldocdir)/$(imagedir)
90 exampleimagedir=$(exampledir)/$(imagedir)
93 $(PROCESSEDDOCFILES) \
94 $(PROCESSEDEXAMPLEFILES) \
97 groff.aux groff.cp* groff.dvi groff.es* groff.fn* groff.html groff.ky* \
98 groff.log groff.ma* groff.op* groff.pdf groff.pg* groff.ps groff.rq* \
99 groff.st* groff.toc groff.tp groff.vr* \
113 .SUFFIXES: .me .ms .ps .html
115 # For simplicity, we always call grn and eqn.
117 $(GROFF) -Tps -ge -me >$@
120 $(GROFF) -P-p -P-b -P-I`basename $< | sed -e 's|.ms$$||'` \
121 -P-D$(imagedir) -Thtml -ms >$@
123 $(GROFF) -Tps -ms -mwww >$@
126 all: groff $(PROCESSEDDOCFILES) prepare_examples \
127 $(PROCESSEDEXAMPLEFILES) $(make_html)
129 html: $(HTMLDOCFILES) $(HTMLEXAMPLEFILES)
131 prepare_examples: examples.stamp
133 examples.stamp: grnexmpl.g groff.css gnu.eps
134 test -f grnexmpl.g || cp $(srcdir)/grnexmpl.g .
135 test -f groff.css || cp $(srcdir)/groff.css .
136 if test ! -f gnu.eps; then \
137 if test -f $(srcdir)/gnu.eps; then \
138 cp $(srcdir)/gnu.eps .; \
139 elif test -f $(top_builddir)/contrib/pdfmark/gnu.eps; then \
140 cp $(top_builddir)/contrib/pdfmark/gnu.eps .; \
145 dont_build_groff: groff.texinfo
146 $(MAKEINFO) --enable-encoding -I$(srcdir) $(srcdir)/groff.texinfo
149 @echo "NOT REBUILDING $@"
150 test -f gnu.eps || cp $(srcdir)/gnu.eps .
151 NetBSD_DISABLED_gnu.eps:
152 xpmtoppm $(srcdir)/gnu.xpm | pnmdepth 15 | \
153 $(pnmtops_nosetpage) -noturn -rle >$@
156 @echo "NOT REBUILDING $@"
157 NetBSD_DISABLED_gnu.png:
158 xpmtoppm $(srcdir)/gnu.xpm | pnmdepth 15 | pnmtopng >$@
161 $(GROFF) -P-p -P-b -P-I`basename $< | sed -e 's|.ms$$||'` \
162 -P-D$(imagedir) -P-j`basename $< | sed -e 's|.ms$$||'` \
165 webpage.html: webpage.ms gnu.png groff.css
168 grnexmpl.ps: grnexmpl.me grnexmpl.g
170 distfiles: groff gnu.eps gnu.png
172 install_data: groff $(DOCFILES) $(PROCESSEDDOCFILES) $(make_install_html) \
173 $(EXAMPLEFILES) $(PROCESSEDEXAMPLEFILES)
174 -test -d $(infodir) || $(mkinstalldirs) $(infodir)
175 # Prefer info files in builddir over srcdir; we test for
176 # the existence of `groff'.
178 test -f "groff" || d=$(srcdir); \
179 for f in $$d/groff `ls $$d/groff-*`; do \
180 rm -f $(infodir)/`basename $$f`; \
181 $(INSTALL_DATA) $$f $(infodir)/`basename $$f`; \
183 $(INSTALL_INFO) --info-dir=$(infodir) $(infodir)/groff
184 -test -d $(docdir) || $(mkinstalldirs) $(docdir)
185 for f in $(DOCFILES); do \
186 rm -f $(docdir)/$$f; \
187 $(INSTALL_DATA) $(srcdir)/$$f $(docdir)/$$f; \
189 for f in $(PROCESSEDDOCFILES); do \
190 rm -f $(docdir)/$$f; \
191 $(INSTALL_DATA) $$f $(docdir)/$$f; \
193 -test -d $(exampledir) || $(mkinstalldirs) $(exampledir)
194 for f in $(EXAMPLEFILES); do \
195 rm -f $(exampledir)/$$f; \
196 $(INSTALL_DATA) $(srcdir)/$$f $(exampledir)/$$f; \
198 for f in $(PROCESSEDEXAMPLEFILES); do \
199 rm -f $(exampledir)/$$f; \
200 $(INSTALL_DATA) $$f $(exampledir)/$$f; \
203 install_html: $(HTMLDOCFILES) $(HTMLEXAMPLEFILES)
204 -test -d $(htmldocdir) || $(mkinstalldirs) $(htmldocdir)
205 for f in `ls $(HTMLDOCFILESALL)`; do \
206 rm -f $(htmldocdir)/$$f; \
207 $(INSTALL_DATA) $$f $(htmldocdir)/$$f; \
209 -test -d $(htmldocimagedir) || $(mkinstalldirs) $(htmldocimagedir)
210 rm -f $(htmldocimagedir)/$(HTMLDOCIMAGEFILES)
211 $(INSTALL_DATA) $(imagedir)/$(HTMLDOCIMAGEFILES) $(htmldocimagedir)
212 -test -d $(exampledir) || $(mkinstalldirs) $(exampledir)
213 for f in $(HTMLEXAMPLEFILES); do \
214 rm -f $(exampledir)/$$f; \
215 $(INSTALL_DATA) $$f $(exampledir)/$$f; \
217 -test -d $(exampleimagedir) || $(mkinstalldirs) $(exampleimagedir)
218 rm -f $(exampleimagedir)/$(HTMLEXAMPLEIMAGEFILES)
219 $(INSTALL_DATA) $(imagedir)/$(HTMLEXAMPLEIMAGEFILES) $(exampleimagedir)
222 -for f in groff `ls groff-*`; do \
223 rm -f $(infodir)/$$f; \
225 $(INSTALL_INFO) --remove --info-dir=$(infodir) $(infodir)/groff
226 -for f in $(DOCFILES) $(PROCESSEDDOCFILES); do \
227 rm -f $(docdir)/$$f; \
229 -for f in `ls $(HTMLDOCFILESALL)`; do \
230 rm -f $(htmldocdir)/$$f; \
232 -rm -f $(htmldocimagedir)/$(HTMLDOCIMAGEFILES)
233 -rmdir $(htmldocimagedir)
234 -for f in $(EXAMPLEFILES) $(PROCESSEDEXAMPLEFILES) $(HTMLEXAMPLEFILES); do \
235 rm -f $(exampledir)/$$f; \
237 -rm -f $(exampleimagedir)/$(HTMLEXAMPLEIMAGEFILES)
238 -rmdir $(exampleimagedir)