1 # Makefile for `Wget' utility
2 # Copyright (C) 1995, 1996, 1997 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 2 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, write to the Free Software
16 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 # In addition, as a special exception, the Free Software Foundation
19 # gives permission to link the code of its release of Wget with the
20 # OpenSSL project's "OpenSSL" library (or with modified versions of it
21 # that use the same license as the "OpenSSL" library), and distribute
22 # the linked executables. You must obey the GNU General Public License
23 # in all respects for all of the code used other than "OpenSSL". If you
24 # modify this file, you may extend this exception to your version of the
25 # file, but you are not obligated to do so. If you do not wish to do
26 # so, delete this exception statement from your version.
41 # User configuration section
48 exec_prefix = @exec_prefix@
51 sysconfdir = @sysconfdir@
54 localedir = $(prefix)/share/locale
59 DEFS = @DEFS@ -DSYSTEM_WGETRC=\"$(sysconfdir)/wgetrc\" -DLOCALEDIR=\"$(localedir)\"
64 # End of user configuration section. There should be no need to change
65 # anything below this line.
68 DISTNAME = wget-@VERSION@
69 LIBTOOL_DEPS = @LIBTOOL_DEPS@
72 # These are used for maintenance only, so they are safe without
73 # special autoconf cruft.
78 # flags passed to recursive makes in subdirectories
79 MAKEDEFS = CC='$(CC)' CPPFLAGS='$(CPPFLAGS)' DEFS='$(DEFS)' \
80 CFLAGS='$(CFLAGS)' LDFLAGS='$(LDFLAGS)' LIBS='$(LIBS)' \
81 prefix='$(prefix)' exec_prefix='$(exec_prefix)' bindir='$(bindir)' \
82 infodir='$(infodir)' mandir='$(mandir)' manext='$(manext)'
84 # subdirectories in the distribution
85 SUBDIRS = src doc po util windows
88 all: libtool src/config.h Makefile $(SUBDIRS)
93 cd $@ && $(MAKE) $(MAKEDEFS)
96 install: install.bin install.info install.wgetrc \
97 install.mo @COMMENT_IF_NO_POD2MAN@install.man
99 # install/uninstall the binary
100 install.bin uninstall.bin:
101 cd src && $(MAKE) $(MAKEDEFS) $@
103 # install/uninstall the info/man pages
104 install.info uninstall.info install.man uninstall.man install.wgetrc:
105 cd doc && $(MAKE) $(MAKEDEFS) $@
107 # Install `.mo' files
109 cd po && $(MAKE) $(MAKEDEFS) $@
111 # Regenerate libtool if ltconfig and/or ltmain are updated
112 libtool: $(LIBTOOL_DEPS)
113 $(SHELL) ./config.status --recheck
115 # Create configure.bat from configure.bat.in by DOS-ifying the lines.
116 configure.bat: configure.bat.in
117 awk '{ print $$0 ($$0 ~ /\r$$/ ? "" : "\r") }' $@.in > $@
119 # create tag files for Emacs
123 dist: $(srcdir)/configure DISTFILES
125 for d in `$(FIND) . -type d ! -name CVS -a ! -name RCS -print`; do \
126 if [ "$$d" != "." -a "$$d" != "./$(DISTNAME)" ]; then \
127 mkdir $(DISTNAME)/$$d; \
130 for f in `cat DISTFILES`; do \
131 ln $(srcdir)/$$f $(DISTNAME)/$$f || \
132 { echo copying $$f; cp -p $(srcdir)/$$f $(DISTNAME)/$$f ; } \
134 (cd $(DISTNAME); $(MAKE) distclean)
135 $(TAR) chvf - $(DISTNAME) | $(GZIP) -c --best >$(DISTNAME).tar.gz
141 (cd $(srcdir); find . ! -type d -print) \
142 | sed '/\/\(CVS\|RCS\)\//d; \
145 s/^.\///; /^\.$$/d;' \
149 # Cleanup dependencies
152 clean: clean-recursive clean-top
153 distclean: distclean-recursive distclean-top
154 realclean: realclean-recursive realclean-top
157 $(RM) *~ *.bak $(DISTNAME).tar.gz
159 distclean-top: clean-top
160 $(RM) Makefile config.status config.log config.cache stamp-h
162 realclean-top: distclean-top
165 clean-recursive distclean-recursive realclean-recursive:
166 for subdir in $(SUBDIRS); do \
167 target=`echo $@ | sed s/-recursive//`; \
168 (cd $$subdir && $(MAKE) $(MAKEDEFS) $$target) || exit 1; \
172 # Dependencies for maintenance
175 Makefile: Makefile.in config.status
176 CONFIG_HEADERS= ./config.status
178 config.status: configure
179 ./config.status --recheck
181 configure: configure.in aclocal.m4
182 cd $(srcdir) && autoconf
184 src/config.h: stamp-h
185 stamp-h: src/config.h.in config.status
186 CONFIG_FILES= CONFIG_HEADERS=src/config.h ./config.status
188 src/config.h.in: stamp-h.in
189 stamp-h.in: configure.in aclocal.m4