PageRenderTime 16ms CodeModel.GetById 1ms app.highlight 13ms RepoModel.GetById 1ms app.codeStats 0ms

/contrib/groff/doc/Makefile.sub

https://bitbucket.org/freebsd/freebsd-head/
Unknown | 233 lines | 197 code | 36 blank | 0 comment | 0 complexity | f9f6e1b704f30be128bd027640f87989 MD5 | raw file
  1# Copyright (C) 2002, 2003, 2004, 2005 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, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA.
 19
 20# These may be overridden if cross-compiling.
 21GROFFBIN=$(top_builddir)/src/roff/groff/groff
 22GROFF_BIN_PATH=`echo $(groff_bin_dirs) | sed -e 's|  *|$(SH_SEP)|g'`
 23
 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.
 27MAKEINFO=makeinfo
 28
 29groff_bin_dirs=\
 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
 41
 42FFLAG=-F$(top_builddir)/font -F$(top_srcdir)/font
 43TFLAG=-M$(top_builddir)/tmac -M$(top_srcdir)/tmac
 44
 45GROFF=\
 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
 52
 53DOCFILES=\
 54  meref.me \
 55  meintro.me \
 56  pic.ms
 57
 58PROCESSEDDOCFILES=\
 59  meref.ps \
 60  meintro.ps \
 61  pic.ps
 62
 63HTMLDOCFILES=\
 64  pic.html
 65
 66HTMLDOCFILESALL=\
 67  pic*.html
 68
 69HTMLDOCIMAGEFILES=\
 70  pic*
 71
 72EXAMPLEFILES=\
 73  webpage.ms \
 74  groff.css \
 75  grnexmpl.g \
 76  grnexmpl.me
 77
 78PROCESSEDEXAMPLEFILES=\
 79  webpage.ps \
 80  grnexmpl.ps
 81
 82HTMLEXAMPLEFILES=\
 83  webpage.html
 84
 85HTMLEXAMPLEIMAGEFILES=\
 86  webpage*
 87
 88imagedir=img
 89htmldocimagedir=$(htmldocdir)/$(imagedir)
 90exampleimagedir=$(exampledir)/$(imagedir)
 91
 92CLEANADD=\
 93  $(PROCESSEDDOCFILES) \
 94  $(PROCESSEDEXAMPLEFILES) \
 95  $(HTMLEXAMPLEFILES) \
 96  $(HTMLDOCFILESALL) \
 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* \
