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 3 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, see <http://www.gnu.org/licenses/>.
17 # In addition, as a special exception, the Free Software Foundation
18 # gives permission to link the code of its release of Wget with the
19 # OpenSSL project's "OpenSSL" library (or with modified versions of it
20 # that use the same license as the "OpenSSL" library), and distribute
21 # the linked executables. You must obey the GNU General Public License
22 # in all respects for all of the code used other than "OpenSSL". If you
23 # modify this file, you may extend this exception to your version of the
24 # file, but you are not obligated to do so. If you do not wish to do
25 # so, delete this exception statement from your version.
35 top_srcdir = @top_srcdir@
40 exec_prefix = @exec_prefix@
42 sysconfdir = @sysconfdir@
44 localedir = $(datadir)/locale
50 # The following line is losing on some versions of make!
51 DEFS = @DEFS@ -DSYSTEM_WGETRC=\"$(sysconfdir)/wgetrc\" -DLOCALEDIR=\"$(localedir)\"
54 LIBS = @LIBS@ @LIBSSL@ @LIBGNUTLS@
57 INCLUDES = -I. -I$(srcdir) -I$(srcdir)/../src
59 COMPILE = $(CC) $(INCLUDES) $(CPPFLAGS) $(DEFS) $(CFLAGS)
60 LINK = $(CC) $(CFLAGS) $(LDFLAGS) -o $@
62 INSTALL_PROGRAM = @INSTALL_PROGRAM@
66 # Conditional compiles
72 GETOPT_OBJ = @GETOPT_OBJ@
77 unittest: test$(exeext)
80 # Dependencies for test binary
83 TESTOBJ = $(ALLOCA) cmpt.o connect.o convert.o cookies.o \
84 ftp.o ftp-basic.o ftp-ls.o $(OPIE_OBJ) $(GETOPT_OBJ) hash.o \
85 host.o html-parse.o html-url.o http.o $(NTLM_OBJ) init.o \
86 log.o main.o $(MD5_OBJ) netrc.o progress.o \
87 ptimer.o recur.o res.o retr.o safe-ctype.o snprintf.o \
88 spider.o $(SSL_OBJ) test.o url.o utils.o version.o xmalloc.o
90 # We make object files depend on every header. Rather than attempt to
91 # track dependencies, everything gets recompiled when a header
92 # changes. With a program of Wget's size this doesn't waste much
93 # time, and it's a lot safer than attempting to get all the
96 HEADERS = ../src/config-post.h ../src/config.h \
97 ../src/connect.h ../src/convert.h ../src/cookies.h \
98 ../src/ftp.h ../src/gen-md5.h ../src/getopt.h \
99 ../src/gnu-md5.h ../src/hash.h ../src/host.h \
100 ../src/html-parse.h ../src/http-ntlm.h ../src/init.h \
101 ../src/log.h ../src/mswindows.h ../src/netrc.h \
102 ../src/options.h ../src/progress.h \
103 ../src/ptimer.h ../src/recur.h ../src/res.h \
104 ../src/retr.h ../src/safe-ctype.h ../src/spider.h \
105 ../src/ssl.h ../src/sysdep.h ../src/test.h \
106 ../src/url.h ../src/utils.h ../src/wget.h \
109 alloca.o: ../src/alloca.c $(HEADERS)
110 $(COMPILE) -DTESTING -c $<
112 ccache.o: ../src/ccache.c $(HEADERS)
113 $(COMPILE) -DTESTING -c $<
115 cmpt.o: ../src/cmpt.c $(HEADERS)
116 $(COMPILE) -DTESTING -c $<
118 connect.o: ../src/connect.c $(HEADERS)
119 $(COMPILE) -DTESTING -c $<
121 convert.o: ../src/convert.c $(HEADERS)
122 $(COMPILE) -DTESTING -c $<
124 cookies.o: ../src/cookies.c $(HEADERS)
125 $(COMPILE) -DTESTING -c $<
127 ftp-basic.o: ../src/ftp-basic.c $(HEADERS)
128 $(COMPILE) -DTESTING -c $<
130 ftp.o: ../src/ftp.c $(HEADERS)
131 $(COMPILE) -DTESTING -c $<
133 ftp-ls.o: ../src/ftp-ls.c $(HEADERS)
134 $(COMPILE) -DTESTING -c $<
136 ftp-opie.o: ../src/ftp-opie.c $(HEADERS)
137 $(COMPILE) -DTESTING -c $<
139 gen-md5.o: ../src/gen-md5.c $(HEADERS)
140 $(COMPILE) -DTESTING -c $<
142 getopt.o: ../src/getopt.c $(HEADERS)
143 $(COMPILE) -DTESTING -c $<
145 gnu-md5.o: ../src/gnu-md5.c $(HEADERS)
146 $(COMPILE) -DTESTING -c $<
148 gnutls.o: ../src/gnutls.c $(HEADERS)
149 $(COMPILE) -DTESTING -c $<
151 hash.o: ../src/hash.c $(HEADERS)
152 $(COMPILE) -DTESTING -c $<
154 host.o: ../src/host.c $(HEADERS)
155 $(COMPILE) -DTESTING -c $<
157 html-parse.o: ../src/html-parse.c $(HEADERS)
158 $(COMPILE) -DTESTING -c $<
160 html-url.o: ../src/html-url.c $(HEADERS)
161 $(COMPILE) -DTESTING -c $<
163 http.o: ../src/http.c $(HEADERS)
164 $(COMPILE) -DTESTING -c $<
166 http-ntlm.o: ../src/http-ntlm.c $(HEADERS)
167 $(COMPILE) -DTESTING -c $<
169 init.o: ../src/init.c $(HEADERS)
170 $(COMPILE) -DTESTING -c $<
172 log.o: ../src/log.c $(HEADERS)
173 $(COMPILE) -DTESTING -c $<
175 main.o: ../src/main.c $(HEADERS)
176 $(COMPILE) -DTESTING -c $<
178 mswindows.o: ../src/mswindows.c $(HEADERS)
179 $(COMPILE) -DTESTING -c $<
181 netrc.o: ../src/netrc.c $(HEADERS)
182 $(COMPILE) -DTESTING -c $<
184 openssl.o: ../src/openssl.c $(HEADERS)
185 $(COMPILE) -DTESTING -c $<
187 progress.o: ../src/progress.c $(HEADERS)
188 $(COMPILE) -DTESTING -c $<
190 protocol.o: ../src/protocol.c $(HEADERS)
191 $(COMPILE) -DTESTING -c $<
193 ptimer.o: ../src/ptimer.c $(HEADERS)
194 $(COMPILE) -DTESTING -c $<
196 recur.o: ../src/recur.c $(HEADERS)
197 $(COMPILE) -DTESTING -c $<
199 res.o: ../src/res.c $(HEADERS)
200 $(COMPILE) -DTESTING -c $<
202 retr.o: ../src/retr.c $(HEADERS)
203 $(COMPILE) -DTESTING -c $<
205 safe-ctype.o: ../src/safe-ctype.c $(HEADERS)
206 $(COMPILE) -DTESTING -c $<
208 snprintf.o: ../src/snprintf.c $(HEADERS)
209 $(COMPILE) -DTESTING -c $<
211 spider.o: ../src/spider.c $(HEADERS)
212 $(COMPILE) -DTESTING -c $<
214 test.o: ../src/test.c $(HEADERS)
215 $(COMPILE) -DTESTING -c $<
217 url.o: ../src/url.c $(HEADERS)
218 $(COMPILE) -DTESTING -c $<
220 utils.o: ../src/utils.c $(HEADERS)
221 $(COMPILE) -DTESTING -c $<
223 version.o: ../src/version.c $(HEADERS)
224 $(COMPILE) -DTESTING -c $<
226 xmalloc.o: ../src/xmalloc.c $(HEADERS)
227 $(COMPILE) -DTESTING -c $<
230 test$(exeext): $(TESTOBJ)
231 $(LINK) $(TESTOBJ) $(LIBS)
234 # Dependencies for cleanup
238 $(RM) *.o test$(exeext) *~ *.bak core core.[0-9]*
246 # Dependencies for maintenance
251 Makefile: Makefile.in ../config.status
252 cd .. && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status