typos
[s-roff.git] / tmac / Makefile.sub
blob5bbe86c257bf75c69137cc1ac4eb8256eefd19d0
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
60 # These files are handled specially during installation and deinstallation.
61 SPECIALFILES=an.tmac s.tmac www.tmac
63 # These files are processed with `strip.sed'.
64 STRIPFILES=e.tmac doc.tmac doc-old.tmac
65 MDOCFILES=doc-common doc-ditroff doc-nroff doc-syms
66 mdocdir=$(tmacdir)/mdoc
68 CLEANADD=\
69   stamp-wrap stamp-sed *-wrap www.tmac-sed \
70   stamp-strip e.tmac-s doc.tmac-s doc-old.tmac-s \
71   doc-common-s doc-ditroff-s doc-nroff-s doc-syms-s mdoc.local-s
72 tmac_s_prefix=
73 tmac_an_prefix=
74 tmac_wrap=
75 sys_tmac_prefix=
76 pnmtops_nosetpage="pnmtops"
78 all: stamp-strip stamp-wrap stamp-sed
80 install_data: $(NORMALFILES) $(SPECIALFILES) man.local \
81               stamp-strip stamp-wrap stamp-sed
82         -test -d $(DESTDIR)$(tmacdir) \
83           || $(mkinstalldirs) $(DESTDIR)$(tmacdir)
84         -test -d $(DESTDIR)$(systemtmacdir) \
85           || $(mkinstalldirs) $(DESTDIR)$(systemtmacdir)
86         -test -d $(DESTDIR)$(localtmacdir) \
87           || $(mkinstalldirs) $(DESTDIR)$(localtmacdir)
88         if test -n "$(tmac_wrap)"; then \
89           for m in ""$(tmac_wrap); do \
90             $(INSTALL_DATA) $$m-wrap $(DESTDIR)$(systemtmacdir)/$$m.tmac; \
91           done; \
92         fi
93         for f in $(NORMALFILES); do \
94           rm -f $(DESTDIR)$(tmacdir)/$$f; \
95           $(INSTALL_DATA) $(srcdir)/$$f $(DESTDIR)$(tmacdir)/$$f; \
96         done
97         -rm -f $(DESTDIR)$(tmacdir)/$(tmac_s_prefix)s.tmac
98         $(INSTALL_DATA) $(srcdir)/s.tmac \
99           $(DESTDIR)$(tmacdir)/$(tmac_s_prefix)s.tmac
100         -rm -f $(DESTDIR)$(tmacdir)/$(tmac_an_prefix)an.tmac
101         $(INSTALL_DATA) $(srcdir)/an.tmac \
102           $(DESTDIR)$(tmacdir)/$(tmac_an_prefix)an.tmac
103         -rm -f $(DESTDIR)$(tmacdir)/www.tmac
104         $(INSTALL_DATA) www.tmac-sed $(DESTDIR)$(tmacdir)/www.tmac
105         for f in $(STRIPFILES); do \
106           rm -f $(DESTDIR)$(tmacdir)/$$f; \
107           $(INSTALL_DATA) $$f-s $(DESTDIR)$(tmacdir)/$$f; \
108         done
109         -test -d $(DESTDIR)$(mdocdir) || $(mkinstalldirs) $(DESTDIR)$(mdocdir)
110         for f in $(MDOCFILES); do \
111           rm -f $(DESTDIR)$(mdocdir)/$$f; \
112           $(INSTALL_DATA) $$f-s $(DESTDIR)$(mdocdir)/$$f; \
113         done
114         -test -f $(DESTDIR)$(localtmacdir)/man.local || \
115           $(INSTALL_DATA) $(srcdir)/man.local \
116             $(DESTDIR)$(localtmacdir)/man.local
117         -test -f $(DESTDIR)$(localtmacdir)/mdoc.local || \
118           $(INSTALL_DATA) mdoc.local-s $(DESTDIR)$(localtmacdir)/mdoc.local
120 stamp-strip: $(STRIPFILES) $(MDOCFILES) mdoc.local
121         for f in $(STRIPFILES) $(MDOCFILES) mdoc.local; do \
122           rm -f $$f-s; \
123           sed -f $(srcdir)/strip.sed $(srcdir)/$$f >$$f-s; \
124         done
125         touch $@
127 stamp-wrap:
128         if test -n "$(tmac_wrap)"; then \
129           for m in ""$(tmac_wrap); do \
130             rm -f $$m-wrap; \
131             if test "$$m" = an; then \
132               echo .do mso andoc.tmac >>$$m-wrap; \
133             fi; \
134             echo .cp 1 >>$$m-wrap; \
135             echo .so $(sys_tmac_prefix)$$m >>$$m-wrap; \
136           done; \
137         fi
138         touch $@
140 stamp-sed: www.tmac
141         rm -f www.tmac-sed; \
142         sed -e "s;@PNMTOPS_NOSETPAGE@;$(pnmtops_nosetpage);g" \
143           $(srcdir)/www.tmac > www.tmac-sed;
144         touch $@
146 uninstall_sub:
147         -if test -n "$(tmac_wrap)"; then \
148           for m in ""$(tmac_wrap); do \
149             rm -f $(DESTDIR)$(systemtmacdir)/$$m.tmac; \
150           done; \
151         fi
152         -for f in $(NORMALFILES) $(STRIPFILES); do \
153           rm -f $(DESTDIR)$(tmacdir)/$$f; \
154         done
155         -rm -f $(DESTDIR)$(tmacdir)/$(tmac_s_prefix)s.tmac
156         -rm -f $(DESTDIR)$(tmacdir)/$(tmac_an_prefix)an.tmac
157         -rm -f $(DESTDIR)$(tmacdir)/www.tmac
158         -if cmp -s $(DESTDIR)$(localtmacdir)/man.local \
159                    $(srcdir)/man.local; then \
160           rm -f $(DESTDIR)$(localtmacdir)/man.local; \
161         fi
162         -if cmp -s $(DESTDIR)$(localtmacdir)/mdoc.local \
163                    $(srcdir)/mdoc.local; then \
164           rm -f $(DESTDIR)$(localtmacdir)/mdoc.local; \
165         fi
166         -for f in $(MDOCFILES); do rm -f $(DESTDIR)$(mdocdir)/$$f; done
167         -rmdir $(DESTDIR)$(mdocdir)