1 # Copyright (C) 1989-2018 Free Software Foundation, Inc.
2 # Written by James Clark (jjc@jclark.com)
3 # Automake migration by Bertrand Garrigues
5 # Latest update: 22 Aug 2015
7 # This file is part of groff.
9 # groff is free software; you can redistribute it and/or modify it under
10 # the terms of the GNU General Public License as published by the Free
11 # Software Foundation, either version 3 of the License, or (at your
12 # option) any later version.
14 # groff is distributed in the hope that it will be useful, but WITHOUT
15 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
16 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19 # You should have received a copy of the GNU General Public License
20 # along with this program. If not, see <http://www.gnu.org/licenses/>.
21 tmac_srcdir = $(top_srcdir)/tmac
22 tmac_builddir = $(top_builddir)/tmac
95 NORMALFILES = `echo $(TMACNORMALFILES) | sed -e "s|tmac/||g"`
97 # TMACSTRIPFILES are built from their unstripped version (-u)
98 TMACSTRIPFILES = tmac/e.tmac tmac/doc.tmac tmac/doc-old.tmac
100 # Files installed in tmacdir
101 dist_tmac_DATA = $(TMACNORMALFILES) tmac/an.tmac tmac/s.tmac
102 nodist_tmac_DATA = $(TMACSTRIPFILES) tmac/www.tmac
109 MDOCFILES = `echo $(TMACMDOCFILES) | sed -e "s|tmac/||g"`
110 mdocdir=$(tmacdir)/mdoc
111 # Files installed in mdocdir
112 nodist_mdoc_DATA = $(TMACMDOCFILES)
114 # Installed in localtmacdir
115 dist_localtmac_DATA = tmac/man.local tmac/mdoc.local
117 MOSTLYCLEANFILES += $(TMACMDOCFILES) tmac/www.tmac $(TMACSTRIPFILES) \
123 tmac/groff_ms.7.man \
124 tmac/groff_man.7.man \
125 tmac/groff_me.7.man \
126 tmac/groff_mdoc.7.man \
127 tmac/groff_trace.7.man \
128 tmac/groff_www.7.man \
139 dist-hook: tmac-dist-hook
141 chmod u+w $(distdir)/tmac
142 for f in $(TMACMDOCFILES) $(TMACSTRIPFILES); do \
143 cp -f $(top_srcdir)/$$f-u $(distdir)/tmac; \
146 $(TMACMDOCFILES) $(TMACSTRIPFILES):
147 $(MKDIR_P) $(top_builddir)/tmac
148 for f in $(TMACMDOCFILES) $(TMACSTRIPFILES); do \
149 sed -f $(tmac_srcdir)/strip.sed $(top_srcdir)/$$f-u > $(top_builddir)/$$f; \
152 tmac/www.tmac: tmac/www.tmac.in
153 $(MKDIR_P) $(top_builddir)/tmac
154 sed -e "s;[@]PNMTOPS_NOSETPAGE[@];$(pnmtops_nosetpage);g" \
155 $(tmac_srcdir)/www.tmac.in > $(top_builddir)/tmac/www.tmac
157 # The installation of groff compatibility wrappers for vendor-provided
158 # non-GNU macro sets is controlled by 'compatibility_wrappers' (see the
159 # commentary surrounding m4/groff.m4's
160 # GROFF_WITH_COMPATIBILITY_WRAPPERS). Collision detection variables of
161 # the form 'tmac_<macro>_prefix' are defined in Makefile.am, to assist
162 # in the installation of groff-provided macro sets.
164 # When 'compatibility_wrappers' is 'no', one step is performed:
165 # - the groff-provided macro set implementations are installed in
166 # <prefix>/share/groff/<version>/tmac/ with the original macro set
169 # When 'compatibility_wrappers' is 'yes', two steps are performed:
170 # - the groff-provided macro set implementations are installed in
171 # <prefix>/share/groff/<version>/tmac/ with a prefix of
172 # $(tmac_prefix) (which is usually 'g', via the appropriate
173 # collision detection variable)
174 # - the generated compatibility wrappers are installed in
175 # <prefix>/lib/groff/site-tmac, with the original macro set name
177 # When 'compatibility_wrappers' is 'manual', two steps are performed:
178 # - the groff-provided macro set implementations are installed in
179 # <prefix>/share/groff/<version>/tmac/ with the original macro set
181 # - the generated compatibility wrappers are installed in
182 # <prefix>/lib/groff/site-tmac, with a name of
183 # <macro><wrapper_suffix>, (which is usually '-os', see
184 # 'wrapper_suffix_default' in Makefile.am)
189 # Generate groff compatibility wrappers for all non-GNU OS provided
192 $(MKDIR_P) $(top_builddir)/tmac;
193 if test -n "$(tmac_wrap)"; then \
194 for m in ""$(tmac_wrap); do \
195 $(RM) $(top_builddir)/tmac/$$m-wrap; \
196 if test "$$m" = an; then \
197 echo .do mso andoc.tmac >>$(top_builddir)/tmac/$$m-wrap; \
199 echo .cp 1 >>$(top_builddir)/tmac/$$m-wrap; \
200 echo .so $(sys_tmac_prefix)$$m >>$(top_builddir)/tmac/$$m-wrap; \
205 # Install groff compatibility wrappers into
206 # <prefix>/lib/groff/site-tmac.
207 install-data-local: install_tmac_wrap
209 $(MKDIR_P) $(DESTDIR)$(systemtmacdir);
210 if test "$(compatibility_wrappers)" != "no"; then \
211 if test -n "$(tmac_wrap)"; then \
212 for m in ""$(tmac_wrap); do \
213 $(INSTALL_DATA) $(tmac_builddir)/$$m-wrap \
214 $(DESTDIR)$(systemtmacdir)/$$m$(wrapper_suffix).tmac; \
219 # Rename the groff implementations of colliding macro sets to have a
221 install-data-hook: install_tmac_wrap_hook
222 install_tmac_wrap_hook:
223 if test "$(compatibility_wrappers)" = "yes"; then \
224 if test -n "$(tmac_wrap)"; then \
225 if test -f $(DESTDIR)$(tmacdir)/s.tmac -a -n "$(tmac_s_prefix)"; \
227 mv $(DESTDIR)$(tmacdir)/s.tmac \
228 $(DESTDIR)$(tmacdir)/$(tmac_s_prefix)s.tmac; \
230 if test -f $(DESTDIR)$(tmacdir)/an.tmac -a -n "$(tmac_an_prefix)"; \
232 mv $(DESTDIR)$(tmacdir)/an.tmac \
233 $(DESTDIR)$(tmacdir)/$(tmac_an_prefix)an.tmac; \
238 # Uninstall groff compatibility wrappers & renamed groff implementation
240 uninstall_groffdirs: uninstall_tmac_hook
242 if test -n "$(tmac_wrap)"; then \
243 if test "$(compatibility_wrappers)" != "no"; then \
244 for m in ""$(tmac_wrap); do \
245 $(RM) $(DESTDIR)$(systemtmacdir)/$$m$(wrapper_suffix).tmac; \
248 $(RM) -f $(DESTDIR)$(tmacdir)/$(tmac_an_prefix)an.tmac; \
249 $(RM) -f $(DESTDIR)$(tmacdir)/$(tmac_s_prefix)s.tmac; \
251 if test -d $(DESTDIR)$(mdocdir); then \
252 rmdir $(DESTDIR)$(mdocdir); \
254 if test -d $(DESTDIR)$(tmacdir); then \
255 rmdir $(DESTDIR)$(tmacdir); \
257 if test -d $(DESTDIR)$(localtmacdir); then \
258 rmdir $(DESTDIR)$(localtmacdir); \
262 ########################################################################
264 ########################################################################
267 # mode: makefile-automake
270 # vim: set filetype=automake textwidth=72: