]> sjero.net Git - wget/blob - src/Makefile.am
Fix some build issues
[wget] / src / Makefile.am
1 # Makefile for `wget' utility
2 # Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
3 # 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
4 # Inc.
5
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 3 of the License, or
9 # (at your option) any later version.
10
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 # GNU General Public License for more details.
15
16 # You should have received a copy of the GNU General Public License
17 # along with Wget.  If not, see <http://www.gnu.org/licenses/>.
18
19 # Additional permission under GNU GPL version 3 section 7
20
21 # If you modify this program, or any covered work, by linking or
22 # combining it with the OpenSSL project's OpenSSL library (or a
23 # modified version of that library), containing parts covered by the
24 # terms of the OpenSSL or SSLeay licenses, the Free Software Foundation
25 # grants you additional permission to convey the resulting work.
26 # Corresponding Source for a non-source form of such a combination
27 # shall include the source code for the parts of OpenSSL used as well
28 # as that of the covered work.
29
30 #
31 # Version: @VERSION@
32 #
33
34 if IRI_IS_ENABLED
35 IRI_OBJ = iri.c
36 endif
37
38 # The following line is losing on some versions of make!
39 DEFS     = @DEFS@ -DSYSTEM_WGETRC=\"$(sysconfdir)/wgetrc\" -DLOCALEDIR=\"$(localedir)\"
40 LIBS     = @LIBSSL@ @LIBGNUTLS@ @LIBICONV@ @LIBINTL@ @W32LIBS@ @LIBS@
41
42 bin_PROGRAMS = wget
43 wget_SOURCES = cmpt.c connect.c convert.c cookies.c ftp.c                 \
44                css.l css-url.c \
45                ftp-basic.c ftp-ls.c hash.c host.c html-parse.c html-url.c \
46                http.c init.c log.c main.c netrc.c progress.c ptimer.c     \
47                recur.c res.c retr.c snprintf.c spider.c url.c             \
48                utils.c exits.c build_info.c $(IRI_OBJ)                    \
49                css-url.h css-tokens.h connect.h convert.h cookies.h       \
50                ftp.h gen-md5.h hash.h host.h html-parse.h html-url.h      \
51                http.h http-ntlm.h init.h log.h mswindows.h netrc.h        \
52                options.h progress.h ptimer.h recur.h res.h retr.h         \
53                spider.h ssl.h sysdep.h url.h utils.h wget.h iri.h         \
54                exits.h gettext.h
55 nodist_wget_SOURCES = version.c
56 EXTRA_wget_SOURCES = iri.c
57 LDADD = $(LIBOBJS) ../lib/libgnu.a @MD5_LDADD@
58 AM_CPPFLAGS = -I$(top_builddir)/lib -I$(top_srcdir)/lib @MD5_CPPFLAGS@
59 MD5_LDADD = @MD5_LDADD@
60
61 ../lib/libgnu.a:
62         cd ../lib && $(MAKE) $(AM_MAKEFLAGS)
63
64 ../md5/libmd5.a:
65         cd ../lib && $(MAKE) $(AM_MAKEFLAGS)
66
67 build_info.c: $(srcdir)/Makefile.am $(srcdir)/build_info.c.in
68         if test -n "$(VPATH)"; then cp "$(srcdir)/build_info.c.in" .; fi
69         $(PERL) "$(top_srcdir)/build-aux/build_info.pl" \
70             "$(abs_builddir)/build_info.c"
71         if test -n "$(VPATH)"; then rm -f build_info.c.in; fi
72
73 ESCAPEQUOTE = sed -e 's/[\\"]/\\&/g' -e 's/\\"/"/' -e 's/\\";$$/";/'
74 version.c:  $(wget_SOURCES) ../lib/libgnu.a $(MD5_LDADD)
75         echo '/* version.c */' > $@
76         echo '/* Autogenerated by Makefile - DO NOT EDIT */' >> $@
77         echo '' >> $@
78         echo 'const char *version_string = "@VERSION@"' >> $@
79         -hg log -R "$(top_srcdir)" -r . --template='" ({node|short})"\n' \
80             2>/dev/null >> $@
81         echo ';' >> $@
82         echo 'const char *compilation_string = "'$(COMPILE)'";' \
83             | $(ESCAPEQUOTE) >> $@
84         echo 'const char *link_string = "'$(CCLD) $(AM_CFLAGS) $(CFLAGS) \
85         $(AM_LDFLAGS) $(LDFLAGS) $(LIBS) $(wget_LDADD)'";' \
86             | $(ESCAPEQUOTE) >> $@
87
88 check_LIBRARIES = libunittest.a
89 libunittest_a_SOURCES = $(wget_SOURCES) test.c build_info.c test.h
90 nodist_libunittest_a_SOURCES = version.c
91 libunittest_a_CPPFLAGS = -DTESTING "-I$(top_builddir)/lib" "-I$(top_srcdir)/lib"
92 libunittest_a_LIBADD = $(LIBOBJS)
93 EXTRA_DIST = build_info.c.in
94
95 CLEANFILES = *~ *.bak core core.[0-9]* build_info.c version.c