1 # Makefile for `wget' utility
2 # Copyright (C) 1995-2005 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 Wget; if not, write to the Free Software Foundation, Inc.,
16 # 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 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.
36 top_srcdir = @top_srcdir@
41 exec_prefix = @exec_prefix@
43 sysconfdir = @sysconfdir@
45 localedir = $(datadir)/locale
51 # The following line is losing on some versions of make!
52 DEFS = @DEFS@ -DSYSTEM_WGETRC=\"$(sysconfdir)/wgetrc\" -DLOCALEDIR=\"$(localedir)\"
55 LIBS = @LIBS@ @LIBSSL@ @LIBGNUTLS@
58 INCLUDES = -I. -I$(srcdir) -I$(srcdir)/../src
60 COMPILE = $(CC) $(INCLUDES) $(CPPFLAGS) $(DEFS) $(CFLAGS)
61 LINK = $(CC) $(CFLAGS) $(LDFLAGS) -o $@
63 INSTALL_PROGRAM = @INSTALL_PROGRAM@
67 # Conditional compiles
73 GETOPT_OBJ = @GETOPT_OBJ@
78 unittest: test$(exeext)
81 # Dependencies for test binary
84 TESTOBJ = $(ALLOCA) cmpt.o connect.o convert.o cookies.o \
85 ftp.o ftp-basic.o ftp-ls.o $(OPIE_OBJ) $(GETOPT_OBJ) hash.o \
86 host.o html-parse.o html-url.o http.o $(NTLM_OBJ) init.o \
87 log.o main.o $(MD5_OBJ) netrc.o progress.o \
88 ptimer.o recur.o res.o retr.o safe-ctype.o snprintf.o \
89 spider.o $(SSL_OBJ) test.o url.o utils.o version.o xmalloc.o
91 # We make object files depend on every header. Rather than attempt to
92 # track dependencies, everything gets recompiled when a header
93 # changes. With a program of Wget's size this doesn't waste much
94 # time, and it's a lot safer than attempting to get all the
97 HEADERS = ../src/config-post.h ../src/config.h \
98 ../src/connect.h ../src/convert.h ../src/cookies.h \
99 ../src/ftp.h ../src/gen-md5.h ../src/getopt.h \
100 ../src/gnu-md5.h ../src/hash.h ../src/host.h \
101 ../src/html-parse.h ../src/http-ntlm.h ../src/init.h \
102 ../src/log.h ../src/mswindows.h ../src/netrc.h \
103 ../src/options.h ../src/progress.h \
104 ../src/ptimer.h ../src/recur.h ../src/res.h \
105 ../src/retr.h ../src/safe-ctype.h ../src/spider.h \
106 ../src/ssl.h ../src/sysdep.h ../src/test.h \
107 ../src/url.h ../src/utils.h ../src/wget.h \
110 alloca.o: ../src/alloca.c $(HEADERS)
111 $(COMPILE) -DTESTING -c $<
113 ccache.o: ../src/ccache.c $(HEADERS)
114 $(COMPILE) -DTESTING -c $<
116 cmpt.o: ../src/cmpt.c $(HEADERS)
117 $(COMPILE) -DTESTING -c $<
119 connect.o: ../src/connect.c $(HEADERS)
120 $(COMPILE) -DTESTING -c $<
122 convert.o: ../src/convert.c $(HEADERS)
123 $(COMPILE) -DTESTING -c $<
125 cookies.o: ../src/cookies.c $(HEADERS)
126 $(COMPILE) -DTESTING -c $<
128 ftp-basic.o: ../src/ftp-basic.c $(HEADERS)
129 $(COMPILE) -DTESTING -c $<
131 ftp.o: ../src/ftp.c $(HEADERS)
132 $(COMPILE) -DTESTING -c $<
134 ftp-ls.o: ../src/ftp-ls.c $(HEADERS)
135 $(COMPILE) -DTESTING -c $<
137 ftp-opie.o: ../src/ftp-opie.c $(HEADERS)
138 $(COMPILE) -DTESTING -c $<
140 gen-md5.o: ../src/gen-md5.c $(HEADERS)
141 $(COMPILE) -DTESTING -c $<
143 getopt.o: ../src/getopt.c $(HEADERS)
144 $(COMPILE) -DTESTING -c $<
146 gnu-md5.o: ../src/gnu-md5.c $(HEADERS)
147 $(COMPILE) -DTESTING -c $<
149 gnutls.o: ../src/gnutls.c $(HEADERS)
150 $(COMPILE) -DTESTING -c $<
152 hash.o: ../src/hash.c $(HEADERS)
153 $(COMPILE) -DTESTING -c $<
155 host.o: ../src/host.c $(HEADERS)
156 $(COMPILE) -DTESTING -c $<
158 html-parse.o: ../src/html-parse.c $(HEADERS)
159 $(COMPILE) -DTESTING -c $<
161 html-url.o: ../src/html-url.c $(HEADERS)
162 $(COMPILE) -DTESTING -c $<
164 http.o: ../src/http.c $(HEADERS)
165 $(COMPILE) -DTESTING -c $<
167 http-ntlm.o: ../src/http-ntlm.c $(HEADERS)
168 $(COMPILE) -DTESTING -c $<
170 init.o: ../src/init.c $(HEADERS)
171 $(COMPILE) -DTESTING -c $<
173 log.o: ../src/log.c $(HEADERS)
174 $(COMPILE) -DTESTING -c $<
176 main.o: ../src/main.c $(HEADERS)
177 $(COMPILE) -DTESTING -c $<
179 mswindows.o: ../src/mswindows.c $(HEADERS)
180 $(COMPILE) -DTESTING -c $<
182 netrc.o: ../src/netrc.c $(HEADERS)
183 $(COMPILE) -DTESTING -c $<
185 openssl.o: ../src/openssl.c $(HEADERS)
186 $(COMPILE) -DTESTING -c $<
188 progress.o: ../src/progress.c $(HEADERS)
189 $(COMPILE) -DTESTING -c $<
191 protocol.o: ../src/protocol.c $(HEADERS)
192 $(COMPILE) -DTESTING -c $<
194 ptimer.o: ../src/ptimer.c $(HEADERS)
195 $(COMPILE) -DTESTING -c $<
197 recur.o: ../src/recur.c $(HEADERS)
198 $(COMPILE) -DTESTING -c $<
200 res.o: ../src/res.c $(HEADERS)
201 $(COMPILE) -DTESTING -c $<
203 retr.o: ../src/retr.c $(HEADERS)
204 $(COMPILE) -DTESTING -c $<
206 safe-ctype.o: ../src/safe-ctype.c $(HEADERS)
207 $(COMPILE) -DTESTING -c $<
209 snprintf.o: ../src/snprintf.c $(HEADERS)
210 $(COMPILE) -DTESTING -c $<
212 spider.o: ../src/spider.c $(HEADERS)
213 $(COMPILE) -DTESTING -c $<
215 test.o: ../src/test.c $(HEADERS)
216 $(COMPILE) -DTESTING -c $<
218 url.o: ../src/url.c $(HEADERS)
219 $(COMPILE) -DTESTING -c $<
221 utils.o: ../src/utils.c $(HEADERS)
222 $(COMPILE) -DTESTING -c $<
224 version.o: ../src/version.c $(HEADERS)
225 $(COMPILE) -DTESTING -c $<
227 xmalloc.o: ../src/xmalloc.c $(HEADERS)
228 $(COMPILE) -DTESTING -c $<
231 test$(exeext): $(TESTOBJ)
232 $(LINK) $(TESTOBJ) $(LIBS)
235 # Dependencies for cleanup
239 $(RM) *.o test$(exeext) *~ *.bak core core.[0-9]*
247 # Dependencies for maintenance
252 Makefile: Makefile.in ../config.status
253 cd .. && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status