Imported Upstream version 1.22.4
[platform/upstream/groff.git] / contrib / hdtbl / hdtbl.am
1 # Copyright (C) 2006-2018 Free Software Foundation, Inc.
2 #      Written by Werner Lemberg (wl@gnu.org)
3 #      Automake migration by Bertrand Garrigues
4 #
5 #
6 # This file is part of groff.
7 #
8 # groff is free software; you can redistribute it and/or modify it under
9 # the terms of the GNU General Public License as published by the Free
10 # Software Foundation, either version 3 of the License, or
11 # (at your option) any later version.
12 #
13 # groff is distributed in the hope that it will be useful, but WITHOUT ANY
14 # WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
16 # for more details.
17 #
18 # You should have received a copy of the GNU General Public License
19 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
21 hdtbl_srcdir = $(top_srcdir)/contrib/hdtbl
22 hdtbl_builddir = $(top_builddir)/contrib/hdtbl
23
24 man7_MANS += contrib/hdtbl/groff_hdtbl.7
25
26 # Groff command used to generate .ps files
27 HDTBL_TFLAG = -M$(hdtbl_srcdir) -M$(hdtbl_builddir)
28 HDTBL_PFLAG=-t -p -e -U
29 HDTBLGROFF = \
30   GROFF_COMMAND_PREFIX= \
31   GROFF_BIN_PATH="$(GROFF_BIN_PATH)" \
32   $(GROFFBIN) $(FFLAG) $(TFLAG) $(HDTBL_TFLAG) $(HDTBL_PFLAG)
33
34 # Files installed in $(tmacdir).
35 # These files are generated with 'strip.sed' from their unstripped source file
36 # equivalent (e.g. hdtbl.tmac is generated from hdtbl.tmac-u)
37 HDTBLSTRIPFILES = \
38   contrib/hdtbl/hdtbl.tmac \
39   contrib/hdtbl/hdmisc.tmac
40 hdtbltmacdir = $(tmacdir)
41 hdtbltmac_DATA = $(HDTBLSTRIPFILES)
42
43 # Files installed in $(exampledir)/hdtbl.  HDTBLEXAMPLEFILES are
44 # located in the source tree, while HDTBLPROCESSEDEXAMPLEFILES are
45 # generated in the build tree.
46
47 # These files are handled by the '.in.roff' rule.
48 HDTBLGENFILES = \
49   contrib/hdtbl/examples/fonts_n.roff \
50   contrib/hdtbl/examples/fonts_x.roff
51 EXTRA_DIST += \
52   contrib/hdtbl/examples/fonts_n.in \
53   contrib/hdtbl/examples/fonts_x.in \
54   contrib/hdtbl/examples/test-hdtbl.sh.in
55
56 HDTBLEXAMPLEFILES = \
57   contrib/hdtbl/examples/common.roff \
58   contrib/hdtbl/examples/chess_board.roff \
59   contrib/hdtbl/examples/color_boxes.roff \
60   contrib/hdtbl/examples/color_nested_tables.roff \
61   contrib/hdtbl/examples/color_table_cells.roff \
62   contrib/hdtbl/examples/color_transitions.roff \
63   contrib/hdtbl/examples/col_rowspan_colors.roff \
64   contrib/hdtbl/examples/mixed_pickles.roff \
65   contrib/hdtbl/examples/rainbow.roff \
66   contrib/hdtbl/examples/short_reference.roff
67
68 HDTBLPROCESSEDEXAMPLEFILES = \
69   contrib/hdtbl/examples/chess_board.ps \
70   contrib/hdtbl/examples/color_boxes.ps \
71   contrib/hdtbl/examples/color_nested_tables.ps \
72   contrib/hdtbl/examples/color_table_cells.ps \
73   contrib/hdtbl/examples/color_transitions.ps \
74   contrib/hdtbl/examples/col_rowspan_colors.ps \
75   contrib/hdtbl/examples/fonts_n.ps \
76   contrib/hdtbl/examples/fonts_x.ps \
77   contrib/hdtbl/examples/mixed_pickles.ps \
78   contrib/hdtbl/examples/rainbow.ps \
79   contrib/hdtbl/examples/short_reference.ps
80
81 hdtblexampledir = $(exampledir)/hdtbl
82
83 if BUILD_EXAMPLES
84 dist_hdtblexample_DATA = $(HDTBLEXAMPLEFILES)
85 nodist_hdtblexample_DATA = \
86   $(HDTBLGENFILES) \
87   $(HDTBLPROCESSEDEXAMPLEFILES) \
88   gnu.eps
89 else
90 EXTRA_DIST += $(HDTBLEXAMPLEFILES) 
91 endif
92 $(hdtblexample_DATA): $(HDTBLSTRIPFILES)
93
94 MOSTLYCLEANFILES += $(HDTBLGENFILES) $(HDTBLPROCESSEDEXAMPLEFILES) \
95   $(HDTBLSTRIPFILES)
96
97 EXTRA_DIST += \
98   contrib/hdtbl/ChangeLog \
99   contrib/hdtbl/TODO \
100   contrib/hdtbl/groff_hdtbl.7.man \
101   contrib/hdtbl/hdtbl.tmac-u \
102   contrib/hdtbl/hdmisc.tmac-u
103
104 if BUILD_EXAMPLES
105 hdtbl_TESTS = contrib/hdtbl/examples/test-hdtbl.sh
106 TESTS += $(hdtbl_TESTS)
107 contrib/hdtbl/examples/test-hdtbl.sh: $(top_builddir)/config.status \
108         $(HDTBLPROCESSEDEXAMPLEFILES) $(top_srcdir)/contrib/hdtbl/examples/test-hdtbl.sh.in
109         sed -e "s|[@]abs_top_builddir[@]|$(abs_top_builddir)|g" \
110             -e "s|[@]GHOSTSCRIPT[@]|$(GHOSTSCRIPT)|g" \
111                 $(top_srcdir)/contrib/hdtbl/examples/test-hdtbl.sh.in > $@
112         chmod +x $@
113 MOSTLYCLEANFILES += $(hdtbl_TESTS)
114 endif
115
116 # Rule to generate ps and roff files
117 SUFFIXES += .roff .in .ps
118
119 .roff.ps:
120         $(GROFF_V)$(MKDIR_P) `dirname $@` \
121         && $(HDTBLGROFF) -Tps \
122              -dfontpath=$(top_srcdir)/font \
123              -dsopath=$(hdtbl_srcdir)/ \
124              -mhdtbl $< >$@
125 .in.roff:
126         $(AM_V_GEN)$(MKDIR_P) `dirname $@` \
127         && sed -e "s|[@]fontdir[@]|$(fontdir)|" \
128                -e "s|[@]EGREP[@]|$(EGREP)|" $< >$@
129
130
131 $(HDTBLPROCESSEDEXAMPLEFILES): gnu.eps groff troff pic tbl \
132   contrib/hdtbl/examples/common.roff
133
134 $(HDTBLSTRIPFILES): $(top_srcdir)/tmac/strip.sed
135         @$(MKDIR_P) `dirname $@`
136         sed -f $(top_srcdir)/tmac/strip.sed $(hdtbl_srcdir)/`basename $@`-u > $@;
137
138 uninstall_groffdirs: uninstall-hdtbl-hook
139 uninstall-hdtbl-hook:
140         if test -d $(DESTDIR)$(hdtblexampledir); then \
141           rmdir $(DESTDIR)$(hdtblexampledir); \
142         fi
143
144
145 ########################################################################
146 # Editor settings
147 ########################################################################
148 #
149 # Local Variables:
150 # mode: makefile-automake
151 # fill-column: 72
152 # End:
153 # vim: set filetype=automake textwidth=72: