Imported Upstream version 1.22.4
[platform/upstream/groff.git] / contrib / pdfmark / pdfmark.am
1 # Copyright (C) 2005-2018 Free Software Foundation, Inc.
2 #      Written by Keith Marshall (keith.d.marshall@ntlworld.com)
3 #      Automake migration by Bertrand Garrigues
4 #
5 # Last update: 22 Aug 2015
6 #
7 # This file is part of groff.
8 #
9 # groff is free software; you can redistribute it and/or modify it under
10 # the terms of the GNU General Public License as published by the Free
11 # Software Foundation, either version 3 of the License, or
12 # (at your option) any later version.
13 #
14 # groff is distributed in the hope that it will be useful, but WITHOUT ANY
15 # WARRANTY; without even the implied warranty of MERCHANTABILITY or
16 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
17 # for more details.
18 #
19 # You should have received a copy of the GNU General Public License
20 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
21
22 pdfmark_srcdir = $(top_srcdir)/contrib/pdfmark
23 pdfmark_builddir = $(top_builddir)/contrib/pdfmark
24
25 man1_MANS += contrib/pdfmark/pdfroff.1
26
27 bin_SCRIPTS += pdfroff
28
29 # Files installed in $(tmacdir)
30 TMACFILES = \
31   contrib/pdfmark/pdfmark.tmac \
32   contrib/pdfmark/spdf.tmac
33 pdfmarktmacdir = $(tmacdir)
34 dist_pdfmarktmac_DATA = $(TMACFILES)
35
36 # Files installed in $(pdfdocdir)
37 PDFDOCFILES = \
38   contrib/pdfmark/pdfmark.pdf
39 if BUILD_PDFDOC
40 pdfmarkpdfdocdir = $(pdfdocdir)
41 nodist_pdfmarkpdfdoc_DATA = $(PDFDOCFILES)
42 MOSTLYCLEANFILES += $(PDFDOCFILES)
43 else
44 EXTRA_DIST += $(PDFDOCFILES)
45 endif
46
47 EXTRA_DIST += \
48   contrib/pdfmark/cover.ms \
49   contrib/pdfmark/pdfmark.ms \
50   contrib/pdfmark/ChangeLog \
51   contrib/pdfmark/README \
52   contrib/pdfmark/PROBLEMS \
53   contrib/pdfmark/TODO \
54   contrib/pdfmark/pdfroff.1.man \
55   contrib/pdfmark/pdfroff.sh
56
57 PDFMARK_PFLAG =-dpaper=$(PAGE) -P-p$(PAGE)
58 PDFMARK_TFLAG = -M$(pdfmark_srcdir)
59 PDFROFF=\
60   GROFF_TMPDIR=. \
61   GROFF_COMMAND_PREFIX= \
62   GROFF_BIN_DIR="$(GROFF_BIN_DIR)" \
63   GROFF_BIN_PATH="$(GROFF_BIN_PATH)" \
64   ./pdfroff --keep-temporary-files \
65   $(FFLAG) $(TFLAG) $(PDFMARK_TFLAG) $(PDFMARK_PFLAG)
66
67 contrib/pdfmark/pdfmark.pdf: contrib/pdfmark/pdfmark.ms
68         $(GROFF_V)$(MKDIR_P) `dirname $@` \
69         && $(PDFROFF) -mspdf --stylesheet=$(pdfmark_srcdir)/cover.ms \
70              $(top_srcdir)/contrib/pdfmark/pdfmark.ms >$@
71
72 # The pdf files use the local script to generate.
73 $(PDFDOCFILES): pdfroff groff troff gropdf 
74 $(PDFDOCFILES): $(dist_devpsfont_DATA) $(nodist_devpsfont_DATA) gnu.eps
75
76 pdfroff: contrib/pdfmark/pdfroff.sh $(SH_DEPS_SED_SCRIPT)
77         $(AM_V_GEN)sed -f $(SH_DEPS_SED_SCRIPT) \
78             -e "s|[@]VERSION[@]|$(VERSION)|" \
79             -e "s|[@]GROFF_AWK_INTERPRETERS[@]|$(ALT_AWK_PROGS)|" \
80             -e "s|[@]GROFF_GHOSTSCRIPT_INTERPRETERS[@]|$(ALT_GHOSTSCRIPT_PROGS)|" \
81             -e "s|[@]GROFF_BIN_DIR[@]|$(bindir)|" $(pdfmark_srcdir)/pdfroff.sh \
82             >$@ \
83         && chmod +x $@
84
85 mostlyclean-local: mostlyclean_pdfmark
86 mostlyclean_pdfmark:
87         rm -rf $(top_builddir)/pdfroff-*
88
89 uninstall_groffdirs: uninstall-pdfmark-hook
90 uninstall-pdfmark-hook:
91 if BUILD_PDFDOC
92         if test -d $(DESTDIR)$(pdfmarkpdfdocdir); then \
93           rmdir $(DESTDIR)$(pdfmarkpdfdocdir); \
94         fi
95 endif
96
97
98 ########################################################################
99 # Editor settings
100 ########################################################################
101 #
102 # Local Variables:
103 # mode: makefile-automake
104 # fill-column: 72
105 # End:
106 # vim: set filetype=automake textwidth=72: