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