summaryrefslogtreecommitdiffstats
path: root/contrib/sboxes/sboxes.am
blob: 7786337d92844fb135ddd5b4ebd04a757507db9c (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
# Copyright (C) 2021 Free Software Foundation, Inc.
#      Written 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/>.

sboxes_srcdir = $(top_srcdir)/contrib/sboxes
sboxes_builddir = $(top_builddir)/contrib/sboxes
sboxesnotquine = $(sboxes_srcdir)/notquine.sed

sboxestmacdir = $(tmacdir)
dist_sboxestmac_DATA = contrib/sboxes/sboxes.tmac

EXTRA_DIST += \
    contrib/sboxes/ChangeLog \
    contrib/sboxes/msboxes.ms.in \
    contrib/sboxes/notquine.sed

SBOXES_EXAMPLEFILES = $(sboxes_srcdir)/msboxes.ms.in

sboxesotherdocdir = $(docdir)
nodist_sboxesotherdoc_DATA = $(sboxes_builddir)/msboxes.ms

if USE_GROPDF
sboxespdfdocdir = $(pdfdocdir)
nodist_sboxespdfdoc_DATA = $(sboxes_builddir)/msboxes.pdf
endif

MOSTLYCLEANFILES += msboxes.ms \
	$(nodist_sboxesotherdoc_DATA) \
	$(nodist_sboxespdfdoc_DATA)

# The ordering of the sed -e expressions is important.
$(sboxes_builddir)/msboxes.ms: $(SBOXES_EXAMPLEFILES) $(sboxesnotquine)
	$(AM_V_at)mkdir -p $(sboxes_builddir)
	$(AM_V_at)$(SED) -n -e '1,/REPLACEME/p' \
	    $(SBOXES_EXAMPLEFILES) > $@.tmp
	$(AM_V_at)$(SED) -f $(sboxesnotquine) \
	    $(SBOXES_EXAMPLEFILES) >> $@.tmp
	$(AM_V_at)$(SED) -n -e '/REPLACEME/,$$p' \
	    $(SBOXES_EXAMPLEFILES) >> $@.tmp
	$(AM_V_GEN)mv $@.tmp $@

$(sboxes_builddir)/msboxes.pdf: $(sboxes_builddir)/msboxes.ms \
  $(dist_sboxestmac_DATA) groff troff gropdf font/devpdf/stamp
	$(GROFF_V)$(DOC_GROFF) -M$(sboxes_srcdir) -ms -msboxes -Tpdf \
	  $(sboxes_builddir)/msboxes.ms > $@

uninstall_groffdirs: uninstall_sboxes
uninstall_sboxes:
	if test -d $(DESTDIR)$(exampledir)/sboxes; then \
	  rmdir $(DESTDIR)$(exampledir)/sboxes; \
	fi
if USE_GROPDF
	-rmdir $(DESTDIR)$(sboxespdfdocdir)
endif

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