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 \
84 install.mo @COMMENT_IF_NO_POD2MAN@install.man
86 # install/uninstall the binary
87 install.bin uninstall.bin:
88 cd src && $(MAKE) $(MAKEDEFS) $@
90 # install/uninstall the info/man pages
91 install.info uninstall.info install.man uninstall.man install.wgetrc:
92 cd doc && $(MAKE) $(MAKEDEFS) $@
96 cd po && $(MAKE) $(MAKEDEFS) $@
98 # create tag files for Emacs
102 dist: $(srcdir)/configure DISTFILES
104 for d in `$(FIND) . -type d ! -name CVS -a ! -name RCS -print`; do \
105 if [ "$$d" != "." -a "$$d" != "./$(DISTNAME)" ]; then \
106 mkdir $(DISTNAME)/$$d; \
109 for f in `cat DISTFILES`; do \
110 ln $(srcdir)/$$f $(DISTNAME)/$$f || \
111 { echo copying $$f; cp -p $(srcdir)/$$f $(DISTNAME)/$$f ; } \
113 (cd $(DISTNAME); $(MAKE) distclean)
114 $(TAR) chvf - $(DISTNAME) | $(GZIP) -c --best >$(DISTNAME).tar.gz
120 (cd $(srcdir); find . ! -type d -print) \
121 | sed '/\/\(CVS\|RCS\)\//d; \
124 s/^.\///; /^\.$$/d;' \
128 # Cleanup dependencies
131 clean: clean-recursive clean-top
132 distclean: distclean-recursive distclean-top
133 realclean: realclean-recursive realclean-top
136 $(RM) *~ *.bak $(DISTNAME).tar.gz
138 distclean-top: clean-top
139 $(RM) Makefile config.status config.log config.cache stamp-h
141 realclean-top: distclean-top
144 clean-recursive distclean-recursive realclean-recursive:
145 for subdir in $(SUBDIRS); do \
146 target=`echo $@ | sed s/-recursive//`; \
147 (cd $$subdir && $(MAKE) $(MAKEDEFS) $$target) || exit 1; \
151 # Dependencies for maintenance
154 Makefile: Makefile.in config.status
155 CONFIG_HEADERS= ./config.status
157 config.status: configure
158 ./config.status --recheck
160 configure: configure.in aclocal.m4
161 cd $(srcdir) && autoconf
163 src/config.h: stamp-h
164 stamp-h: src/config.h.in config.status
165 CONFIG_FILES= CONFIG_HEADERS=src/config.h ./config.status
167 src/config.h.in: stamp-h.in
168 stamp-h.in: configure.in aclocal.m4