summaryrefslogtreecommitdiffstats
path: root/contrib/mm/mm.am
blob: 191dbce44d546dd3f037c235ef6caf96f0ab1b8c (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
# Copyright 1991-2020 Free Software Foundation, Inc.
#
# 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/>.
#
# mm.am
#

mm_srcdir = $(top_srcdir)/contrib/mm
mm_builddir = $(top_builddir)/contrib/mm

bin_SCRIPTS += mmroff

man1_MANS += contrib/mm/mmroff.1
man7_MANS += \
  contrib/mm/groff_mm.7 \
  contrib/mm/groff_mmse.7

# Files installed in $(tmacdir)/mm
MMFILES = \
  contrib/mm/mm/0.MT \
  contrib/mm/mm/5.MT \
  contrib/mm/mm/4.MT \
  contrib/mm/mm/ms.cov \
  contrib/mm/mm/se_ms.cov
mmdir = $(tmacdir)/mm
dist_mm_DATA = $(MMFILES)

# Files installed in $(tmacdir)
tmacmmdir = $(tmacdir)
dist_tmacmm_DATA = contrib/mm/refer-mm.tmac

MMEXAMPLEFILES=\
  contrib/mm/examples/letter.mm

mmexampledir=$(exampledir)/mm
dist_mmexample_DATA = $(MMEXAMPLEFILES)

EXTRA_DIST += \
  contrib/mm/ChangeLog \
  contrib/mm/examples \
  contrib/mm/Makefile.sim \
  contrib/mm/mm \
  contrib/mm/NOTES \
  contrib/mm/README \
  contrib/mm/groff_mm.7.man \
  contrib/mm/groff_mmse.7.man \
  contrib/mm/mmroff.1.man \
  contrib/mm/mmroff.pl

mm_TESTS = \
  contrib/mm/tests/LT_SP_AU_without_AT_works.sh \
  contrib/mm/tests/LT_SP_multi-word_LO_SJ_works.sh \
  contrib/mm/tests/MT-1-reports-all-TM-numbers.sh \
  contrib/mm/tests/MT_5_includes_AT_in_SG.sh \
  contrib/mm/tests/P-indentation-works.sh \
  contrib/mm/tests/ms_cover_sheet_robust_to_missing_AF.sh \
  contrib/mm/tests/mse_has-sufficient-footnote-space.sh \
  contrib/mm/tests/place-equation-labels-correctly-in-displays.sh \
  contrib/mm/tests/remove-stale-bib-entry-data.sh \
  contrib/mm/tests/short-pages-do-not-overflow-stack.sh
TESTS += $(mm_TESTS)
EXTRA_DIST += \
  $(mm_TESTS) \
  contrib/mm/tests/artifacts/60657.ref

mmroff: $(mm_srcdir)/mmroff.pl
	$(AM_V_GEN)$(SED) \
	  -e 's;[@]PERL[@];$(PERL);' \
	  -e 's;[@]VERSION[@];$(VERSION);' \
	  $(mm_srcdir)/mmroff.pl \
	  >$@.tmp \
	  && chmod +x $@.tmp \
	  && mv $@.tmp $@

# special installation rules for m.tmac, mse.tmac, mmse.tmac, mm.tmac
install-data-local: install_mm
install_mm:
	-test -d $(DESTDIR)$(tmacdir) || $(mkinstalldirs) $(DESTDIR)$(tmacdir)
	-test -d $(DESTDIR)$(mmdir) || $(mkinstalldirs) $(DESTDIR)$(mmdir)
	$(RM) $(DESTDIR)$(tmacdir)/tmac.$(tmac_m_prefix)m
	$(RM) $(DESTDIR)$(tmacdir)/$(tmac_m_prefix)m.tmac
	$(INSTALL_DATA) $(mm_srcdir)/m.tmac \
	  $(DESTDIR)$(tmacdir)/$(tmac_m_prefix)m.tmac
	$(SED) -e "s;^.mso m.tmac;.mso $(tmac_m_prefix)m.tmac;g" \
	  $(mm_srcdir)/mse.tmac > $(DESTDIR)$(tmacdir)/$(tmac_m_prefix)mse.tmac
	@$(SED) -e "s;^.mso mse.tmac;.mso $(tmac_m_prefix)mse.tmac;g" \
	  $(mm_srcdir)/mmse.tmac > $(DESTDIR)$(tmacdir)/$(tmac_m_prefix)mmse.tmac
	@$(SED) -e "s;^.mso m.tmac;.mso $(tmac_m_prefix)m.tmac;g" \
	  $(mm_srcdir)/mm.tmac > $(DESTDIR)$(tmacdir)/$(tmac_m_prefix)mm.tmac
uninstall-local: uninstall_mm
uninstall_mm:
	if test -d $(DESTDIR)$(mmexampledir); then \
	  rmdir $(DESTDIR)$(mmexampledir); \
	fi
	$(RM) $(DESTDIR)$(tmacdir)/tmac.$(tmac_m_prefix)m
	$(RM) $(DESTDIR)$(tmacdir)/$(tmac_m_prefix)m.tmac
	$(RM) $(DESTDIR)$(tmacdir)/$(tmac_m_prefix)mm.tmac
	$(RM) $(DESTDIR)$(tmacdir)/$(tmac_m_prefix)mse.tmac
	$(RM) $(DESTDIR)$(tmacdir)/$(tmac_m_prefix)mmse.tmac
	-rmdir $(DESTDIR)$(tmacdir)/mm

# Special distribution rule: we copy all .tmac files from contrib/mm
dist-hook: dist_mm
dist_mm:
	chmod u+w $(distdir)/contrib/mm/
	for i in $(mm_srcdir)/*.tmac; do \
	  cp -f $$i $(distdir)/contrib/mm/; \
	done


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