15062325b841449a0bae4252cde137ede8d46649
[platform/upstream/groff.git] / tmac / Makefile.sub
1 # Makefile.sub for `tmac'
2 #
3 # File position: <groff-source>/tmac/Makefile.sub
4 #
5 # Copyright (C) 1989-2014  Free Software Foundation, Inc.
6 #      Written by James Clark (jjc@jclark.com)
7 #
8 # This file is part of groff.
9 #
10 # groff is free software; you can redistribute it and/or modify it under
11 # the terms of the GNU General Public License as published by the Free
12 # Software Foundation, either version 3 of the License, or
13 # (at your option) any later version.
14 #
15 # groff is distributed in the hope that it will be useful, but WITHOUT ANY
16 # WARRANTY; without even the implied warranty of MERCHANTABILITY or
17 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
18 # for more details.
19 #
20 # You should have received a copy of the GNU General Public License
21 # along with this program. If not, see <http://www.gnu.org/licenses/>.
22 #
23 ########################################################################
24
25 MAN7=\
26   groff_ms.n \
27   groff_man.n \
28   groff_me.n \
29   groff_mdoc.n \
30   groff_trace.n \
31   groff_www.n
32
33 NORMALFILES=\
34   man.tmac mandoc.tmac andoc.tmac an-old.tmac an-ext.tmac \
35   ms.tmac \
36   me.tmac \
37   mdoc.tmac \
38   pic.tmac \
39   a4.tmac papersize.tmac \
40   62bit.tmac \
41   ec.tmac \
42   safer.tmac \
43   trace.tmac \
44   ps.tmac psold.tmac pspic.tmac psatk.tmac \
45   pdf.tmac \
46   dvi.tmac \
47   tty.tmac tty-char.tmac \
48   latin1.tmac latin2.tmac latin5.tmac latin9.tmac cp1047.tmac \
49   unicode.tmac \
50   X.tmac Xps.tmac \
51   lj4.tmac \
52   lbp.tmac \
53   html.tmac html-end.tmac \
54   devtag.tmac \
55   europs.tmac \
56   composite.tmac fallbacks.tmac \
57   eqnrc \
58   refer.tmac refer-me.tmac refer-ms.tmac \
59   troffrc troffrc-end \
60   trans.tmac \
61   hyphen.us hyphenex.us \
62   fr.tmac hyphen.fr \
63   sv.tmac hyphen.sv \
64   de.tmac den.tmac hyphen.det hyphen.den hyphenex.det \
65   cs.tmac hyphen.cs hyphenex.cs \
66   ja.tmac
67
68 # These files are handled specially during installation and deinstallation.
69 SPECIALFILES=an.tmac s.tmac www.tmac
70
71 # These files are processed with `strip.sed'.
72 STRIPFILES=e.tmac doc.tmac doc-old.tmac
73 MDOCFILES=doc-common doc-ditroff doc-nroff doc-syms
74 mdocdir=$(tmacdir)/mdoc
75
76 MOSTLYCLEANADD=\
77   stamp-wrap stamp-sed *-wrap www.tmac-sed \
78   stamp-strip e.tmac-s doc.tmac-s doc-old.tmac-s \
79   doc-common-s doc-ditroff-s doc-nroff-s doc-syms-s mdoc.local-s
80 tmac_s_prefix=
81 tmac_an_prefix=
82 tmac_wrap=
83 sys_tmac_prefix=
84 pnmtops_nosetpage="pnmtops"
85
86 RM=rm -f
87
88 all: stamp-strip stamp-wrap stamp-sed
89
90 install_data: $(NORMALFILES) $(SPECIALFILES) man.local \
91               stamp-strip stamp-wrap stamp-sed
92         -test -d $(DESTDIR)$(tmacdir) \
93           || $(mkinstalldirs) $(DESTDIR)$(tmacdir)
94         -test -d $(DESTDIR)$(systemtmacdir) \
95           || $(mkinstalldirs) $(DESTDIR)$(systemtmacdir)
96         -test -d $(DESTDIR)$(localtmacdir) \
97           || $(mkinstalldirs) $(DESTDIR)$(localtmacdir)
98         if test -n "$(tmac_wrap)"; then \
99           for m in ""$(tmac_wrap); do \
100             $(INSTALL_DATA) $$m-wrap $(DESTDIR)$(systemtmacdir)/$$m.tmac; \
101           done; \
102         fi
103         for f in $(NORMALFILES); do \
104           $(RM) $(DESTDIR)$(tmacdir)/$$f; \
105           $(INSTALL_DATA) $(srcdir)/$$f $(DESTDIR)$(tmacdir)/$$f; \
106         done
107         $(RM) $(DESTDIR)$(tmacdir)/$(tmac_s_prefix)s.tmac
108         $(INSTALL_DATA) $(srcdir)/s.tmac \
109           $(DESTDIR)$(tmacdir)/$(tmac_s_prefix)s.tmac
110         $(RM) $(DESTDIR)$(tmacdir)/$(tmac_an_prefix)an.tmac
111         $(INSTALL_DATA) $(srcdir)/an.tmac \
112           $(DESTDIR)$(tmacdir)/$(tmac_an_prefix)an.tmac
113         $(RM) $(DESTDIR)$(tmacdir)/www.tmac
114         $(INSTALL_DATA) www.tmac-sed $(DESTDIR)$(tmacdir)/www.tmac
115         for f in $(STRIPFILES); do \
116           $(RM) $(DESTDIR)$(tmacdir)/$$f; \
117           $(INSTALL_DATA) $$f-s $(DESTDIR)$(tmacdir)/$$f; \
118         done
119         -test -d $(DESTDIR)$(mdocdir) || $(mkinstalldirs) $(DESTDIR)$(mdocdir)
120         for f in $(MDOCFILES); do \
121           $(RM) $(DESTDIR)$(mdocdir)/$$f; \
122           $(INSTALL_DATA) $$f-s $(DESTDIR)$(mdocdir)/$$f; \
123         done
124         -test -f $(DESTDIR)$(localtmacdir)/man.local \
125           || $(INSTALL_DATA) $(srcdir)/man.local \
126                $(DESTDIR)$(localtmacdir)/man.local
127         -test -f $(DESTDIR)$(localtmacdir)/mdoc.local \
128           || $(INSTALL_DATA) mdoc.local-s $(DESTDIR)$(localtmacdir)/mdoc.local
129
130 stamp-strip: $(STRIPFILES) $(MDOCFILES) mdoc.local
131         for f in $(STRIPFILES) $(MDOCFILES) mdoc.local; do \
132           $(RM) $$f-s; \
133           sed -f $(srcdir)/strip.sed $(srcdir)/$$f >$$f-s; \
134         done
135         touch $@
136
137 stamp-wrap:
138         if test -n "$(tmac_wrap)"; then \
139           for m in ""$(tmac_wrap); do \
140             $(RM) $$m-wrap; \
141             if test "$$m" = an; then \
142               echo .do mso andoc.tmac >>$$m-wrap; \
143             fi; \
144             echo .cp 1 >>$$m-wrap; \
145             echo .so $(sys_tmac_prefix)$$m >>$$m-wrap; \
146           done; \
147         fi
148         touch $@
149
150 stamp-sed: www.tmac
151         sed -e "s;@PNMTOPS_NOSETPAGE@;$(pnmtops_nosetpage);g" \
152           $(srcdir)/www.tmac > www.tmac-sed
153         touch $@
154
155 uninstall_sub:
156         -if test -n "$(tmac_wrap)"; then \
157           for m in ""$(tmac_wrap); do \
158             $(RM) $(DESTDIR)$(systemtmacdir)/$$m.tmac; \
159           done; \
160         fi
161         -for f in $(NORMALFILES) $(STRIPFILES); do \
162           $(RM) $(DESTDIR)$(tmacdir)/$$f; \
163         done
164         $(RM) $(DESTDIR)$(tmacdir)/$(tmac_s_prefix)s.tmac
165         $(RM) $(DESTDIR)$(tmacdir)/$(tmac_an_prefix)an.tmac
166         $(RM) $(DESTDIR)$(tmacdir)/www.tmac
167         -if cmp -s $(DESTDIR)$(localtmacdir)/man.local \
168                    $(srcdir)/man.local; then \
169           $(RM) $(DESTDIR)$(localtmacdir)/man.local; \
170         fi
171         -if cmp -s $(DESTDIR)$(localtmacdir)/mdoc.local \
172                    $(srcdir)/mdoc.local; then \
173           $(RM) $(DESTDIR)$(localtmacdir)/mdoc.local; \
174         fi
175         -for f in $(MDOCFILES); do $(RM) $(DESTDIR)$(mdocdir)/$$f; done
176         -test -d $(DESTDIR)$(mdocdir) && rmdir $(DESTDIR)$(mdocdir)
177
178 ########################################################################
179 # Emacs settings
180 ########################################################################
181 #
182 # Local Variables:
183 # mode: makefile
184 # End: