Imported Upstream version 1.22.3
[platform/upstream/groff.git] / contrib / mm / Makefile.sub
1 # Copyright 1991-2014  Free Software Foundation, Inc.
2 #
3 # This file is part of groff.
4 #
5 # groff is free software; you can redistribute it and/or modify it under
6 # the terms of the GNU General Public License as published by the Free
7 # Software Foundation, either version 3 of the License, or
8 # (at your option) any later version.
9 #
10 # groff is distributed in the hope that it will be useful, but WITHOUT ANY
11 # WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
13 # for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program. If not, see <http://www.gnu.org/licenses/>.
17 #
18 # Makefile.sub
19 #
20 #
21 PROG=mmroff
22 MAN1=\
23   mmroff.n
24 MAN7=\
25   groff_mm.n \
26   groff_mmse.n
27 FILES=0.MT 5.MT 4.MT ms.cov se_ms.cov
28 # Local configuration files with default values.
29 LOCALE=locale se_locale
30 MOSTLYCLEANADD=temp
31 RM=rm -f
32
33 all: mmroff
34
35 install_bin: install_mmroff
36
37 install_data: install_m
38         -test -d $(DESTDIR)$(tmacdir)/mm \
39           || $(mkinstalldirs) $(DESTDIR)$(tmacdir)/mm
40         for f in $(FILES); do \
41           $(RM) $(DESTDIR)$(tmacdir)/mm/$$f; \
42           $(INSTALL_DATA) $(srcdir)/mm/$$f $(DESTDIR)$(tmacdir)/mm/$$f; \
43         done
44         for f in $(LOCALE); do \
45           test -f $(DESTDIR)$(tmacdir)/mm/$$f \
46             || touch $(DESTDIR)$(tmacdir)/mm/$$f; \
47         done
48         $(INSTALL_DATA) $(srcdir)/refer-mm.tmac \
49           $(DESTDIR)$(tmacdir)/refer-mm.tmac
50
51 install_m:
52         -test -d $(DESTDIR)$(tmacdir) || $(mkinstalldirs) $(DESTDIR)$(tmacdir)
53         $(RM) $(DESTDIR)$(tmacdir)/tmac.$(tmac_m_prefix)m
54         $(RM) $(DESTDIR)$(tmacdir)/$(tmac_m_prefix)m.tmac
55         $(INSTALL_DATA) $(srcdir)/m.tmac \
56           $(DESTDIR)$(tmacdir)/$(tmac_m_prefix)m.tmac
57         @sed -e "s;^.mso m.tmac;.mso $(tmac_m_prefix)m.tmac;g" \
58           $(srcdir)/mse.tmac > $(DESTDIR)$(tmacdir)/$(tmac_m_prefix)mse.tmac
59         @sed -e "s;^.mso mse.tmac;.mso $(tmac_m_prefix)mse.tmac;g" \
60           $(srcdir)/mmse.tmac > $(DESTDIR)$(tmacdir)/$(tmac_m_prefix)mmse.tmac
61         @sed -e "s;^.mso m.tmac;.mso $(tmac_m_prefix)m.tmac;g" \
62           $(srcdir)/mm.tmac > $(DESTDIR)$(tmacdir)/$(tmac_m_prefix)mm.tmac
63
64 install_mmroff: mmroff
65         -test -d $(DESTDIR)$(bindir) || $(mkinstalldirs) $(DESTDIR)$(bindir)
66         $(RM) $(DESTDIR)$(bindir)/mmroff
67         $(INSTALL_SCRIPT) mmroff $(DESTDIR)$(bindir)/mmroff
68
69 mmroff: mmroff.pl
70         sed -e 's;/usr/bin/perl;$(PERL);' $(srcdir)/mmroff.pl >$@
71         chmod +x $@
72
73 uninstall_sub:
74         -for f in $(FILES); do $(RM) $(DESTDIR)$(tmacdir)/mm/$$f; done
75         -for f in $(LOCALE); do \
76           test -s $(DESTDIR)$(tmacdir)/mm/$$f \
77             || $(RM) $(DESTDIR)$(tmacdir)/mm/$$f; \
78         done
79         $(RM) $(DESTDIR)$(tmacdir)/tmac.$(tmac_m_prefix)m
80         $(RM) $(DESTDIR)$(tmacdir)/$(tmac_m_prefix)m.tmac
81         $(RM) $(DESTDIR)$(tmacdir)/$(tmac_m_prefix)mm.tmac
82         $(RM) $(DESTDIR)$(tmacdir)/$(tmac_m_prefix)mse.tmac
83         $(RM) $(DESTDIR)$(tmacdir)/$(tmac_m_prefix)mmse.tmac
84         $(RM) $(DESTDIR)$(tmacdir)/refer-mm.tmac
85         -test -d $(DESTDIR)$(tmacdir)/mm && \
86           rmdir $(DESTDIR)$(tmacdir)/mm
87         $(RM) $(DESTDIR)$(bindir)/mmroff
88
89 ########################################################################
90 # Emacs settings
91 ########################################################################
92 #
93 # Local Variables:
94 # mode: makefile
95 # End: