summaryrefslogtreecommitdiffstats
path: root/contrib/mom/mom.am
blob: 3bbbc9ae835201846e742e0a976a8ad2f76167a7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
# Copyright (C) 2002-2020 Free Software Foundation, Inc.
#      Written by Werner Lemberg <wl@gnu.org>
#      Automake migration by Bertrand Garrigues
#        <bertrand.garrigues@laposte.net>
#
# This file is part of groff.
#
# groff is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free
# Software Foundation, either version 3 of the License, or (at your
# option) any later version.
#
# groff is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
# for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

mom_srcdir = $(top_srcdir)/contrib/mom

# pdfmom command used to generate .pdf
#
# Use '-K utf8', not '-k', in case 'configure' didn't find uchardet.
MOMPDFMOM = \
  GROFF_COMMAND_PREFIX= \
  GROFF_BIN_PATH="$(GROFF_BIN_PATH)" \
  PDFMOM_BIN_PATH="$(top_builddir)" \
  $(PDFMOMBIN) $(FFLAG) $(MFLAG) -M$(mom_srcdir) -K utf8 -p -e -t

man7_MANS += contrib/mom/groff_mom.7

# Files installed in $(tmacdir).
# MOMNORMALFILES are located in the source tree.
MOMNORMALFILES = \
  contrib/mom/mom.tmac \
  contrib/mom/om.tmac
momtmacdir = $(tmacdir)
dist_momtmac_DATA = $(MOMNORMALFILES)

# Files installed in htmldocdir/mom
MOMHTMLDOCFILES=\
  contrib/mom/momdoc/stylesheet.css \
  contrib/mom/momdoc/appendices.html \
  contrib/mom/momdoc/color.html \
  contrib/mom/momdoc/cover.html \
  contrib/mom/momdoc/definitions.html \
  contrib/mom/momdoc/docelement.html \
  contrib/mom/momdoc/docprocessing.html \
  contrib/mom/momdoc/goodies.html \
  contrib/mom/momdoc/graphical.html \
  contrib/mom/momdoc/headfootpage.html \
  contrib/mom/momdoc/images.html \
  contrib/mom/momdoc/inlines.html \
  contrib/mom/momdoc/intro.html \
  contrib/mom/momdoc/letters.html \
  contrib/mom/momdoc/macrolist.html \
  contrib/mom/momdoc/rectoverso.html \
  contrib/mom/momdoc/refer.html \
  contrib/mom/momdoc/reserved.html \
  contrib/mom/momdoc/tables-of-contents.html \
  contrib/mom/momdoc/toc.html \
  contrib/mom/momdoc/typesetting.html \
  contrib/mom/momdoc/using.html \
  contrib/mom/momdoc/version-2.html
momhtmldir = $(htmldocdir)/mom
momhtml_DATA = $(MOMHTMLDOCFILES)

# Files installed in $(examplesdir)/mom.  MOMEXAMPLEFILES are located
# in the source tree, while MOMPROCESSEDEXAMPLEFILES are generated in
# the build tree.
MOMEXAMPLEFILES=\
  contrib/mom/examples/letter.mom \
  contrib/mom/examples/mom-pdf.mom \
  contrib/mom/examples/mon_premier_doc.mom \
  contrib/mom/examples/sample_docs.mom \
  contrib/mom/examples/typesetting.mom \
  contrib/mom/examples/README.txt \
  contrib/mom/examples/README-fr.txt \
  contrib/mom/examples/elvis_syntax \
  contrib/mom/examples/elvis_syntax.new \
  contrib/mom/examples/penguin.ps \
  contrib/mom/examples/penguin.pdf \
  contrib/mom/examples/mom.vim \
  contrib/mom/examples/slide-demo.mom \
  contrib/mom/examples/copyright-default.mom \
  contrib/mom/examples/copyright-chapter.mom
momexampledir = $(exampledir)/mom
dist_momexample_DATA = $(MOMEXAMPLEFILES)

if USE_GROPDF
MOMPROCESSEDEXAMPLEFILES = \
  contrib/mom/examples/letter.pdf \
  contrib/mom/examples/mom-pdf.pdf \
  contrib/mom/examples/mon_premier_doc.pdf \
  contrib/mom/examples/sample_docs.pdf \
  contrib/mom/examples/slide-demo.pdf \
  contrib/mom/examples/copyright-default.pdf \
  contrib/mom/examples/copyright-chapter.pdf
if HAVE_URW_FONTS
MOMPROCESSEDEXAMPLEFILES += contrib/mom/examples/typesetting.pdf
endif
momprocessedexampledir = $(exampledir)/mom
nodist_momprocessedexample_DATA = $(MOMPROCESSEDEXAMPLEFILES)
endif

mom_test_template = contrib/mom/examples/test-mom.sh.in

# Small test suite on mom examples
mom_TESTS = contrib/mom/examples/tests-mom.sh
TESTS += $(mom_TESTS)
contrib/mom/examples/tests-mom.sh: \
  $(top_builddir)/config.status \
  $(MOMPROCESSEDEXAMPLEFILES) \
  $(top_srcdir)/$(mom_test_template)
	$(AM_V_GEN)sed \
	  -e "s|[@]abs_top_builddir[@]|$(abs_top_builddir)|g" \
	  -e "s|[@]groff_have_urw_fonts[@]|$(groff_have_urw_fonts)|g" \
	  $(top_srcdir)/$(mom_test_template) > $@ \
	&& chmod +x $@
MOSTLYCLEANFILES += $(mom_TESTS)
EXTRA_DIST += $(mom_test_template)

# For this list of files we add a symlink from $(exampledir)/mom to $(pdfdocdir)
PDFDOCFILE = mom-pdf.pdf

EXTRA_DIST += $(MOMHTMLDOCFILES) $(MOMEXAMPLEFILES) \
  contrib/mom/BUGS \
  contrib/mom/ChangeLog \
  contrib/mom/NEWS \
  contrib/mom/TODO \
  contrib/mom/copyright \
  contrib/mom/groff_mom.7.man

MOSTLYCLEANFILES += \
  $(MOMPROCESSEDEXAMPLEFILES) \
  penguin.ps \
  penguin.pdf

# rule to generate .pdf files from .mom files
SUFFIXES += .mom .pdf
.mom.pdf:
	$(GROFF_V)$(MKDIR_P) `dirname $@` \
	&& LC_ALL=C $(MOMPDFMOM) $< >$@

$(MOMPROCESSEDEXAMPLEFILES): $(MOMNORMALFILES) \
  groff troff gropdf pdfmom penguin.ps penguin.pdf font/devpdf/stamp

penguin.ps:
	$(AM_V_at)cp $(mom_srcdir)/examples/penguin.ps $@
penguin.pdf:
	$(AM_V_at)cp $(mom_srcdir)/examples/penguin.pdf $@

install-data-hook: install_mom
install_mom:
if USE_GROPDF
	for f in $(PDFDOCFILE); do \
	  $(RM) $(DESTDIR)$(pdfdocdir)/$$f; \
	  ln -s $(exampledir)/mom/$$f $(DESTDIR)$(pdfdocdir)/$$f; \
	done
endif

uninstall_groffdirs: uninstall_mom
uninstall_mom:
	for f in $(PDFDOCFILE); do \
	  $(RM) $(DESTDIR)$(pdfdocdir)/$$f; \
	done
	-rmdir $(DESTDIR)$(pdfdocdir)
	if test -d $(DESTDIR)$(exampledir)/mom; then \
	  rmdir $(DESTDIR)$(exampledir)/mom; \
	fi
	if test -d $(DESTDIR)$(htmldocdir)/mom; then \
	  rmdir $(DESTDIR)$(htmldocdir)/mom; \
	fi


# Local Variables:
# fill-column: 72
# mode: makefile-automake
# End:
# vim: set autoindent filetype=automake textwidth=72: