Initial import from FreeBSD RELENG_4:
[games.git] / contrib / groff / contrib / mom / Makefile.sub
1 # Copyright (C) 2002 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.
19
20 groff_bin_dirs=\
21   $(top_builddir)/src/roff/groff \
22   $(top_builddir)/src/roff/troff \
23   $(top_builddir)/src/devices/grops
24 groff_bin_path=`echo $(groff_bin_dirs) | sed -e 's|  *|:|g'`
25
26 FFLAG=-F$(top_builddir)/font -F$(top_srcdir)/font
27 TFLAG=-M$(top_builddir)/tmac -M$(top_srcdir)/tmac -M$(srcdir)
28
29 GROFF=GROFF_COMMAND_PREFIX=''; \
30       export GROFF_COMMAND_PREFIX; \
31       GROFF_BIN_PATH=$(groff_bin_path); \
32       export GROFF_BIN_PATH; \
33       $(top_builddir)/src/roff/groff/groff $(FFLAG) $(TFLAG)
34
35 MAN7=\
36   groff_mom.n
37
38 NORMALFILES=\
39   mom.tmac \
40   om.tmac
41
42 HTMLDOCFILES=\
43   momdoc/appendices.html \
44   momdoc/cover.html \
45   momdoc/definitions.html \
46   momdoc/docelement.html \
47   momdoc/docprocessing.html \
48   momdoc/goodies.html \
49   momdoc/headfootpage.html \
50   momdoc/inlines.html \
51   momdoc/intro.html \
52   momdoc/letters.html \
53   momdoc/rectoverso.html \
54   momdoc/reserved.html \
55   momdoc/toc.html \
56   momdoc/typemacdoc.html \
57   momdoc/typesetting.html \
58   momdoc/using.html
59
60 EXAMPLEFILES=\
61   examples/letter.mom \
62   examples/macros.mom \
63   examples/typeset.mom \
64   examples/typewrite.mom \
65   examples/README.mom \
66   examples/elvis_syntax \
67   examples/penguin.ps
68
69 PROCESSEDEXAMPLEFILES=\
70   examples/letter.ps \
71   examples/macros.ps \
72   examples/typeset.ps \
73   examples/typewrite.ps
74
75 CLEANADD=\
76   penguin.ps \
77   $(PROCESSEDEXAMPLEFILES)
78
79 .SUFFIXES: .mom .ps
80 .mom.ps:
81         $(GROFF) -Tps -mom $< >$@
82
83
84 all: make_examples
85
86 .PHONY: make_examples
87 make_examples: prepare_make_examples $(PROCESSEDEXAMPLEFILES)
88
89 prepare_make_examples: examples/penguin.ps
90         test -d examples || $(mkinstalldirs) examples
91         test -f penguin.ps || cp $(srcdir)/examples/penguin.ps .
92
93 install_data: $(NORMALFILES) $(HTMLDOCFILES) \
94               $(EXAMPLEFILES) $(PROCESSEDEXAMPLEFILES)
95         -test -d $(tmacdir) || $(mkinstalldirs) $(tmacdir)
96         for f in $(NORMALFILES); do \
97           rm -f $(tmacdir)/$$f; \
98           $(INSTALL_DATA) $(srcdir)/$$f $(tmacdir)/$$f; \
99         done
100         -test -d $(htmldocdir)/momdoc || $(mkinstalldirs) $(htmldocdir)/momdoc
101         for f in $(HTMLDOCFILES); do \
102           rm -f $(htmldocdir)/$$f; \
103           $(INSTALL_DATA) $(srcdir)/$$f $(htmldocdir)/$$f; \
104         done
105         -test -d $(exampledir) || $(mkinstalldirs) $(exampledir)
106         for f in $(EXAMPLEFILES); do \
107           rm -f $(exampledir)/$$f; \
108           $(INSTALL_DATA) $(srcdir)/$$f $(docdir)/$$f; \
109         done
110         for f in $(PROCESSEDEXAMPLEFILES); do \
111           rm -f $(exampledir)/$$f; \
112           $(INSTALL_DATA) $$f $(docdir)/$$f; \
113         done
114
115 uninstall_sub:
116         -for f in $(NORMALFILES); do \
117           rm -f $(tmacdir)/$$f; \
118         done
119         -for f in $(HTMLDOCFILES); do \
120           rm -f $(htmldocdir)/$$f; \
121         done
122         -rmdir $(htmldocdir)/momdoc
123         -for f in $(EXAMPLEFILES) $(PROCESSEDEXAMPLEFILES); do \
124           rm -f $(docdir)/$$f; \
125         done