summaryrefslogtreecommitdiff
path: root/doc/Makefile.am
blob: 5675d09be8ec1c294ed26bb617e60ca7994d3b7d (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
# Makefile for `wget' utility
# Copyright (C) 1995, 1996, 1997, 2007, 2008, 2009, 2010, 2011, 2015
# Free Software Foundation, Inc.

# This program 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.

# This program 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/>.

#
# Version: @VERSION@
#

# Program to convert DVI files to PostScript
DVIPS = dvips -D 300
# Program to convert texinfo files to html
TEXI2HTML = texi2html -expandinfo -split_chapter

manext     = 1
RM = rm -f

TEXI2POD     = $(srcdir)/texi2pod.pl
POD2MAN      = @POD2MAN@
MAN          = wget.$(manext)
WGETRC       = $(sysconfdir)/wgetrc
SAMPLERCTEXI = sample.wgetrc.munged_for_texi_inclusion

#
# Dependencies for building
#

man_MANS = $(MAN)

all: wget.info @COMMENT_IF_NO_POD2MAN@$(MAN)

everything: all wget_us.ps wget_a4.ps wget_toc.html

$(SAMPLERCTEXI): $(srcdir)/sample.wgetrc
	sed s/@/@@/g $? > $@

info_TEXINFOS = wget.texi
wget_TEXINFOS = fdl.texi sample.wgetrc.munged_for_texi_inclusion

EXTRA_DIST = sample.wgetrc \
	     $(SAMPLERCTEXI) \
	     texi2pod.pl

wget.pod: $(srcdir)/wget.texi version.texi
	$(TEXI2POD) -D VERSION="$(VERSION)" $(srcdir)/wget.texi $@

$(MAN): wget.pod
	$(POD2MAN) --center="GNU Wget" --release="GNU Wget @VERSION@" --utf8 $? > $@

#wget.cat: $(MAN)
#	nroff -man $? > $@

wget_us.ps: wget.dvi
	$(DVIPS) -t letter -o $@ wget.dvi

wget_a4.ps: wget.dvi
	$(DVIPS) -t a4 -o $@ wget.dvi

wget_toc.html: $(srcdir)/wget.texi
	$(TEXI2HTML) $(srcdir)/wget.texi

#
# Dependencies for installing
#

# install all the documentation
install-data-local: install.wgetrc @COMMENT_IF_NO_POD2MAN@install.man

# uninstall all the documentation
uninstall-local: @COMMENT_IF_NO_POD2MAN@uninstall.man


# install man page, creating install directory if necessary
install.man: $(MAN)
	$(mkinstalldirs) $(DESTDIR)$(mandir)/man$(manext)
	$(INSTALL_DATA) $(MAN) $(DESTDIR)$(mandir)/man$(manext)/$(MAN)

# install sample.wgetrc
install.wgetrc: $(srcdir)/sample.wgetrc
	$(mkinstalldirs) $(DESTDIR)$(sysconfdir)
	@if test -f $(DESTDIR)$(WGETRC); then \
	  if cmp -s $(srcdir)/sample.wgetrc $(DESTDIR)$(WGETRC); then echo ""; \
	     else \
	     echo ' $(INSTALL_DATA) $(srcdir)/sample.wgetrc $(DESTDIR)$(WGETRC).new'; \
	     $(INSTALL_DATA) $(srcdir)/sample.wgetrc $(DESTDIR)$(WGETRC).new; \
	     echo; \
	     echo "WARNING: Differing \`$(DESTDIR)$(WGETRC)'"; \
	     echo "         exists and has been spared.  You might want to"; \
	     echo "         consider merging in the new lines from"; \
	     echo "         \`$(DESTDIR)$(WGETRC).new'."; \
	     echo; \
	  fi; \
	else \
	  $(INSTALL_DATA) $(srcdir)/sample.wgetrc $(DESTDIR)$(WGETRC); \
	fi

# uninstall man page
uninstall.man:
	$(RM) $(DESTDIR)$(mandir)/man$(manext)/$(MAN)

#
# Dependencies for cleanup
#

CLEANFILES = *~ *.bak *.cat *.pod
DISTCLEANFILES = $(MAN)