1 # Automake rules for 'groffer'
3 # File position: <groff-source>/contrib/groffer/groffer.am
5 # Copyright (C) 2001-2018 Free Software Foundation, Inc.
6 # Written by Werner Lemberg <wl@gnu.org> and
7 # Bernd Warken <groff-bernd.warken-72@web.de>.
8 # Automake migration by Bertrand Garrigues
10 # Last update: 22 Aug 2015
12 # This file is part of 'groffer' which is part of 'groff'.
14 # 'groff' is free software; you can redistribute it and/or modify it
15 # under the terms of the GNU General Public License as published by
16 # the Free Software Foundation, either version 2 of the License, or
17 # (at your option) any later version.
19 # 'groff' is distributed in the hope that it will be useful, but
20 # WITHOUT ANY WARRANTY; without even the implied warranty of
21 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22 # General Public License for more details.
24 # You should have received a copy of the GNU General Public License
25 # along with this program. If not, see
26 # <http://www.gnu.org/licenses/gpl-2.0.html>.
28 ########################################################################
30 groffer_srcdir = $(top_srcdir)/contrib/groffer
40 # Generated man templates
42 contrib/groffer/roff2dvi.1.man \
43 contrib/groffer/roff2html.1.man \
44 contrib/groffer/roff2pdf.1.man \
45 contrib/groffer/roff2ps.1.man \
46 contrib/groffer/roff2text.1.man \
47 contrib/groffer/roff2x.1.man
50 contrib/groffer/main_subs.pl \
51 contrib/groffer/man.pl \
52 contrib/groffer/split_env.sh \
53 contrib/groffer/subs.pl
56 contrib/groffer/roff2.1.man \
57 contrib/groffer/version.sh \
58 contrib/groffer/groffer.1.man \
59 contrib/groffer/groffer.pl \
60 contrib/groffer/roff2.pl
62 EXTRA_DIST += $(GROFFER_PERL) $(GROFFER_REST) \
63 contrib/groffer/ChangeLog \
64 contrib/groffer/README \
65 contrib/groffer/README_PERL
67 # groffer_dir is set by a m4 macro
68 grofferdir = $(groffer_dir)
69 bin_SCRIPTS += groffer $(ROFF2PROGS)
70 groffer_DATA = $(GROFFER_PERL) contrib/groffer/version.sh
72 contrib/groffer/groffer.1 \
73 contrib/groffer/roff2dvi.1 \
74 contrib/groffer/roff2html.1 \
75 contrib/groffer/roff2pdf.1 \
76 contrib/groffer/roff2ps.1 \
77 contrib/groffer/roff2text.1 \
78 contrib/groffer/roff2x.1
79 MOSTLYCLEANFILES += $(ROFF2MAN)
81 $(ROFF2PROGS): $(groffer_srcdir)/roff2.pl
82 cp $(groffer_srcdir)/roff2.pl $@
84 # we take roff2.man and replace the @ROFF2MODE@ by the type of file
85 # (dvi, pdf, html etc ...)
86 $(ROFF2MAN): $(groffer_srcdir)/roff2.1.man
87 $(AM_V_GEN)$(MKDIR_P) contrib/groffer \
88 && FILEMODE=`echo $@ | sed 's|contrib/groffer/roff2\([a-z][a-z]*\)\.1\.man|\1|g'` \
89 && sed -e 's/[@]ROFF2MODE[@]/'"$$FILEMODE"'/g' \
90 $(groffer_srcdir)/roff2.1.man \
93 groffer: $(GROFFER_PERL) $(GROFFER_REST) $(SH_DEPS_SED_SCRIPT)
94 $(AM_V_GEN)sed -f "$(SH_DEPS_SED_SCRIPT)" \
95 -e "s|[@]g[@]|$(g)|g" \
96 -e "s|[@]BINDIR[@]|$(DESTDIR)$(bindir)|g" \
97 -e "s|[@]libdir[@]|$(DESTDIR)$(libdir)|g" \
98 -e "s|[@]groffer_dir[@]|$(DESTDIR)$(groffer_dir)|g" \
99 -e "s|[@]VERSION[@]|$(VERSION)|g" \
100 -e "$(SH_SCRIPT_SED_CMD)" \
101 $(groffer_srcdir)/groffer.pl \
105 uninstall_groffdirs: uninstall-groffer-hook
106 uninstall-groffer-hook:
107 if test -d $(DESTDIR)$(grofferdir); then \
108 rmdir $(DESTDIR)$(grofferdir); \
112 ########################################################################
114 ########################################################################
117 # mode: makefile-automake
120 # vim: set filetype=automake textwidth=72: