summaryrefslogtreecommitdiff
path: root/contrib/hdtbl/hdtbl.am
blob: a37da14542f2d9b114a31415bd081ecae9b27c89 (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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
# Copyright (C) 2006-2015 Free Software Foundation, Inc.
#      Written by Werner Lemberg (wl@gnu.org)
#      Automake migration by Bertrand Garrigues
#
# Last update: 22 Aug 2015
#
# 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/>.

hdtbl_srcdir = $(top_srcdir)/contrib/hdtbl
hdtbl_builddir = $(top_builddir)/contrib/hdtbl

man7_MANS += contrib/hdtbl/groff_hdtbl.7

# Groff command used to generate .ps files
HDTBL_TFLAG = -M$(hdtbl_srcdir) -M$(hdtbl_builddir)
HDTLB_PFLAG=-t -p -e -U
HDTBLGROFF = \
  GROFF_COMMAND_PREFIX= \
  GROFF_BIN_PATH="$(GROFF_BIN_PATH)" \
  $(GROFFBIN) $(FFLAG) $(TFLAG) $(HDTBL_TFLAG) $(HDTLB_PFLAG)

# Files installed in $(tmacdir).
# These files are generated with `strip.sed' from their unstripped source file 
# equivalent (e.g. hdtbl.tmac is generated from hdtbl.tmac-u)
HDTBLSTRIPFILES = \
  contrib/hdtbl/hdtbl.tmac \
  contrib/hdtbl/hdmisc.tmac
hdtbltmacdir = $(tmacdir)
hdtbltmac_DATA = $(HDTBLSTRIPFILES)

# Files installed in $(exampledir)/hdtbl.  HDTBLEXAMPLEFILES are
# located in the source tree, while HDTBLPROCESSEDEXAMPLEFILES are
# generated in the build tree.

# These files are handled by the `.in.roff' rule.
HDTBLGENFILES = \
  contrib/hdtbl/examples/fonts_n.roff \
  contrib/hdtbl/examples/fonts_x.roff
EXTRA_DIST += \
  contrib/hdtbl/examples/fonts_n.in \
  contrib/hdtbl/examples/fonts_x.in

HDTBLEXAMPLEFILES = \
  contrib/hdtbl/examples/common.roff \
  contrib/hdtbl/examples/chess_board.roff \
  contrib/hdtbl/examples/color_boxes.roff \
  contrib/hdtbl/examples/color_nested_tables.roff \
  contrib/hdtbl/examples/color_table_cells.roff \
  contrib/hdtbl/examples/color_transitions.roff \
  contrib/hdtbl/examples/col_rowspan_colors.roff \
  contrib/hdtbl/examples/mixed_pickles.roff \
  contrib/hdtbl/examples/rainbow.roff \
  contrib/hdtbl/examples/short_reference.roff

HDTBLPROCESSEDEXAMPLEFILES = \
  contrib/hdtbl/examples/chess_board.ps \
  contrib/hdtbl/examples/color_boxes.ps \
  contrib/hdtbl/examples/color_nested_tables.ps \
  contrib/hdtbl/examples/color_table_cells.ps \
  contrib/hdtbl/examples/color_transitions.ps \
  contrib/hdtbl/examples/col_rowspan_colors.ps \
  contrib/hdtbl/examples/fonts_n.ps \
  contrib/hdtbl/examples/fonts_x.ps \
  contrib/hdtbl/examples/mixed_pickles.ps \
  contrib/hdtbl/examples/rainbow.ps \
  contrib/hdtbl/examples/short_reference.ps

hdtblexampledir = $(exampledir)/hdtbl

if BUILD_EXAMPLES
dist_hdtblexample_DATA = $(HDTBLEXAMPLEFILES)
nodist_hdtblexample_DATA = \
  $(HDTBLGENFILES) \
  $(HDTBLPROCESSEDEXAMPLEFILES) \
  gnu.eps
else
EXTRA_DIST += $(HDTBLEXAMPLEFILES) 
endif
$(hdtblexample_DATA): $(HDTBLSTRIPFILES)

MOSTLYCLEANFILES += $(HDTBLGENFILES) $(HDTBLPROCESSEDEXAMPLEFILES) \
  hdmisc.tmac-s hdtbl.tmac-s $(HDTBLSTRIPFILES)

EXTRA_DIST += \
  contrib/hdtbl/ChangeLog \
  contrib/hdtbl/TODO \
  contrib/hdtbl/groff_hdtbl.7.man \
  contrib/hdtbl/hdtbl.tmac-u \
  contrib/hdtbl/hdmisc.tmac-u

# Rule to generate ps and roff files
SUFFIXES += .roff .in .ps

.roff.ps:
	@$(MKDIR_P) `dirname $@`
	$(HDTBLGROFF) -Tps -dfontpath=$(top_srcdir)/font -dsopath=$(hdtbl_srcdir)/ \
	         -mhdtbl $< >$@
.in.roff:
	@$(MKDIR_P) `dirname $@`
	sed -e "s|[@]fontdir[@]|$(fontdir)|" \
	    -e "s|[@]EGREP[@]|$(EGREP)|" $< >$@


$(HDTBLPROCESSEDEXAMPLEFILES): gnu.eps groff troff pic tbl \
  contrib/hdtbl/examples/common.roff

$(HDTBLSTRIPFILES): $(top_srcdir)/tmac/strip.sed
	@$(MKDIR_P) `dirname $@`
	sed -f $(top_srcdir)/tmac/strip.sed $(hdtbl_srcdir)/`basename $@`-u > $@;

uninstall_groffdirs: uninstall-hdtbl-hook
uninstall-hdtbl-hook:
	if test -d $(DESTDIR)$(hdtblexampledir); then \
	  rmdir $(DESTDIR)$(hdtblexampledir); \
	fi


########################################################################
### Emacs settings
# Local Variables:
# mode: makefile-automake
# End: