summaryrefslogtreecommitdiffstats
path: root/contrib/pdfmark/pdfmark.am
blob: 15eec8c6796d445c4dc57777bbb9daa7ba266774 (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
# Copyright (C) 2005-2021 Free Software Foundation, Inc.
#      Written by Keith Marshall (keith.d.marshall@ntlworld.com)
#      Automake migration by Bertrand Garrigues
#
# 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/>.

pdfmark_srcdir = $(top_srcdir)/contrib/pdfmark
pdfmark_builddir = $(top_builddir)/contrib/pdfmark

man1_MANS += contrib/pdfmark/pdfroff.1

bin_SCRIPTS += pdfroff

# Files installed in $(tmacdir)
TMACFILES = \
  contrib/pdfmark/pdfmark.tmac \
  contrib/pdfmark/sanitize.tmac \
  contrib/pdfmark/spdf.tmac
pdfmarktmacdir = $(tmacdir)
dist_pdfmarktmac_DATA = $(TMACFILES)

# Files installed in $(pdfdocdir)
PDFDOCFILES = \
  contrib/pdfmark/pdfmark.pdf
if USE_PDFROFF
pdfmarkpdfdocdir = $(pdfdocdir)
nodist_pdfmarkpdfdoc_DATA = $(PDFDOCFILES)
MOSTLYCLEANFILES += $(PDFDOCFILES)
else
EXTRA_DIST += $(PDFDOCFILES)
endif

EXTRA_DIST += \
  contrib/pdfmark/cover.ms \
  contrib/pdfmark/pdfmark.ms \
  contrib/pdfmark/ChangeLog \
  contrib/pdfmark/README \
  contrib/pdfmark/PROBLEMS \
  contrib/pdfmark/TODO \
  contrib/pdfmark/pdfroff.1.man \
  contrib/pdfmark/pdfroff.sh

PDFROFF=\
  GROFF_TMPDIR=. \
  GROFF_COMMAND_PREFIX= \
  GROFF_BIN_DIR="$(GROFF_BIN_DIR)" \
  GROFF_BIN_PATH="$(GROFF_BIN_PATH)" \
  ./pdfroff \
  $(FFLAG) $(MFLAG) -dpaper=$(PAGE) -P-p$(PAGE) -M$(pdfmark_srcdir)

contrib/pdfmark/pdfmark.pdf: contrib/pdfmark/pdfmark.ms
	$(GROFF_V)$(MKDIR_P) `dirname $@` \
	&& $(PDFROFF) -I $(doc_builddir) -I $(doc_srcdir) -mspdf \
	  --stylesheet=$(pdfmark_srcdir)/cover.ms \
	  $(top_srcdir)/contrib/pdfmark/pdfmark.ms >$@

# The pdf files use the local script to generate.
$(PDFDOCFILES): pdfroff groff troff gropdf
$(PDFDOCFILES): $(dist_devpsfont_DATA) $(nodist_devpsfont_DATA) \
  $(DOC_GNU_EPS)

pdfroff: contrib/pdfmark/pdfroff.sh $(SH_DEPS_SED_SCRIPT)
	$(AM_V_GEN)sed -f $(SH_DEPS_SED_SCRIPT) \
	    -e "s|[@]VERSION[@]|$(VERSION)|" \
	    -e "s|[@]GROFF_AWK_INTERPRETERS[@]|$(ALT_AWK_PROGS)|" \
	    -e "s|[@]GROFF_GHOSTSCRIPT_INTERPRETERS[@]|$(ALT_GHOSTSCRIPT_PROGS)|" \
	    -e "s|[@]GROFF_BIN_DIR[@]|$(bindir)|" $(pdfmark_srcdir)/pdfroff.sh \
	    >$@ \
	&& chmod +x $@

mostlyclean-local: mostlyclean_pdfmark
mostlyclean_pdfmark:
	rm -rf $(top_builddir)/pdfroff-*

uninstall_groffdirs: uninstall-pdfmark-hook
uninstall-pdfmark-hook:
if USE_PDFROFF
	-rmdir $(DESTDIR)$(pdfmarkpdfdocdir)
endif


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