* contrib/mom/Makefile.sub: Fix last change to make it really work.
[s-roff.git] / contrib / mom / Makefile.sub
blob6ff41e6059781b7053177eb0656b838b07e681b6
1 # Copyright (C) 2002, 2003 Free Software Foundation, Inc.
2 #      Written by Werner Lemberg (wl@gnu.org)
3
4 # This file is part of groff.
5
6 # groff is free software; you can redistribute it and/or modify it under
7 # the terms of the GNU General Public License as published by the Free
8 # Software Foundation; either version 2, or (at your option) any later
9 # version.
10
11 # groff is distributed in the hope that it will be useful, but WITHOUT ANY
12 # WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14 # for more details.
15
16 # You should have received a copy of the GNU General Public License along
17 # with groff; see the file COPYING.  If not, write to the Free Software
18 # Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 # These may be overridden if cross-compiling.
21 GROFFBIN=$(top_builddir)/src/roff/groff/groff
22 GROFF_BIN_PATH=`echo $(groff_bin_dirs) | sed -e 's|  *|:|g'`
24 groff_bin_dirs=\
25   $(top_builddir)/src/roff/groff \
26   $(top_builddir)/src/roff/troff \
27   $(top_builddir)/src/devices/grops
29 FFLAG=-F$(top_builddir)/font -F$(top_srcdir)/font
30 TFLAG=-M$(top_builddir)/tmac -M$(top_srcdir)/tmac -M$(srcdir)
32 GROFF=GROFF_COMMAND_PREFIX=''; \
33       export GROFF_COMMAND_PREFIX; \
34       GROFF_BIN_PATH=$(GROFF_BIN_PATH); \
35       export GROFF_BIN_PATH; \
36       $(GROFFBIN) $(FFLAG) $(TFLAG)
38 MAN7=\
39   groff_mom.n
41 NORMALFILES=\
42   mom.tmac \
43   om.tmac
45 HTMLDOCFILES=\
46   momdoc/appendices.html \
47   momdoc/cover.html \
48   momdoc/definitions.html \
49   momdoc/docelement.html \
50   momdoc/docprocessing.html \
51   momdoc/goodies.html \
52   momdoc/headfootpage.html \
53   momdoc/inlines.html \
54   momdoc/intro.html \
55   momdoc/letters.html \
56   momdoc/rectoverso.html \
57   momdoc/reserved.html \
58   momdoc/toc.html \
59   momdoc/typemacdoc.html \
60   momdoc/typesetting.html \
61   momdoc/using.html
63 EXAMPLEFILES=\
64   examples/letter.mom \
65   examples/macros.mom \
66   examples/typeset.mom \
67   examples/typewrite.mom \
68   examples/README.mom \
69   examples/elvis_syntax \
70   examples/penguin.ps
72 PROCESSEDEXAMPLEFILES=\
73   examples/letter.ps \
74   examples/macros.ps \
75   examples/typeset.ps \
76   examples/typewrite.ps
78 CLEANADD=\
79   penguin.ps \
80   $(PROCESSEDEXAMPLEFILES)
82 .SUFFIXES: .mom .ps
83 .mom.ps:
84         $(GROFF) -Tps -mom $< >$@
87 all: make_examples
89 .PHONY: make_examples prepare_make_examples
90 make_examples: prepare_make_examples $(PROCESSEDEXAMPLEFILES)
92 prepare_make_examples: examples/penguin.ps
93         test -d examples || $(mkinstalldirs) examples
94         test -f penguin.ps || cp $(srcdir)/examples/penguin.ps .
96 $(PROCESSEDEXAMPLEFILES): prepare_make_examples
98 install_data: $(NORMALFILES) $(HTMLDOCFILES) \
99               $(EXAMPLEFILES) $(PROCESSEDEXAMPLEFILES)
100         -test -d $(tmacdir) || $(mkinstalldirs) $(tmacdir)
101         for f in $(NORMALFILES); do \
102           rm -f $(tmacdir)/$$f; \
103           $(INSTALL_DATA) $(srcdir)/$$f $(tmacdir)/$$f; \
104         done
105         -test -d $(htmldocdir)/momdoc || $(mkinstalldirs) $(htmldocdir)/momdoc
106         for f in $(HTMLDOCFILES); do \
107           rm -f $(htmldocdir)/$$f; \
108           $(INSTALL_DATA) $(srcdir)/$$f $(htmldocdir)/$$f; \
109         done
110         -test -d $(exampledir) || $(mkinstalldirs) $(exampledir)
111         for f in $(EXAMPLEFILES); do \
112           rm -f $(exampledir)/$$f; \
113           $(INSTALL_DATA) $(srcdir)/$$f $(docdir)/$$f; \
114         done
115         for f in $(PROCESSEDEXAMPLEFILES); do \
116           rm -f $(exampledir)/$$f; \
117           $(INSTALL_DATA) $$f $(docdir)/$$f; \
118         done
120 uninstall_sub:
121         -for f in $(NORMALFILES); do \
122           rm -f $(tmacdir)/$$f; \
123         done
124         -for f in $(HTMLDOCFILES); do \
125           rm -f $(htmldocdir)/$$f; \
126         done
127         -rmdir $(htmldocdir)/momdoc
128         -for f in $(EXAMPLEFILES) $(PROCESSEDEXAMPLEFILES); do \
129           rm -f $(docdir)/$$f; \
130         done