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.
29 # User configuration section
36 exec_prefix = @exec_prefix@
39 sysconfdir = @sysconfdir@
42 localedir = $(prefix)/share/locale
47 DEFS = @DEFS@ -DSYSTEM_WGETRC=\"$(sysconfdir)/wgetrc\" -DLOCALEDIR=\"$(localedir)\"
52 # End of user configuration section. There should be no need to change
53 # anything below this line.
56 DISTNAME = wget-@VERSION@
59 # These are used for maintenance only, so they are safe without
60 # special autoconf cruft.
65 # flags passed to recursive makes in subdirectories
66 MAKEDEFS = CC='$(CC)' CPPFLAGS='$(CPPFLAGS)' DEFS='$(DEFS)' \
67 CFLAGS='$(CFLAGS)' LDFLAGS='$(LDFLAGS)' LIBS='$(LIBS)' \
68 prefix='$(prefix)' exec_prefix='$(exec_prefix)' bindir='$(bindir)' \
69 infodir='$(infodir)' mandir='$(mandir)' manext='$(manext)'
71 # subdirectories in the distribution
72 SUBDIRS = src doc po util windows
75 all: src/config.h Makefile $(SUBDIRS)
80 cd $@ && $(MAKE) $(MAKEDEFS)
83 install: install.bin install.info install.wgetrc install.mo # install.man
85 # install/uninstall the binary
86 install.bin uninstall.bin:
87 cd src && $(MAKE) $(MAKEDEFS) $@
89 # install/uninstall the info/man pages
90 install.info uninstall.info install.man uninstall.man install.wgetrc:
91 cd doc && $(MAKE) $(MAKEDEFS) $@
95 cd po && $(MAKE) $(MAKEDEFS) $@
97 # create tag files for Emacs
101 dist: $(srcdir)/configure DISTFILES
103 for d in `$(FIND) . -type d ! -name CVS -a ! -name RCS -print`; do \
104 if [ "$$d" != "." -a "$$d" != "./$(DISTNAME)" ]; then \
105 mkdir $(DISTNAME)/$$d; \
108 for f in `cat DISTFILES`; do \
109 ln $(srcdir)/$$f $(DISTNAME)/$$f || \
110 { echo copying $$f; cp -p $(srcdir)/$$f $(DISTNAME)/$$f ; } \
112 (cd $(DISTNAME); $(MAKE) distclean)
113 $(TAR) chvf - $(DISTNAME) | $(GZIP) -c --best >$(DISTNAME).tar.gz
119 (cd $(srcdir); find . ! -type d -print) \
120 | sed '/\/\(CVS\|RCS\)\//d; \
123 s/^.\///; /^\.$$/d;' \
127 # Cleanup dependencies
130 clean: clean-recursive clean-top
131 distclean: distclean-recursive distclean-top
132 realclean: realclean-recursive realclean-top
135 $(RM) *~ *.bak $(DISTNAME).tar.gz
137 distclean-top: clean-top
138 $(RM) Makefile config.status config.log config.cache stamp-h
140 realclean-top: distclean-top
142 clean-recursive distclean-recursive realclean-recursive:
143 for subdir in $(SUBDIRS); do \
144 target=`echo $@ | sed s/-recursive//`; \
145 (cd $$subdir && $(MAKE) $(MAKEDEFS) $$target) || exit 1; \
149 # Dependencies for maintenance
152 Makefile: Makefile.in config.status
153 CONFIG_HEADERS= ./config.status
155 config.status: configure
156 ./config.status --recheck
158 configure: configure.in aclocal.m4
159 cd $(srcdir) && autoconf
161 src/config.h: stamp-h
162 stamp-h: src/config.h.in config.status
163 CONFIG_FILES= CONFIG_HEADERS=src/config.h ./config.status
165 src/config.h.in: stamp-h.in
166 stamp-h.in: configure.in aclocal.m4