summaryrefslogtreecommitdiffstats
path: root/manual/Makefile.am
blob: 783ab2aac7abdcd72e1e19ab18470658a7a2e59d (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
## Process this file with automake to produce Makefile.in
##
## Copyright (C) 1995 Graeme Wilford.
## Copyright (C) 2001, 2007 Colin Watson.
##
## This file is part of man-db.
##
## man-db 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 of the License, or
## (at your option) any later version.
##
## man-db 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 man-db; if not, write to the Free Software Foundation,
## Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA

ME_FILES = \
	comp.me \
	db.me \
	files.me \
	format.me \
	glossary.me \
	intro.me \
	leader.me \
	man_db.me \
	misc.me \
	sec.me

MANUAL = man_db
MANUAL_INSTALL = man-db-manual

dist_noinst_DATA = \
	README \
	$(ME_FILES) \
	options-only.me \
	print-options
noinst_DATA = \
	$(MANUAL).cat \
	$(MANUAL).ps

CLEANFILES = \
	$(noinst_DATA) \
	$(MANUAL).dvi \
	$(MANUAL).html \
	$(MANUAL).pp \
	$(MANUAL).tdvi \
	$(MANUAL).tps \
	version

SOELIM = soelim

version: $(top_srcdir)/configure.ac
	echo '.ds V $(roff_version)' > $@

$(MANUAL).pp: $(ME_FILES) version
	$(SOELIM) -I$(srcdir) man_db.me | tbl > $@

.pp.dvi:
	$(TROFF) -me -Tdvi $< > $@

.pp.ps:
	$(TROFF) -me -Tps $< > $@

.pp.tdvi:
	$(TROFF) -me -Tdvi $< | grodvi -d > $@

.tdvi.tps:
	dvips -f -t a4 $< > $@

.pp.cat:
	LC_ALL=C nroff -me $< > $@

.pp.html:
	$(TROFF) -me -Thtml -P-I$* $< > $@

# Automake defines these targets already, so we need to use -local.
dvi-local: $(MANUAL).dvi
ps-local: $(MANUAL).ps
html-local: $(MANUAL).html

# These are all ours.
cat: $(MANUAL).cat
tps: $(MANUAL).tps

clean-local:
	-rm -f $(MANUAL)-*.png

install-data-hook:
	test -z "$(docdir)" || $(MKDIR_P) "$(DESTDIR)$(docdir)"
	@if test -f $(MANUAL).cat; then \
		echo " $(INSTALL_DATA) $(MANUAL).cat '$(DESTDIR)$(docdir)/$(MANUAL_INSTALL).txt'"; \
		$(INSTALL_DATA) $(MANUAL).cat "$(DESTDIR)$(docdir)/$(MANUAL_INSTALL).txt" || exit $$?; \
	fi
	@if test -f $(MANUAL).ps; then \
		echo " $(INSTALL_DATA) $(MANUAL).ps '$(DESTDIR)$(docdir)/$(MANUAL_INSTALL).ps'"; \
		$(INSTALL_DATA) $(MANUAL).ps "$(DESTDIR)$(docdir)/$(MANUAL_INSTALL).ps" || exit $$?; \
	fi

uninstall-hook:
	rm -rf "$(DESTDIR)$(docdir)"