100  examples.stamp
101
102CLEANDIRADD=\
103  $(imagedir)
104
105CLEANNOTSRCDIRADD=\
106  groff.css \
107  grnexmpl.g \
108  groff \
109  groff-* \
110  gnu.eps \
111  gnu.png
112
113.SUFFIXES: .me .ms .ps .html
114
115# For simplicity, we always call grn and eqn.
116.me.ps:
117	$(GROFF) -Tps -ge -me >$@
118
119.ms.html:
120	$(GROFF) -P-p -P-b -P-I`basename $< | sed -e 's|.ms$$||'` \
121		 -P-D$(imagedir) -Thtml -ms >$@
122.ms.ps:
123	$(GROFF) -Tps -ms -mwww >$@
124
125
126all: groff $(PROCESSEDDOCFILES) prepare_examples \
127     $(PROCESSEDEXAMPLEFILES) $(make_html)
128
129html: $(HTMLDOCFILES) $(HTMLEXAMPLEFILES)
130
131prepare_examples: examples.stamp
132
133examples.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 .; \
141	  fi; \
142	fi
143	echo timestamp > $@
144
145groff: groff.texinfo
146	$(MAKEINFO) --enable-encoding -I$(srcdir) $(srcdir)/groff.texinfo
147
148gnu.eps: gnu.xpm
149	xpmtoppm $(srcdir)/gnu.xpm | pnmdepth 15 | \
150          $(pnmtops_nosetpage) -noturn -rle >$@
151
152gnu.png: gnu.xpm
153	xpmtoppm $(srcdir)/gnu.xpm | pnmdepth 15 | pnmtopng >$@
154
155pic.html: pic.ms
156	$(GROFF) -P-p -P-b -P-I`basename $< | sed -e 's|.ms$$||'` \
157                 -P-D$(imagedir) -P-j`basename $< | sed -e 's|.ms$$||'` \
158                 -Thtml -ms >$@
159
160webpage.html: webpage.ms gnu.png groff.css
161webpage.ps: gnu.eps
162
163grnexmpl.ps: grnexmpl.me grnexmpl.g
164
165distfiles: groff gnu.eps gnu.png
166
167install_data: groff $(DOCFILES) $(PROCESSEDDOCFILES) $(make_install_html) \
168              $(EXAMPLEFILES) $(PROCESSEDEXAMPLEFILES)
169	-test -d $(infodir) || $(mkinstalldirs) $(infodir)
170# Prefer info files in builddir over srcdir; we test for
171# the existence of `groff'.
172	d=.; \
173	  test -f "groff" || d=$(srcdir); \
174	  for f in $$d/groff `ls $$d/groff-*`; do \
175	    rm -f $(infodir)/`basename $$f`; \
176	    $(INSTALL_DATA) $$f $(infodir)/`basename $$f`; \
177	  done
178	$(INSTALL_INFO) --info-dir=$(infodir) $(infodir)/groff
179	-test -d $(docdir) || $(mkinstalldirs) $(docdir)
180	for f in $(DOCFILES); do \
181	  rm -f $(docdir)/$$f; \
182	  $(INSTALL_DATA) $(srcdir)/$$f $(docdir)/$$f; \
183	done
184	for f in $(PROCESSEDDOCFILES); do \
185	  rm -f $(docdir)/$$f; \
186	  $(INSTALL_DATA) $$f $(docdir)/$$f; \
187	done
188	-test -d $(exampledir) || $(mkinstalldirs) $(exampledir)
189	for f in $(EXAMPLEFILES); do \
190	  rm -f $(exampledir)/$$f; \
191	  $(INSTALL_DATA) $(srcdir)/$$f $(exampledir)/$$f; \
192	done
193	for f in $(PROCESSEDEXAMPLEFILES); do \
194	  rm -f $(exampledir)/$$f; \
195	  $(INSTALL_DATA) $$f $(exampledir)/$$f; \
196	done
197
198install_html: $(HTMLDOCFILES) $(HTMLEXAMPLEFILES)
199	-test -d $(htmldocdir) || $(mkinstalldirs) $(htmldocdir)
200	for f in `ls $(HTMLDOCFILESALL)`; do \
201	  rm -f $(htmldocdir)/$$f; \
202	  $(INSTALL_DATA) $$f $(htmldocdir)/$$f; \
203	done
204	-test -d $(htmldocimagedir) || $(mkinstalldirs) $(htmldocimagedir)
205	rm -f $(htmldocimagedir)/$(HTMLDOCIMAGEFILES)
206	$(INSTALL_DATA) $(imagedir)/$(HTMLDOCIMAGEFILES) $(htmldocimagedir)
207	-test -d $(exampledir) || $(mkinstalldirs) $(exampledir)
208	for f in $(HTMLEXAMPLEFILES); do \
209	  rm -f $(exampledir)/$$f; \
210	  $(INSTALL_DATA) $$f $(exampledir)/$$f; \
211	done
212	-test -d $(exampleimagedir) || $(mkinstalldirs) $(exampleimagedir)
213	rm -f $(exampleimagedir)/$(HTMLEXAMPLEIMAGEFILES)
214	$(INSTALL_DATA) $(imagedir)/$(HTMLEXAMPLEIMAGEFILES) $(exampleimagedir)
215
216uninstall_sub:
217	-for f in groff `ls groff-*`; do \
218	  rm -f $(infodir)/$$f; \
219	done
220	$(INSTALL_INFO) --remove --info-dir=$(infodir) $(infodir)/groff
221	-for f in $(DOCFILES) $(PROCESSEDDOCFILES); do \
222	  rm -f $(docdir)/$$f; \
223	done
224	-for f in `ls $(HTMLDOCFILESALL)`; do \
225	  rm -f $(htmldocdir)/$$f; \
226	done
227	-rm -f $(htmldocimagedir)/$(HTMLDOCIMAGEFILES)
228	-rmdir $(htmldocimagedir)
229	-for f in $(EXAMPLEFILES) $(PROCESSEDEXAMPLEFILES) $(HTMLEXAMPLEFILES); do \
230	  rm -f $(exampledir)/$$f; \
231	done
232	-rm -f $(exampleimagedir)/$(HTMLEXAMPLEIMAGEFILES)
233	-rmdir $(exampleimagedir)