1 # Makefile for `wget' utility
2 # Copyright (C) 1995, 1996, 1997, 2007 Free Software Foundation, Inc.
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 3 of the License, or
7 # (at your option) any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
23 # Program to format Texinfo source into Info files.
25 # Program to format Texinfo source into DVI files.
27 # Program to convert DVI files to PostScript
29 # Program to convert texinfo files to html
30 TEXI2HTML = texi2html -expandinfo -split_chapter
34 top_srcdir = @top_srcdir@
42 sysconfdir = @sysconfdir@
47 INSTALL_DATA = @INSTALL_DATA@
50 TEXI2POD = $(srcdir)/texi2pod.pl
53 WGETRC = $(sysconfdir)/wgetrc
54 SAMPLERCTEXI = sample.wgetrc.munged_for_texi_inclusion
57 # Dependencies for building
60 all: wget.info @COMMENT_IF_NO_POD2MAN@$(MAN)
62 everything: all wget_us.ps wget_a4.ps wget_toc.html
64 $(SAMPLERCTEXI): $(srcdir)/sample.wgetrc
67 wget.info: $(srcdir)/wget.texi $(SAMPLERCTEXI) $(srcdir)/version.texi
68 $(MAKEINFO) -I$(srcdir) $(srcdir)/wget.texi
70 wget.pod: $(srcdir)/wget.texi $(srcdir)/version.texi
71 $(TEXI2POD) $(srcdir)/wget.texi $@
74 $(POD2MAN) --center="GNU Wget" --release="GNU Wget @VERSION@" $? > $@
81 wget.dvi: $(srcdir)/wget.texi
82 $(TEXI2DVI) $(srcdir)/wget.texi
85 $(DVIPS) -t letter -o $@ wget.dvi
88 $(DVIPS) -t a4 -o $@ wget.dvi
90 wget_toc.html: $(srcdir)/wget.texi
91 $(TEXI2HTML) $(srcdir)/wget.texi
94 # Dependencies for installing
97 # install all the documentation
98 install: install.info install.wgetrc @COMMENT_IF_NO_POD2MAN@install.man
100 # uninstall all the documentation
101 uninstall: uninstall.info @COMMENT_IF_NO_POD2MAN@uninstall.man
103 # install info pages, creating install directory if necessary
104 # if the info pages are built in the build directory, they are used.
105 # otherwise, the ones from the distribution are installed.
106 install.info: wget.info
107 $(top_srcdir)/mkinstalldirs $(DESTDIR)$(infodir)
108 -if test -f wget.info; then \
109 for file in wget.info wget.info-*[0-9]; do \
110 if test -f "$$file"; then \
111 $(INSTALL_DATA) "$$file" "$(DESTDIR)$(infodir)/$$file" ; \
115 for file in $(srcdir)/wget.info $(srcdir)/wget.info-*[0-9]; do \
116 if test -f "$$file"; then \
117 $(INSTALL_DATA) "$$file" "$(DESTDIR)$(infodir)/`basename $$file`" ; \
122 # install man page, creating install directory if necessary
124 $(top_srcdir)/mkinstalldirs $(DESTDIR)$(mandir)/man$(manext)
125 $(INSTALL_DATA) $(MAN) $(DESTDIR)$(mandir)/man$(manext)/$(MAN)
127 # install sample.wgetrc
128 install.wgetrc: $(srcdir)/sample.wgetrc
129 $(top_srcdir)/mkinstalldirs $(DESTDIR)$(sysconfdir)
130 @if test -f $(DESTDIR)$(WGETRC); then \
131 if cmp -s $(srcdir)/sample.wgetrc $(DESTDIR)$(WGETRC); then echo ""; \
133 echo ' $(INSTALL_DATA) $(srcdir)/sample.wgetrc $(DESTDIR)$(WGETRC).new'; \
134 $(INSTALL_DATA) $(srcdir)/sample.wgetrc $(DESTDIR)$(WGETRC).new; \
136 echo "WARNING: Differing \`$(DESTDIR)$(WGETRC)'"; \
137 echo " exists and has been spared. You might want to"; \
138 echo " consider merging in the new lines from"; \
139 echo " \`$(DESTDIR)$(WGETRC).new'."; \
143 $(INSTALL_DATA) $(srcdir)/sample.wgetrc $(DESTDIR)$(WGETRC); \
146 # uninstall info pages
148 $(RM) $(DESTDIR)$(infodir)/wget.info*
152 $(RM) $(DESTDIR)$(mandir)/man$(manext)/$(MAN)
155 # Dependencies for cleanup
159 $(RM) *~ *.bak *.cat *.pod *.html
160 $(RM) *.dvi *.aux *.cp *.cps *.fn *.toc *.tp *.vr *.ps *.ky *.pg *.log
168 $(RM) $(SAMPLERCTEXI)
171 # Dependencies for maintenance
176 Makefile: Makefile.in ../config.status
177 cd .. && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status