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
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
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
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; \
93 for f in $(NORMALFILES); do \
94 rm -f $(DESTDIR)$(tmacdir)/$$f; \
95 $(INSTALL_DATA) $(srcdir)/$$f $(DESTDIR)$(tmacdir)/$$f; \
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; \
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; \
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 \
123 sed -f $(srcdir)/strip.sed $(srcdir)/$$f >$$f-s; \
128 if test -n "$(tmac_wrap)"; then \
129 for m in ""$(tmac_wrap); do \
131 if test "$$m" = an; then \
132 echo .do mso andoc.tmac >>$$m-wrap; \
134 echo .cp 1 >>$$m-wrap; \
135 echo .so $(sys_tmac_prefix)$$m >>$$m-wrap; \
141 rm -f www.tmac-sed; \
142 sed -e "s;@PNMTOPS_NOSETPAGE@;$(pnmtops_nosetpage);g" \
143 $(srcdir)/www.tmac > www.tmac-sed;
147 -if test -n "$(tmac_wrap)"; then \
148 for m in ""$(tmac_wrap); do \
149 rm -f $(DESTDIR)$(systemtmacdir)/$$m.tmac; \
152 -for f in $(NORMALFILES) $(STRIPFILES); do \
153 rm -f $(DESTDIR)$(tmacdir)/$$f; \
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; \
162 -if cmp -s $(DESTDIR)$(localtmacdir)/mdoc.local \
163 $(srcdir)/mdoc.local; then \
164 rm -f $(DESTDIR)$(localtmacdir)/mdoc.local; \
166 -for f in $(MDOCFILES); do rm -f $(DESTDIR)$(mdocdir)/$$f; done
167 -rmdir $(DESTDIR)$(mdocdir)