1AM_CFLAGS = $(WERROR_CFLAGS) $(WARN_CFLAGS) $(CODE_COVERAGE_CFLAGS) $(MANYWARNINGS) -DBUILDING_LIBWGET
2
3# $(ALL_LIBS) is set to $LIBS in configure.ac
4LIBS =
5
6libwget_libadd = \
7 $(LIBOBJS) $(GETADDRINFO_LIB) $(GETHOSTNAME_LIB) $(HOSTENT_LIB) $(INET_NTOP_LIB) $(INET_PTON_LIB) \
8 $(LIBMULTITHREAD) $(LIBSOCKET) $(LIBTHREAD) $(LIB_CLOCK_GETTIME) $(LIB_CRYPTO) $(LIB_GETLOGIN) \
9 $(LIB_HARD_LOCALE) $(LIB_MBRTOWC) $(LIB_NANOSLEEP) $(LIB_POLL) $(LIB_POSIX_SPAWN) $(LIB_PTHREAD_SIGMASK) \
10 $(LIB_SELECT) $(LIB_SETLOCALE) $(LIB_SETLOCALE_NULL) $(LTLIBICONV) $(LTLIBINTL) $(SERVENT_LIB) @INTL_MACOSX_LIBS@ \
11 $(ALL_LIBS) ../lib/libgnu.la $(CODE_COVERAGE_LIBS)
12
13lib_LTLIBRARIES = libwget.la
14
15libwget_la_SOURCES = \
16 atom_url.c bar.c bitmap.c buffer.c buffer_printf.c base64.c console.c cookie.c cookie.h cookie_parse.c css.c css_tokenizer.h css_url.c \
17 decompressor.c dns_cache.c encoding.c hash_printf.c hashfile.c hashmap.c io.c hsts.c hpkp.c hpkp.h hpkp_db.c html_url.c http.c http.h \
18 http_parse.c  init.c ip.c iri.c list.c log.c logger.c logger.h mem.c metalink.c net.c net.h netrc.c ocsp.c pipe.c \
19 plugin.c printf.c random.c robots.c rss_url.c sitemap_url.c stringmap.c strlcpy.c \
20 strscpy.c thread.c tls_session.c utils.c vector.c xalloc.c xml.c private.h http_highlevel.c error.c dns.c
21
22if WITH_GNUTLS
23  libwget_la_SOURCES += ssl_gnutls.c
24else
25if WITH_OPENSSL
26  libwget_la_SOURCES += ssl_openssl.c
27else
28if WITH_WOLFSSL
29  libwget_la_SOURCES += ssl_wolfssl.c
30else
31  libwget_la_SOURCES += ssl_none.c
32endif
33endif
34endif
35
36libwget_la_CPPFLAGS =\
37 -fPIC -I$(top_srcdir)/include/wget -I$(srcdir) -I$(top_builddir)/lib -I$(top_srcdir)/lib $(CFLAG_VISIBILITY) -DBUILDING_LIBWGET \
38 $(CODE_COVERAGE_CPPFLAGS) \
39 -DWGETVER_FILE=\"$(top_builddir)/include/wget/wgetver.h\"
40libwget_la_LIBADD = libcsstokenizer.la $(libwget_libadd)
41
42# include ABI version information
43libwget_la_LDFLAGS = -no-undefined -version-info $(LIBWGET_SO_VERSION)
44
45# convenience library to avoid warnings about unused macros
46noinst_LTLIBRARIES = libcsstokenizer.la
47libcsstokenizer_la_SOURCES = css_tokenizer.c css_tokenizer.lex
48libcsstokenizer_la_CFLAGS = $(AM_CFLAGS)
49libcsstokenizer_la_CPPFLAGS = $(libwget_la_CPPFLAGS)
50
51# gnulib needs config.h included before any gnulib header files
52css_tokenizer.c: $(srcdir)/css_tokenizer.lex css_tokenizer.h
53	$(AM_V_GEN)
54	$(AM_V_at)$(LEX) -w -o $@ $(srcdir)/css_tokenizer.lex
55	$(AM_V_at)$(SED) 's/fprintf/wget_fprintf/g' $@ >$@.tmp
56	$(AM_V_at)mv $@.tmp $@
57	$(AM_V_at)rm -f lex.yy.c
58
59DISTCLEANFILES = css_tokenizer.c
60
61if ENABLE_MANYLIBS
62
63######## libwget alloc ########
64lib_LTLIBRARIES += libwget_alloc.la
65libwget_alloc_la_SOURCES =  xalloc.c
66libwget_alloc_la_CPPFLAGS = $(libwget_la_CPPFLAGS)
67libwget_alloc_la_LIBADD =  ../lib/libgnu.la
68libwget_alloc_la_LDFLAGS = $(libwget_la_LDFLAGS) -no-whole-archive
69
70######## libwget ip ########
71lib_LTLIBRARIES += libwget_ip.la
72libwget_ip_la_SOURCES =  ip.c
73libwget_ip_la_CPPFLAGS = $(libwget_la_CPPFLAGS)
74libwget_ip_la_LIBADD = $(INET_PTON_LIB) ../lib/libgnu.la
75libwget_ip_la_LDFLAGS = $(libwget_la_LDFLAGS) -no-whole-archive
76
77######## libwget common ########
78lib_LTLIBRARIES += libwget_common.la
79libwget_common_la_SOURCES =  buffer.c buffer_printf.c base64.c bitmap.c hashmap.c list.c log.c mem.c printf.c stringmap.c strlcpy.c strscpy.c utils.c vector.c error.c
80libwget_common_la_CPPFLAGS = $(libwget_la_CPPFLAGS)
81libwget_common_la_LIBADD =  libwget_alloc.la ../lib/libgnu.la
82libwget_common_la_LDFLAGS = $(libwget_la_LDFLAGS) -no-whole-archive
83
84######## libwget thread ########
85lib_LTLIBRARIES += libwget_thread.la
86libwget_thread_la_SOURCES =  thread.c
87libwget_thread_la_CPPFLAGS = $(libwget_la_CPPFLAGS)
88libwget_thread_la_LIBADD = libwget_alloc.la $(LIB_CLOCK_GETTIME) $(LTLIBMULTITHREAD) $(LTLIBTHREAD) ../lib/libgnu.la
89libwget_thread_la_LDFLAGS = $(libwget_la_LDFLAGS) -no-whole-archive
90
91######## libwget encoding ########
92lib_LTLIBRARIES += libwget_encoding.la
93libwget_encoding_la_SOURCES =  encoding.c
94libwget_encoding_la_CPPFLAGS = $(libwget_la_CPPFLAGS)
95libwget_encoding_la_LIBADD = libwget_common.la libwget_alloc.la $(LIBIDN_LIBS) $(LIBIDN2_LIBS) ../lib/libgnu.la
96libwget_encoding_la_LDFLAGS = $(libwget_la_LDFLAGS) -no-whole-archive
97
98######## libwget iri ########
99lib_LTLIBRARIES += libwget_iri.la
100libwget_iri_la_SOURCES =  iri.c
101libwget_iri_la_CPPFLAGS = $(libwget_la_CPPFLAGS)
102libwget_iri_la_LIBADD = libwget_encoding.la libwget_ip.la libwget_common.la libwget_alloc.la ../lib/libgnu.la
103libwget_iri_la_LDFLAGS = $(libwget_la_LDFLAGS) -no-whole-archive
104
105######## libwget io ########
106lib_LTLIBRARIES += libwget_io.la
107libwget_io_la_SOURCES =  io.c
108libwget_io_la_CPPFLAGS = $(libwget_la_CPPFLAGS)
109libwget_io_la_LIBADD = libwget_common.la libwget_alloc.la ../lib/libgnu.la
110libwget_io_la_LDFLAGS = $(libwget_la_LDFLAGS) -no-whole-archive
111
112######## libwget hashfile ########
113lib_LTLIBRARIES += libwget_hashfile.la
114libwget_hashfile_la_SOURCES =  hashfile.c
115libwget_hashfile_la_CPPFLAGS = $(libwget_la_CPPFLAGS)
116libwget_hashfile_la_LIBADD = libwget_common.la libwget_alloc.la $(GNUTLS_LIBS) $(WOLFSSL_LIBS) $(OPENSSL_LIBS) $(NETTLE_LIBS) ../lib/libgnu.la
117libwget_hashfile_la_LDFLAGS = $(libwget_la_LDFLAGS) -no-whole-archive
118
119######## libwget hpkp_db ########
120lib_LTLIBRARIES += libwget_hpkp_db.la
121libwget_hpkp_db_la_SOURCES =  hpkp_db.c hpkp.c hpkp.h
122libwget_hpkp_db_la_CPPFLAGS = $(libwget_la_CPPFLAGS)
123libwget_hpkp_db_la_LIBADD = libwget_hashfile.la libwget_io.la libwget_thread.la libwget_common.la libwget_alloc.la ../lib/libgnu.la
124libwget_hpkp_db_la_LDFLAGS = $(libwget_la_LDFLAGS) -no-whole-archive
125
126######## libwget hsts ########
127lib_LTLIBRARIES += libwget_hsts.la
128libwget_hsts_la_SOURCES =  hsts.c
129libwget_hsts_la_CPPFLAGS = $(libwget_la_CPPFLAGS)
130libwget_hsts_la_LIBADD = libwget_io.la libwget_thread.la libwget_common.la libwget_alloc.la ../lib/libgnu.la
131libwget_hsts_la_LDFLAGS = $(libwget_la_LDFLAGS) -no-whole-archive
132
133######## libwget ocsp ########
134lib_LTLIBRARIES += libwget_ocsp.la
135libwget_ocsp_la_SOURCES =  ocsp.c
136libwget_ocsp_la_CPPFLAGS = $(libwget_la_CPPFLAGS)
137libwget_ocsp_la_LIBADD = libwget_io.la libwget_thread.la libwget_common.la libwget_alloc.la ../lib/libgnu.la
138libwget_ocsp_la_LDFLAGS = $(libwget_la_LDFLAGS) -no-whole-archive
139
140######## libwget tls_session ########
141lib_LTLIBRARIES += libwget_tls_session.la
142libwget_tls_session_la_SOURCES =  tls_session.c
143libwget_tls_session_la_CPPFLAGS = $(libwget_la_CPPFLAGS)
144libwget_tls_session_la_LIBADD = libwget_io.la libwget_thread.la libwget_common.la libwget_alloc.la ../lib/libgnu.la
145libwget_tls_session_la_LDFLAGS = $(libwget_la_LDFLAGS) -no-whole-archive
146
147######## libwget http_parse ########
148lib_LTLIBRARIES += libwget_http_parse.la
149libwget_http_parse_la_SOURCES =  http_parse.c cookie_parse.c cookie.h hpkp.c cookie.h
150libwget_http_parse_la_CPPFLAGS = $(libwget_la_CPPFLAGS)
151libwget_http_parse_la_LIBADD = libwget_encoding.la libwget_common.la libwget_alloc.la $(LIBPSL_LIBS) ../lib/libgnu.la
152libwget_http_parse_la_LDFLAGS = $(libwget_la_LDFLAGS) -no-whole-archive
153
154######## libwget logger ########
155lib_LTLIBRARIES += libwget_logger.la
156libwget_logger_la_SOURCES =  logger.c
157libwget_logger_la_CPPFLAGS = $(libwget_la_CPPFLAGS)
158libwget_logger_la_LIBADD = libwget_common.la libwget_alloc.la ../lib/libgnu.la
159libwget_logger_la_LDFLAGS = $(libwget_la_LDFLAGS) -no-whole-archive
160
161######## libwget dnscache ########
162lib_LTLIBRARIES += libwget_dnscache.la
163libwget_dnscache_la_SOURCES =  dns_cache.c
164libwget_dnscache_la_CPPFLAGS = $(libwget_la_CPPFLAGS)
165libwget_dnscache_la_LIBADD = libwget_thread.la libwget_common.la libwget_alloc.la $(GETADDRINFO_LIB) ../lib/libgnu.la
166libwget_dnscache_la_LDFLAGS = $(libwget_la_LDFLAGS) -no-whole-archive
167
168######## libwget dns ########
169lib_LTLIBRARIES += libwget_dns.la
170libwget_dns_la_SOURCES =  dns.c
171libwget_dns_la_CPPFLAGS = $(libwget_la_CPPFLAGS)
172libwget_dns_la_LIBADD = libwget_dnscache.la libwget_ip.la libwget_logger.la libwget_thread.la libwget_common.la libwget_alloc.la $(GETADDRINFO_LIB) ../lib/libgnu.la
173libwget_dns_la_LDFLAGS = $(libwget_la_LDFLAGS) -no-whole-archive
174
175######## libwget robots ########
176lib_LTLIBRARIES += libwget_robots.la
177libwget_robots_la_SOURCES =  robots.c
178libwget_robots_la_CPPFLAGS = $(libwget_la_CPPFLAGS)
179libwget_robots_la_LIBADD = libwget_common.la libwget_alloc.la ../lib/libgnu.la
180libwget_robots_la_LDFLAGS = $(libwget_la_LDFLAGS) -no-whole-archive
181
182######## libwget xml ########
183lib_LTLIBRARIES += libwget_xml.la
184libwget_xml_la_SOURCES =  xml.c
185libwget_xml_la_CPPFLAGS = $(libwget_la_CPPFLAGS)
186libwget_xml_la_LIBADD = libwget_common.la libwget_alloc.la ../lib/libgnu.la
187libwget_xml_la_LDFLAGS = $(libwget_la_LDFLAGS) -no-whole-archive
188
189######## libwget metalink ########
190lib_LTLIBRARIES += libwget_metalink.la
191libwget_metalink_la_SOURCES =  metalink.c
192libwget_metalink_la_CPPFLAGS = $(libwget_la_CPPFLAGS)
193libwget_metalink_la_LIBADD = libwget_xml.la libwget_iri.la libwget_common.la libwget_alloc.la ../lib/libgnu.la
194libwget_metalink_la_LDFLAGS = $(libwget_la_LDFLAGS) -no-whole-archive
195
196######## libwget netrc ########
197lib_LTLIBRARIES += libwget_netrc.la
198libwget_netrc_la_SOURCES =  netrc.c
199libwget_netrc_la_CPPFLAGS = $(libwget_la_CPPFLAGS)
200libwget_netrc_la_LIBADD = libwget_io.la libwget_common.la libwget_alloc.la ../lib/libgnu.la
201libwget_netrc_la_LDFLAGS = $(libwget_la_LDFLAGS) -no-whole-archive
202
203######## libwget decompress ########
204lib_LTLIBRARIES += libwget_decompress.la
205libwget_decompress_la_SOURCES =  decompressor.c
206libwget_decompress_la_CPPFLAGS = $(libwget_la_CPPFLAGS)
207libwget_decompress_la_LIBADD = libwget_common.la libwget_alloc.la ../lib/libgnu.la $(ZSTD_LIBS) $(BROTLIDEC_LIBS) $(LZMA_LIBS) $(ZLIB_LIBS) $(BZ2_LIBS) $(LZIP_LIBS)
208libwget_decompress_la_LDFLAGS = $(libwget_la_LDFLAGS) -no-whole-archive
209
210######## libwget CSS ########
211lib_LTLIBRARIES += libwget_css.la
212libwget_css_la_SOURCES =  css_url.c css.c css_tokenizer.h
213libwget_css_la_CPPFLAGS = $(libwget_la_CPPFLAGS)
214libwget_css_la_LIBADD = libcsstokenizer.la libwget_iri.la libwget_common.la libwget_alloc.la ../lib/libgnu.la
215libwget_css_la_LDFLAGS = $(libwget_la_LDFLAGS) -no-whole-archive
216
217######## libwget progress ########
218lib_LTLIBRARIES += libwget_progress.la
219libwget_progress_la_SOURCES =  bar.c
220libwget_progress_la_CPPFLAGS = $(libwget_la_CPPFLAGS)
221libwget_progress_la_LIBADD = libwget_thread.la libwget_common.la libwget_alloc.la ../lib/libgnu.la
222libwget_progress_la_LDFLAGS = $(libwget_la_LDFLAGS) -no-whole-archive
223
224######## Test linking ########
225noinst_PROGRAMS = test_linking_common
226test_linking_common_SOURCES = test_linking_common.c
227test_linking_common_CPPFLAGS = -I$(top_srcdir)/include/wget -I$(top_builddir)/include/wget
228test_linking_common_LDADD = libwget_common.la
229test_linking_common_LDFLAGS = -static -no-install
230
231noinst_PROGRAMS += test_linking_encoding
232test_linking_encoding_SOURCES = test_linking_encoding.c
233test_linking_encoding_CPPFLAGS = -I$(top_srcdir)/include/wget -I$(top_builddir)/include/wget
234test_linking_encoding_LDADD = libwget_encoding.la
235test_linking_encoding_LDFLAGS = -static -no-install
236
237noinst_PROGRAMS += test_linking_iri
238test_linking_iri_SOURCES = test_linking_iri.c
239test_linking_iri_CPPFLAGS = -I$(top_srcdir)/include/wget -I$(top_builddir)/include/wget
240test_linking_iri_LDADD = libwget_iri.la
241test_linking_iri_LDFLAGS = -static -no-install
242
243noinst_PROGRAMS += test_linking_io
244test_linking_io_SOURCES = test_linking_io.c
245test_linking_io_CPPFLAGS = -I$(top_srcdir)/include/wget -I$(top_builddir)/include/wget
246test_linking_io_LDADD = libwget_io.la
247test_linking_io_LDFLAGS = -static -no-install
248
249noinst_PROGRAMS += test_linking_hashfile
250test_linking_hashfile_SOURCES = test_linking_hashfile.c
251test_linking_hashfile_CPPFLAGS = -I$(top_srcdir)/include/wget -I$(top_builddir)/include/wget
252test_linking_hashfile_LDADD = libwget_hashfile.la
253test_linking_hashfile_LDFLAGS = -static -no-install
254
255noinst_PROGRAMS += test_linking_hpkp_db
256test_linking_hpkp_db_SOURCES = test_linking_hpkp_db.c
257test_linking_hpkp_db_CPPFLAGS = -I$(top_srcdir)/include/wget -I$(top_builddir)/include/wget
258test_linking_hpkp_db_LDADD = libwget_hpkp_db.la
259test_linking_hpkp_db_LDFLAGS = -static -no-install
260
261noinst_PROGRAMS += test_linking_hsts
262test_linking_hsts_SOURCES = test_linking_hsts.c
263test_linking_hsts_CPPFLAGS = -I$(top_srcdir)/include/wget -I$(top_builddir)/include/wget
264test_linking_hsts_LDADD = libwget_hsts.la
265test_linking_hsts_LDFLAGS = -static -no-install
266
267noinst_PROGRAMS += test_linking_ocsp
268test_linking_ocsp_SOURCES = test_linking_ocsp.c
269test_linking_ocsp_CPPFLAGS = -I$(top_srcdir)/include/wget -I$(top_builddir)/include/wget
270test_linking_ocsp_LDADD = libwget_ocsp.la
271test_linking_ocsp_LDFLAGS = -static -no-install
272
273noinst_PROGRAMS += test_linking_tls_session
274test_linking_tls_session_SOURCES = test_linking_tls_session.c
275test_linking_tls_session_CPPFLAGS = -I$(top_srcdir)/include/wget -I$(top_builddir)/include/wget
276test_linking_tls_session_LDADD = libwget_tls_session.la
277test_linking_tls_session_LDFLAGS = -static -no-install
278
279noinst_PROGRAMS += test_linking_http_parse
280test_linking_http_parse_SOURCES = test_linking_http_parse.c
281test_linking_http_parse_CPPFLAGS = -I$(top_srcdir)/include/wget -I$(top_builddir)/include/wget
282test_linking_http_parse_LDADD = libwget_http_parse.la
283test_linking_http_parse_LDFLAGS = -static -no-install
284
285noinst_PROGRAMS += test_linking_logger
286test_linking_logger_SOURCES = test_linking_logger.c
287test_linking_logger_CPPFLAGS = -I$(top_srcdir)/include/wget -I$(top_builddir)/include/wget
288test_linking_logger_LDADD = libwget_logger.la
289test_linking_logger_LDFLAGS = -static -no-install
290
291noinst_PROGRAMS += test_linking_css
292test_linking_css_SOURCES = test_linking_css.c
293test_linking_css_CPPFLAGS = -I$(top_srcdir)/include/wget -I$(top_builddir)/include/wget
294test_linking_css_LDADD = libwget_css.la
295test_linking_css_LDFLAGS = -static -no-install
296
297noinst_PROGRAMS += test_linking_progress
298test_linking_progress_SOURCES = test_linking_progress.c
299test_linking_progress_CPPFLAGS = -I$(top_srcdir)/include/wget -I$(top_builddir)/include/wget
300test_linking_progress_LDADD = libwget_progress.la
301test_linking_progress_LDFLAGS = -static -no-install
302
303noinst_PROGRAMS += test_linking_thread
304test_linking_thread_SOURCES = test_linking_thread.c
305test_linking_thread_CPPFLAGS = -I$(top_srcdir)/include/wget -I$(top_builddir)/include/wget
306test_linking_thread_LDADD = libwget_thread.la
307test_linking_thread_LDFLAGS = -static -no-install
308
309noinst_PROGRAMS += test_linking_dnscache
310test_linking_dnscache_SOURCES = test_linking_dnscache.c
311test_linking_dnscache_CPPFLAGS = -I$(top_srcdir)/include/wget -I$(top_builddir)/include/wget
312test_linking_dnscache_LDADD = libwget_dnscache.la
313test_linking_dnscache_LDFLAGS = -static -no-install
314
315noinst_PROGRAMS += test_linking_dns
316test_linking_dns_SOURCES = test_linking_dns.c
317test_linking_dns_CPPFLAGS = -I$(top_srcdir)/include/wget -I$(top_builddir)/include/wget
318test_linking_dns_LDADD = libwget_dns.la
319test_linking_dns_LDFLAGS = -static -no-install
320
321noinst_PROGRAMS += test_linking_robots
322test_linking_robots_SOURCES = test_linking_robots.c
323test_linking_robots_CPPFLAGS = -I$(top_srcdir)/include/wget -I$(top_builddir)/include/wget
324test_linking_robots_LDADD = libwget_robots.la
325test_linking_robots_LDFLAGS = -static -no-install
326
327noinst_PROGRAMS += test_linking_xml
328test_linking_xml_SOURCES = test_linking_xml.c
329test_linking_xml_CPPFLAGS = -I$(top_srcdir)/include/wget -I$(top_builddir)/include/wget
330test_linking_xml_LDADD = libwget_xml.la
331test_linking_xml_LDFLAGS = -static -no-install
332
333noinst_PROGRAMS += test_linking_metalink
334test_linking_metalink_SOURCES = test_linking_metalink.c
335test_linking_metalink_CPPFLAGS = -I$(top_srcdir)/include/wget -I$(top_builddir)/include/wget
336test_linking_metalink_LDADD = libwget_metalink.la
337test_linking_metalink_LDFLAGS = -static -no-install
338
339noinst_PROGRAMS += test_linking_netrc
340test_linking_netrc_SOURCES = test_linking_netrc.c
341test_linking_netrc_CPPFLAGS = -I$(top_srcdir)/include/wget -I$(top_builddir)/include/wget
342test_linking_netrc_LDADD = libwget_netrc.la
343test_linking_netrc_LDFLAGS = -static -no-install
344
345noinst_PROGRAMS += test_linking_decompress
346test_linking_decompress_SOURCES = test_linking_decompress.c
347test_linking_decompress_CPPFLAGS = -I$(top_srcdir)/include/wget -I$(top_builddir)/include/wget
348test_linking_decompress_LDADD = libwget_decompress.la
349test_linking_decompress_LDFLAGS = -static -no-install
350
351noinst_PROGRAMS += test_linking
352test_linking_SOURCES = test_linking.c
353test_linking_CPPFLAGS = -I$(top_srcdir)/include/wget -I$(top_builddir)/include/wget
354test_linking_LDADD = libwget.la
355test_linking_LDFLAGS = -static -no-install
356
357endif # ENABLE_MANYLIBS
358