summaryrefslogtreecommitdiff
path: root/contrib/hdtbl/Makefile.sub
blob: 05c3b8abc71f12fa767e2ce8f4584c4606204a20 (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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
# Copyright (C) 2006 Free Software Foundation, Inc.
#      Written by Werner Lemberg (wl@gnu.org)
# 
# 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 2, 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 groff; see the file COPYING.  If not, write to the Free Software
# Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA.

# These may be overridden if cross-compiling.
GROFFBIN=$(top_builddir)/src/roff/groff/groff
GROFF_BIN_PATH=`echo $(groff_bin_dirs) | sed -e 's|  *|$(SH_SEP)|g'`

groff_bin_dirs=\
  $(top_builddir)/src/roff/groff \
  $(top_builddir)/src/roff/troff \
  $(top_builddir)/src/preproc/eqn \
  $(top_builddir)/src/preproc/pic \
  $(top_builddir)/src/preproc/tbl \
  $(top_builddir)/src/devices/grops

FFLAG=-F$(top_builddir)/font -F$(top_srcdir)/font
TFLAG=-M$(top_builddir)/tmac -M$(top_srcdir)/tmac -M$(srcdir)
PFLAG=-t -p -e -U

GROFF=GROFF_COMMAND_PREFIX=''; \
      export GROFF_COMMAND_PREFIX; \
      GROFF_BIN_PATH=$(GROFF_BIN_PATH); \
      export GROFF_BIN_PATH; \
      $(GROFFBIN) $(FFLAG) $(TFLAG) $(PFLAG)

MAN7=\
  groff_hdtbl.n

# These files are processed with `strip.sed'.
STRIPFILES=\
  hdtbl.tmac \
  hdmisc.tmac

# These files are handled by the `.in.roff' rule.
GENFILES=\
  examples/fonts_n.roff \
  examples/fonts_x.roff

EXAMPLEFILES=\
  examples/chess_board.roff \
  examples/colored_boxes.roff \
  examples/colored_nested_tables.roff \
  examples/colored_table_cells.roff \
  examples/color_transitions.roff \
  examples/col_rowspan_colors.roff \
  examples/mixed_pickles.roff \
  examples/rainbow.roff \
  examples/short_reference.roff

PROCESSEDEXAMPLEFILES=\
  examples/chess_board.ps \
  examples/colored_boxes.ps \
  examples/colored_nested_tables.ps \
  examples/colored_table_cells.ps \
  examples/color_transitions.ps \
  examples/col_rowspan_colors.ps \
  examples/fonts_n.ps \
  examples/fonts_x.ps \
  examples/mixed_pickles.ps \
  examples/rainbow.ps \
  examples/short_reference.ps

EXAMPLEFILES_=`echo $(EXAMPLEFILES) | sed 's|examples/||g'`
GENFILES_=`echo $(GENFILES) | sed 's|examples/||g'`
PROCESSEDEXAMPLEFILES_=`echo $(PROCESSEDEXAMPLEFILES) | sed 's|examples/||g'`

CLEANADD=\
  gnu.eps \
  $(PROCESSEDEXAMPLEFILES) \
  $(GENFILES) \
  examples/stamp \
  stamp-strip

.SUFFIXES: .roff .in .ps

.roff.ps:
	$(GROFF) -Tps -dfontpath=$(top_srcdir)/font -mhdtbl $< >$@

.in.roff:
	sed -e "s|@fontdir@|$(fontdir)|" $< >$@


all: $(PROCESSEDEXAMPLEFILES) stamp-strip

$(PROCESSEDEXAMPLEFILES): gnu.eps examples/stamp

gnu.eps:
	if test -f $(top_srcdir)/doc/gnu.eps; then \
	  cp $(top_srcdir)/doc/gnu.eps . ; \
	elif test -f $(top_builddir)/doc/gnu.eps; then \
	  cp $(top_builddir)/doc/gnu.eps . ; \
	else \
	  xpmtoppm $(top_srcdir)/doc/gnu.xpm | pnmdepth 15 | \
	    $(pnmtops_nosetpage) -noturn -rle >$@ ; \
	fi

examples/stamp:
	test -d examples || $(mkinstalldirs) examples
	touch $@

stamp-strip: $(STRIPFILES)
	for f in $(STRIPFILES); do \
	  rm -f $$f-s; \
	  sed -f $(top_srcdir)/tmac/strip.sed $(srcdir)/$$f >$$f-s; \
	done
	touch $@

install_data: $(STRIPFILES) $(EXAMPLEFILES) $(GENFILES) \
              $(PROCESSEDEXAMPLEFILES) stamp-strip
	-test -d $(DESTDIR)$(tmacdir) || $(mkinstalldirs) $(DESTDIR)$(tmacdir)
	for f in $(STRIPFILES); do \
	  rm -f $(DESTDIR)$(tmacdir)/$$f; \
	  $(INSTALL_DATA) $$f-s $(DESTDIR)$(tmacdir)/$$f; \
	done
	-test -d $(DESTDIR)$(exampledir)/hdtbl \
	  || $(mkinstalldirs) $(DESTDIR)$(exampledir)/hdtbl
	for f in $(EXAMPLEFILES_); do \
	  rm -f $(DESTDIR)$(exampledir)/hdtbl/$$f; \
	  $(INSTALL_DATA) $(srcdir)/examples/$$f \
	    $(DESTDIR)$(exampledir)/hdtbl/$$f; \
	done
	for f in $(PROCESSEDEXAMPLEFILES_) $(GENFILES_); do \
	  rm -f $(DESTDIR)$(exampledir)/hdtbl/$$f; \
	  $(INSTALL_DATA) examples/$$f $(DESTDIR)$(exampledir)/hdtbl/$$f; \
	done
	$(INSTALL_DATA) gnu.eps $(DESTDIR)$(exampledir)/hdtbl/gnu.eps

uninstall_sub:
	-for f in $(STRIPFILES); do \
	  rm -f $(DESTDIR)$(tmacdir)/$$f; \
	done
	-for f in $(EXAMPLEFILES_) $(PROCESSEDEXAMPLEFILES_) \
                  $(GENFILES_); do \
	  rm -f $(DESTDIR)$(exampledir)/hdtbl/$$f; \
	done
	-rmdir $(DESTDIR)$(exampledir)/hdtbl