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)
5 # This file is part of groff.
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
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
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.
30 man.tmac mandoc.tmac andoc.tmac an-old.tmac an-ext.tmac \
35 a4.tmac papersize.tmac \
40 ps.tmac psold.tmac pspic.tmac psatk.tmac \
42 tty.tmac tty-char.tmac \
43 latin1.tmac latin2.tmac latin5.tmac latin9.tmac cp1047.tmac \
48 html.tmac html-end.tmac \
55 hyphen.us hyphenex.us \
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
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
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; \
94 for f in $(NORMALFILES); do \
95 rm -f $(DESTDIR)$(tmacdir)/$$f; \
96 $(INSTALL_DATA) $(srcdir)/$$f $(DESTDIR)$(tmacdir)/$$f; \
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; \
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; \
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 \
124 sed -f $(srcdir)/strip.sed $(srcdir)/$$f >$$f-s; \
129 if test -n "$(tmac_wrap)"; then \
130 for m in ""$(tmac_wrap); do \
132 if test "$$m" = an; then \
133 echo .do mso andoc.tmac >>$$m-wrap; \
135 echo .cp 1 >>$$m-wrap; \
136 echo .so $(sys_tmac_prefix)$$m >>$$m-wrap; \
142 rm -f www.tmac-sed; \
143 sed -e "s;@PNMTOPS_NOSETPAGE@;$(pnmtops_nosetpage);g" \
144 $(srcdir)/www.tmac > www.tmac-sed;
148 -if test -n "$(tmac_wrap)"; then \
149 for m in ""$(tmac_wrap); do \
150 rm -f $(DESTDIR)$(systemtmacdir)/$$m.tmac; \
153 -for f in $(NORMALFILES) $(STRIPFILES); do \
154 rm -f $(DESTDIR)$(tmacdir)/$$f; \
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; \
163 -if cmp -s $(DESTDIR)$(localtmacdir)/mdoc.local \
164 $(srcdir)/mdoc.local; then \
165 rm -f $(DESTDIR)$(localtmacdir)/mdoc.local; \
167 -for f in $(MDOCFILES); do rm -f $(DESTDIR)$(mdocdir)/$$f; done
168 -rmdir $(DESTDIR)$(mdocdir)