| 1 |
# Makefile for `wget' utility |
| 2 |
# Copyright (C) 1995-2011, 2015, 2018-2024 Free Software Foundation, |
| 3 |
# Inc. |
| 4 |
|
| 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. |
| 9 |
|
| 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. |
| 14 |
|
| 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/>. |
| 17 |
|
| 18 |
# Additional permission under GNU GPL version 3 section 7 |
| 19 |
|
| 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. |
| 28 |
|
| 29 |
# |
| 30 |
# Version: @VERSION@ |
| 31 |
# |
| 32 |
|
| 33 |
|
| 34 |
# The following line is losing on some versions of make! |
| 35 |
DEFS = @DEFS@ -DSYSTEM_WGETRC=\"$(sysconfdir)/wgetrc\" -DLOCALEDIR=\"$(localedir)\" |
| 36 |
|
| 37 |
EXTRA_DIST = css.l css.c css_.c build_info.c.in build_info.c |
| 38 |
|
| 39 |
bin_PROGRAMS = wget |
| 40 |
wget_SOURCES = connect.c convert.c cookies.c ftp.c \ |
| 41 |
css_.c css-url.c \ |
| 42 |
ftp-basic.c ftp-ls.c hash.c host.c hsts.c html-parse.c html-url.c \ |
| 43 |
http.c init.c log.c main.c netrc.c progress.c ptimer.c \ |
| 44 |
recur.c res.c retr.c spider.c url.c warc.c \ |
| 45 |
utils.c exits.c build_info.c \ |
| 46 |
css-url.h css-tokens.h connect.h convert.h cookies.h \ |
| 47 |
ftp.h hash.h host.h hsts.h html-parse.h html-url.h \ |
| 48 |
http.h init.h log.h netrc.h \ |
| 49 |
options.h progress.h ptimer.h recur.h res.h retr.h \ |
| 50 |
spider.h ssl.h sysdep.h url.h warc.h utils.h wget.h \ |
| 51 |
exits.h version.h |
| 52 |
|
| 53 |
if WITH_IRI |
| 54 |
wget_SOURCES += iri.c iri.h |
| 55 |
endif |
| 56 |
|
| 57 |
if WITH_XATTR |
| 58 |
wget_SOURCES += xattr.c xattr.h |
| 59 |
endif |
| 60 |
|
| 61 |
if WITH_METALINK |
| 62 |
wget_SOURCES += metalink.c metalink.h |
| 63 |
endif |
| 64 |
|
| 65 |
if WITH_OPIE |
| 66 |
wget_SOURCES += ftp-opie.c |
| 67 |
endif |
| 68 |
|
| 69 |
if OS_MSWINDOWS |
| 70 |
wget_SOURCES += mswindows.c mswindows.h |
| 71 |
endif |
| 72 |
|
| 73 |
if WITH_NTLM |
| 74 |
wget_SOURCES += http-ntlm.c http-ntlm.h |
| 75 |
endif |
| 76 |
|
| 77 |
if WITH_OPENSSL |
| 78 |
wget_SOURCES += openssl.c |
| 79 |
endif |
| 80 |
|
| 81 |
if WITH_GNUTLS |
| 82 |
wget_SOURCES += gnutls.c |
| 83 |
endif |
| 84 |
|
| 85 |
nodist_wget_SOURCES = version.c |
| 86 |
EXTRA_wget_SOURCES = iri.c metalink.c xattr.c |
| 87 |
LDADD = $(CODE_COVERAGE_LIBS) $(LIBOBJS) ../lib/libgnu.a \ |
| 88 |
$(CLOCK_TIME_LIB) \ |
| 89 |
$(GETADDRINFO_LIB) \ |
| 90 |
$(GETRANDOM_LIB) \ |
| 91 |
$(HARD_LOCALE_LIB) \ |
| 92 |
$(HOSTENT_LIB) \ |
| 93 |
$(INET_NTOP_LIB) \ |
| 94 |
$(LIBSOCKET) \ |
| 95 |
$(LIBTHREAD) \ |
| 96 |
$(LIB_CRYPTO) \ |
| 97 |
$(LIBC32CONV) \ |
| 98 |
$(LIBICONV) \ |
| 99 |
$(LIBINTL) \ |
| 100 |
$(LIBUNISTRING) \ |
| 101 |
$(MBRTOWC_LIB) \ |
| 102 |
$(NANOSLEEP_LIB) \ |
| 103 |
$(POSIX_SPAWN_LIB) \ |
| 104 |
$(PTHREAD_SIGMASK_LIB) \ |
| 105 |
$(SELECT_LIB) \ |
| 106 |
$(SERVENT_LIB) \ |
| 107 |
$(SETLOCALE_NULL_LIB) |
| 108 |
|
| 109 |
AM_CPPFLAGS = -I$(top_builddir)/lib -I$(top_srcdir)/lib $(CODE_COVERAGE_CPPFLAGS) |
| 110 |
AM_CFLAGS = $(WERROR_CFLAGS) $(WARN_CFLAGS) $(CODE_COVERAGE_CFLAGS) |
| 111 |
|
| 112 |
../lib/libgnu.a: |
| 113 |
cd ../lib && $(MAKE) $(AM_MAKEFLAGS) |
| 114 |
|
| 115 |
build_info.c: $(srcdir)/Makefile.am $(srcdir)/build_info.c.in |
| 116 |
if test -n "$(VPATH)"; then cp "$(srcdir)/build_info.c.in" .; fi |
| 117 |
$(PERL) "$(top_srcdir)/build-aux/build_info.pl" \ |
| 118 |
"$(top_builddir)/src/build_info.c" |
| 119 |
if test -n "$(VPATH)"; then rm -f build_info.c.in; fi |
| 120 |
|
| 121 |
ESCAPEQUOTE = sed -e 's/[\\"]/\\&/g' -e 's/\\"/"/' -e 's/\\";$$/";/' |
| 122 |
version.c: $(wget_SOURCES) ../lib/libgnu.a |
| 123 |
echo '/* version.c */' > $@ |
| 124 |
echo '/* Autogenerated by Makefile - DO NOT EDIT */' >> $@ |
| 125 |
echo '' >> $@ |
| 126 |
echo '#include "version.h"' >> $@ |
| 127 |
echo 'const char *version_string = "@VERSION@";' >> $@ |
| 128 |
echo 'const char *compilation_string = "'$(COMPILE)'";' \ |
| 129 |
| $(ESCAPEQUOTE) >> $@ |
| 130 |
echo 'const char *link_string = "'$(CCLD) $(AM_CFLAGS) $(CFLAGS) \ |
| 131 |
$(AM_LDFLAGS) $(LDFLAGS) $(LIBS) $(wget_LDADD)'";' \ |
| 132 |
| $(ESCAPEQUOTE) >> $@ |
| 133 |
|
| 134 |
css.c: $(srcdir)/css.l |
| 135 |
$(LEX) $(LFLAGS) -o$@ $^ |
| 136 |
|
| 137 |
css_.c: css.c |
| 138 |
echo '#include "wget.h"' > $@ |
| 139 |
cat css.c >> $@ |
| 140 |
|
| 141 |
distclean-local: |
| 142 |
rm -f css.c css_.c |
| 143 |
|
| 144 |
check_LIBRARIES = libunittest.a |
| 145 |
libunittest_a_SOURCES = $(wget_SOURCES) build_info.c |
| 146 |
nodist_libunittest_a_SOURCES = version.c |
| 147 |
libunittest_a_CPPFLAGS = -DTESTING "-I$(top_builddir)/lib" "-I$(top_srcdir)/lib" $(CODE_COVERAGE_CPPLAGS) |
| 148 |
libunittest_a_LIBADD = $(LIBOBJS) |
| 149 |
|
| 150 |
CLEANFILES = *~ *.bak core core.[0-9]* build_info.c version.c |