1
# Makefile for `wget' utility
2
# Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
3
# 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
5
# This program is free software; you can redistribute it and/or modify
6
# it under the terms of the GNU General Public License as published by
7
# the Free Software Foundation; either version 3 of the License, or
8
# (at your option) any later version.
10
# This program is distributed in the hope that it will be useful,
11
# but WITHOUT ANY WARRANTY; without even the implied warranty of
12
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
# GNU General Public License for more details.
15
# You should have received a copy of the GNU General Public License
16
# along with Wget. If not, see <http://www.gnu.org/licenses/>.
18
# Additional permission under GNU GPL version 3 section 7
20
# If you modify this program, or any covered work, by linking or
21
# combining it with the OpenSSL project's OpenSSL library (or a
22
# modified version of that library), containing parts covered by the
23
# terms of the OpenSSL or SSLeay licenses, the Free Software Foundation
24
# grants you additional permission to convey the resulting work.
25
# Corresponding Source for a non-source form of such a combination
26
# shall include the source code for the parts of OpenSSL used as well
27
# as that of the covered work.
37
top_srcdir = @top_srcdir@
42
exec_prefix = @exec_prefix@
44
sysconfdir = @sysconfdir@
46
localedir = $(datadir)/locale
52
# The following line is losing on some versions of make!
53
DEFS = @DEFS@ -DSYSTEM_WGETRC=\"$(sysconfdir)/wgetrc\" -DLOCALEDIR=\"$(localedir)\"
56
LIBS = @LIBS@ @LIBSSL@ @LIBGNUTLS@
59
INCLUDES = -I. -I$(srcdir) -I$(srcdir)/../src
61
COMPILE = $(CC) $(INCLUDES) $(CPPFLAGS) $(DEFS) $(CFLAGS)
62
LINK = $(CC) $(CFLAGS) $(LDFLAGS) -o $@
64
INSTALL_PROGRAM = @INSTALL_PROGRAM@
68
# Conditional compiles
74
GETOPT_OBJ = @GETOPT_OBJ@
81
test: @top_srcdir@/src/wget run-unit-tests run-px-tests
83
@top_srcdir@/src/wget:
84
cd @top_srcdir@ && $(MAKE)
86
run-unit-tests: unit-tests$(exeext)
89
run-px-tests: WgetTest.pm
90
./Test-proxied-https-auth.px && echo && echo
91
./Test-proxy-auth-basic.px && echo && echo
92
./Test-auth-basic.px && echo && echo
93
./Test-c-full.px && echo && echo
94
./Test-c-partial.px && echo && echo
95
./Test-c.px && echo && echo
96
./Test-E-k-K.px && echo && echo
97
./Test-E-k.px && echo && echo
98
./Test-ftp.px && echo && echo
99
./Test-HTTP-Content-Disposition-1.px && echo && echo
100
./Test-HTTP-Content-Disposition-2.px && echo && echo
101
./Test-HTTP-Content-Disposition.px && echo && echo
102
./Test-N-current-HTTP-CD.px && echo && echo
103
./Test-N-current.px && echo && echo
104
./Test-N-HTTP-Content-Disposition.px && echo && echo
105
./Test-N--no-content-disposition.px && echo && echo
106
./Test-N--no-content-disposition-trivial.px && echo && echo
107
./Test--no-content-disposition.px && echo && echo
108
./Test--no-content-disposition-trivial.px && echo && echo
109
./Test-N-old.px && echo && echo
110
./Test-nonexisting-quiet.px && echo && echo
111
./Test-noop.px && echo && echo
112
./Test-np.px && echo && echo
113
./Test-N.px && echo && echo
114
./Test-O-HTTP-Content-Disposition.px && echo && echo
115
./Test-O--no-content-disposition.px && echo && echo
116
./Test-O--no-content-disposition-trivial.px && echo && echo
117
./Test-O-nonexisting.px && echo && echo
118
./Test-O.px && echo && echo
119
./Test-Restrict-Lowercase.px && echo && echo
120
./Test-Restrict-Uppercase.px && echo && echo
121
./Test--spider-fail.px && echo && echo
122
./Test--spider-HTTP-Content-Disposition.px && echo && echo
123
./Test--spider--no-content-disposition.px && echo && echo
124
./Test--spider--no-content-disposition-trivial.px && echo && echo
125
./Test--spider.px && echo && echo
126
./Test--spider-r-HTTP-Content-Disposition.px && echo && echo
127
./Test--spider-r--no-content-disposition.px && echo && echo
128
./Test--spider-r--no-content-disposition-trivial.px && echo && echo
129
./Test--spider-r.px && echo && echo
131
WgetTest.pm: WgetTest.pm.in @top_srcdir@/config.status
132
cd @top_srcdir@ && ./config.status
135
# Dependencies for test binary
138
TESTOBJ = $(ALLOCA) cmpt.o connect.o convert.o cookies.o \
139
ftp.o ftp-basic.o ftp-ls.o $(OPIE_OBJ) $(GETOPT_OBJ) hash.o \
140
host.o html-parse.o html-url.o http.o $(NTLM_OBJ) init.o \
141
log.o main.o $(MD5_OBJ) netrc.o progress.o \
142
ptimer.o recur.o res.o retr.o safe-ctype.o snprintf.o \
143
spider.o $(SSL_OBJ) test.o url.o utils.o version.o xmalloc.o
145
# We make object files depend on every header. Rather than attempt to
146
# track dependencies, everything gets recompiled when a header
147
# changes. With a program of Wget's size this doesn't waste much
148
# time, and it's a lot safer than attempting to get all the
149
# dependencies right.
151
HEADERS = ../src/config-post.h ../src/config.h \
152
../src/connect.h ../src/convert.h ../src/cookies.h \
153
../src/ftp.h ../src/gen-md5.h ../src/getopt.h \
154
../src/gnu-md5.h ../src/hash.h ../src/host.h \
155
../src/html-parse.h ../src/http-ntlm.h ../src/init.h \
156
../src/log.h ../src/mswindows.h ../src/netrc.h \
157
../src/options.h ../src/progress.h \
158
../src/ptimer.h ../src/recur.h ../src/res.h \
159
../src/retr.h ../src/safe-ctype.h ../src/spider.h \
160
../src/ssl.h ../src/sysdep.h ../src/test.h \
161
../src/url.h ../src/utils.h ../src/wget.h \
164
alloca.o: ../src/alloca.c $(HEADERS)
165
$(COMPILE) -DTESTING -c $<
167
ccache.o: ../src/ccache.c $(HEADERS)
168
$(COMPILE) -DTESTING -c $<
170
cmpt.o: ../src/cmpt.c $(HEADERS)
171
$(COMPILE) -DTESTING -c $<
173
connect.o: ../src/connect.c $(HEADERS)
174
$(COMPILE) -DTESTING -c $<
176
convert.o: ../src/convert.c $(HEADERS)
177
$(COMPILE) -DTESTING -c $<
179
cookies.o: ../src/cookies.c $(HEADERS)
180
$(COMPILE) -DTESTING -c $<
182
ftp-basic.o: ../src/ftp-basic.c $(HEADERS)
183
$(COMPILE) -DTESTING -c $<
185
ftp.o: ../src/ftp.c $(HEADERS)
186
$(COMPILE) -DTESTING -c $<
188
ftp-ls.o: ../src/ftp-ls.c $(HEADERS)
189
$(COMPILE) -DTESTING -c $<
191
ftp-opie.o: ../src/ftp-opie.c $(HEADERS)
192
$(COMPILE) -DTESTING -c $<
194
gen-md5.o: ../src/gen-md5.c $(HEADERS)
195
$(COMPILE) -DTESTING -c $<
197
getopt.o: ../src/getopt.c $(HEADERS)
198
$(COMPILE) -DTESTING -c $<
200
gnu-md5.o: ../src/gnu-md5.c $(HEADERS)
201
$(COMPILE) -DTESTING -c $<
203
gnutls.o: ../src/gnutls.c $(HEADERS)
204
$(COMPILE) -DTESTING -c $<
206
hash.o: ../src/hash.c $(HEADERS)
207
$(COMPILE) -DTESTING -c $<
209
host.o: ../src/host.c $(HEADERS)
210
$(COMPILE) -DTESTING -c $<
212
html-parse.o: ../src/html-parse.c $(HEADERS)
213
$(COMPILE) -DTESTING -c $<
215
html-url.o: ../src/html-url.c $(HEADERS)
216
$(COMPILE) -DTESTING -c $<
218
http.o: ../src/http.c $(HEADERS)
219
$(COMPILE) -DTESTING -c $<
221
http-ntlm.o: ../src/http-ntlm.c $(HEADERS)
222
$(COMPILE) -DTESTING -c $<
224
init.o: ../src/init.c $(HEADERS)
225
$(COMPILE) -DTESTING -c $<
227
log.o: ../src/log.c $(HEADERS)
228
$(COMPILE) -DTESTING -c $<
230
main.o: ../src/main.c $(HEADERS)
231
$(COMPILE) -DTESTING -c $<
233
mswindows.o: ../src/mswindows.c $(HEADERS)
234
$(COMPILE) -DTESTING -c $<
236
netrc.o: ../src/netrc.c $(HEADERS)
237
$(COMPILE) -DTESTING -c $<
239
openssl.o: ../src/openssl.c $(HEADERS)
240
$(COMPILE) -DTESTING -c $<
242
progress.o: ../src/progress.c $(HEADERS)
243
$(COMPILE) -DTESTING -c $<
245
protocol.o: ../src/protocol.c $(HEADERS)
246
$(COMPILE) -DTESTING -c $<
248
ptimer.o: ../src/ptimer.c $(HEADERS)
249
$(COMPILE) -DTESTING -c $<
251
recur.o: ../src/recur.c $(HEADERS)
252
$(COMPILE) -DTESTING -c $<
254
res.o: ../src/res.c $(HEADERS)
255
$(COMPILE) -DTESTING -c $<
257
retr.o: ../src/retr.c $(HEADERS)
258
$(COMPILE) -DTESTING -c $<
260
safe-ctype.o: ../src/safe-ctype.c $(HEADERS)
261
$(COMPILE) -DTESTING -c $<
263
snprintf.o: ../src/snprintf.c $(HEADERS)
264
$(COMPILE) -DTESTING -c $<
266
spider.o: ../src/spider.c $(HEADERS)
267
$(COMPILE) -DTESTING -c $<
269
test.o: ../src/test.c $(HEADERS)
270
$(COMPILE) -DTESTING -c $<
272
url.o: ../src/url.c $(HEADERS)
273
$(COMPILE) -DTESTING -c $<
275
utils.o: ../src/utils.c $(HEADERS)
276
$(COMPILE) -DTESTING -c $<
278
version.o: ../src/version.c $(HEADERS)
279
$(COMPILE) -DTESTING -c $<
281
xmalloc.o: ../src/xmalloc.c $(HEADERS)
282
$(COMPILE) -DTESTING -c $<
285
unit-tests$(exeext): $(TESTOBJ)
286
$(LINK) $(TESTOBJ) $(LIBS)
289
# Dependencies for cleanup
293
$(RM) *.o unit-tests$(exeext) *~ *.bak core core.[0-9]*
301
# Dependencies for maintenance
306
Makefile: Makefile.in ../config.status
307
cd .. && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status