Makefile.am 14.7 KB
Newer Older
1
###############################################################################
2 3 4
# Automake targets and declarations
###############################################################################

5 6
AUTOMAKE_OPTIONS = subdir-objects

7
NULL =
8
EXTRA_DIST = \
9
	vlc-plugin.pc.in \
10
	libvlccore.sym \
11
	revision.txt
12

13
BUILT_SOURCES = $(nodist_pluginsinclude_HEADERS)
Christophe Mutricy's avatar
Christophe Mutricy committed
14
CLEANFILES = $(BUILT_SOURCES)
15

16
SUFFIXES = .pc.in .pc .rc.in .rc
17

18 19 20 21
###############################################################################
# Headers
###############################################################################

22
pluginsincludedir = $(pkgincludedir)/plugins
23

24
pluginsinclude_HEADERS = \
25
	../include/vlc_access.h \
26
	../include/vlc_actions.h \
Rafaël Carré's avatar
Rafaël Carré committed
27
	../include/vlc_addons.h \
28
	../include/vlc_aout.h \
29
	../include/vlc_aout_volume.h \
30
	../include/vlc_arrays.h \
31
	../include/vlc_atomic.h \
32
	../include/vlc_avcodec.h \
33 34 35
	../include/vlc_bits.h \
	../include/vlc_block.h \
	../include/vlc_block_helper.h \
36
	../include/vlc_boxes.h \
37 38
	../include/vlc_charset.h \
	../include/vlc_codec.h \
39 40
	../include/vlc_common.h \
	../include/vlc_config.h \
41
	../include/vlc_config_cat.h \
42
	../include/vlc_configuration.h \
43
	../include/vlc_cpu.h \
44
	../include/vlc_dialog.h \
45
	../include/vlc_demux.h \
46
	../include/vlc_epg.h \
47
	../include/vlc_es.h \
48 49
	../include/vlc_es_out.h \
	../include/vlc_events.h \
50
	../include/vlc_filter.h \
51
	../include/vlc_fourcc.h \
52
	../include/vlc_fs.h \
53
	../include/vlc_gcrypt.h \
54
	../include/vlc_opengl.h \
55
	../include/vlc_http.h \
56
	../include/vlc_httpd.h \
57
	../include/vlc_image.h \
58
	../include/vlc_inhibit.h \
59
	../include/vlc_input.h \
60
	../include/vlc_input_item.h \
61
	../include/vlc_interface.h \
Thomas Guillem's avatar
Thomas Guillem committed
62
	../include/vlc_keystore.h \
63
	../include/vlc_md5.h \
64
	../include/vlc_messages.h \
65
	../include/vlc_meta.h \
66
	../include/vlc_meta_fetcher.h \
Srikanth Raju's avatar
Srikanth Raju committed
67
	../include/vlc_media_library.h \
68
	../include/vlc_memstream.h \
69
	../include/vlc_mime.h \
70
	../include/vlc_modules.h \
Pierre Ynard's avatar
Pierre Ynard committed
71
	../include/vlc_mouse.h \
72
	../include/vlc_mtime.h \
73
	../include/vlc_network.h \
74
	../include/vlc_objects.h \
75
	../include/vlc_picture.h \
76 77
	../include/vlc_picture_fifo.h \
	../include/vlc_picture_pool.h \
78
	../include/vlc_playlist.h \
79
	../include/vlc_plugin.h \
80
	../include/vlc_probe.h \
81 82
	../include/vlc_rand.h \
	../include/vlc_services_discovery.h \
83
	../include/vlc_fingerprinter.h \
84
	../include/vlc_interrupt.h \
85
	../include/vlc_renderer_discovery.h \
86
	../include/vlc_sout.h \
87
	../include/vlc_spu.h \
88
	../include/vlc_stream.h \
89
	../include/vlc_stream_extractor.h \
90
	../include/vlc_strings.h \
91
	../include/vlc_subpicture.h \
92
	../include/vlc_text_style.h \
93
	../include/vlc_threads.h \
94
	../include/vlc_timestamp_helper.h \
95
	../include/vlc_tls.h \
96
	../include/vlc_url.h \
97
	../include/vlc_variables.h \
98
	../include/vlc_viewpoint.h \
99
	../include/vlc_vlm.h \
100
	../include/vlc_video_splitter.h \
101
	../include/vlc_vout.h \
102
	../include/vlc_vout_display.h \
103
	../include/vlc_vout_osd.h \
104
	../include/vlc_vout_window.h \
105
	../include/vlc_xml.h \
106
	../include/vlc_xlib.h \
107
	$(NULL)
108
nodist_pluginsinclude_HEADERS = ../include/vlc_about.h
109

110
noinst_HEADERS = \
111
	../include/vlc_codecs.h \
112
	../include/vlc_extensions.h \
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
113
	../include/vlc_fixups.h \
114
	../include/vlc_intf_strings.h \
115
	../include/vlc_iso_lang.h \
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
116
	../include/vlc_pgpkey.h \
117 118
	../include/vlc_update.h \
	../include/vlc_vod.h \
Pierre Ynard's avatar
Pierre Ynard committed
119
	../include/vlc_vout_wrapper.h \
120 121
	$(NULL)

122
../include/vlc_about.h: Makefile.am $(top_srcdir)/COPYING $(top_srcdir)/THANKS $(top_srcdir)/AUTHORS
123 124 125 126 127 128 129
	$(AM_V_at)rm -f -- "$@.tmp"
	$(AM_V_at)mkdir -p -- ../include
	$(AM_V_GEN)(echo "/* Automatically generated file - DO NOT EDIT */" && \
	echo "static const char psz_license[] =" && \
	sed 's/"/\\"/g;s/^.*$$/\"&\\n\"/' "$(top_srcdir)/COPYING" && \
	echo ";" && \
	echo "static const char psz_thanks[] =" && \
130
	sed '/\$$Id:/d;s/"/\\"/g;s/<.*.> //;s/^.*$$/\"&\\n\"/' \
131 132 133
		"$(top_srcdir)/THANKS" && \
	echo ";" && \
	echo "static const char psz_authors[] =" && \
134
	sed '/\$$Id:/d;s/"/\\"/g;s/<.*.> //;s/^.*$$/\"&\\n\"/' \
135 136 137
		"$(top_srcdir)/AUTHORS" && \
	echo ";") >> "$@.tmp"
	$(AM_V_at)mv -f -- "$@.tmp" "$@"
138

139 140 141 142 143
###############################################################################
# pkg-config integration
###############################################################################

pkgconfigdir = $(libdir)/pkgconfig
144
pkgconfig_DATA = vlc-plugin.pc
145 146
CLEANFILES += $(pkgconfig_DATA)

147
.pc.in.pc: $(top_builddir)/config.status
148
	$(AM_V_GEN)cd "$(top_builddir)" && \
149 150
	$(SHELL) ./config.status --file="src/$@"

151 152 153 154 155 156 157 158 159 160 161 162 163
##############################################################################
# Windows resource files
##############################################################################

if HAVE_WIN32
noinst_DATA = libvlc_win32_rc.rc
endif
EXTRA_DIST += libvlc_win32_rc.rc.in

.rc.in.rc: $(top_builddir)/config.status
	cd "$(top_builddir)" && \
	$(SHELL) ./config.status --file="src/$@"

164 165 166 167
###############################################################################
# Building libvlc
###############################################################################

168
lib_LTLIBRARIES = libvlccore.la
169

170
AM_CPPFLAGS = $(INCICONV) $(IDN_CFLAGS) \
171
	-DMODULE_STRING=\"core\" \
172
	-DSYSDATADIR=\"$(datadir)\" \
173
	-DLIBDIR=\"$(libdir)\" \
174
	-DLIBEXECDIR=\"$(libexecdir)\" \
175
	-DLOCALEDIR=\"$(localedir)\" \
176
	-DPKGDATADIR=\"$(pkgdatadir)\" \
177 178
	-DPKGLIBDIR=\"$(pkglibdir)\" \
	-DPKGLIBEXECDIR=\"$(pkglibexecdir)\"
179
AM_CFLAGS = $(CFLAGS_libvlccore)
180 181 182
if HAVE_DYNAMIC_PLUGINS
AM_CPPFLAGS += -DHAVE_DYNAMIC_PLUGINS
endif
183 184 185 186
if HAVE_DBUS
AM_CPPFLAGS += -DHAVE_DBUS
AM_CFLAGS += $(DBUS_CFLAGS)
endif
187

188
libvlccore_la_SOURCES = \
189 190
	libvlc.c \
	libvlc.h \
191
	libvlc-module.c \
192
	missing.c \
193
	revision.c \
194
	version.c \
195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210
	config/configuration.h \
	config/core.c \
	config/chain.c \
	config/file.c \
	config/help.c \
	config/intf.c \
	config/cmdline.c \
	config/getopt.c \
	config/vlc_getopt.h \
	extras/libc.c \
	modules/modules.h \
	modules/modules.c \
	modules/bank.c \
	modules/cache.c \
	modules/entry.c \
	modules/textdomain.c \
211
	interface/dialog.c \
212
	interface/interface.c \
213
	playlist/playlist_internal.h \
214
	playlist/art.c \
Christophe Mutricy's avatar
Christophe Mutricy committed
215
	playlist/art.h \
216
	playlist/aout.c \
217 218 219
	playlist/thread.c \
	playlist/control.c \
	playlist/engine.c \
220
	playlist/fetcher.c \
Christophe Mutricy's avatar
Christophe Mutricy committed
221
	playlist/fetcher.h \
222 223
	playlist/sort.c \
	playlist/loadsave.c \
224
	playlist/preparser.c \
Christophe Mutricy's avatar
Christophe Mutricy committed
225
	playlist/preparser.h \
226
	playlist/tree.c \
227
	playlist/item.c \
228
	playlist/search.c \
229
	playlist/services_discovery.c \
230
	playlist/renderer.c \
231
	input/item.c \
232 233 234 235 236
	input/access.c \
	input/clock.c \
	input/control.c \
	input/decoder.c \
	input/demux.c \
237
	input/demux_chained.c \
238
	input/es_out.c \
239
	input/es_out_timeshift.c \
240
	input/event.c \
241
	input/input.c \
Christophe Mutricy's avatar
Christophe Mutricy committed
242
	input/info.h \
243
	input/meta.c \
244 245
	input/clock.h \
	input/decoder.h \
246
	input/demux.h \
247
	input/es_out.h \
248
	input/es_out_timeshift.h \
249
	input/event.h \
250
	input/item.h \
251
	input/mrl_helpers.h \
252
	input/stream.h \
253
	input/input_internal.h \
254
	input/input_interface.h \
255
	input/vlm_internal.h \
Laurent Aimar's avatar
Laurent Aimar committed
256
	input/vlm_event.h \
257 258
	input/resource.h \
	input/resource.c \
259
	input/services_discovery.c \
260
	input/stats.c \
261
	input/stream.c \
262
	input/stream_fifo.c \
263
	input/stream_extractor.c \
264
	input/stream_filter.c \
265
	input/stream_memory.c \
266 267
	input/subtitles.c \
	input/var.c \
268 269 270 271 272 273
	audio_output/aout_internal.h \
	audio_output/common.c \
	audio_output/dec.c \
	audio_output/filters.c \
	audio_output/output.c \
	audio_output/volume.c \
Rémi Duraffort's avatar
Rémi Duraffort committed
274
	video_output/chrono.h \
275 276
	video_output/control.c \
	video_output/control.h \
277 278
	video_output/display.c \
	video_output/display.h \
Pierre Ynard's avatar
Pierre Ynard committed
279
	video_output/event.h \
280 281
	video_output/inhibit.c \
	video_output/inhibit.h \
282 283
	video_output/interlacing.c \
	video_output/interlacing.h \
284 285
	video_output/snapshot.c \
	video_output/snapshot.h \
286
	video_output/statistic.h \
287 288
	video_output/video_output.c \
	video_output/video_text.c \
289
	video_output/video_epg.c \
290 291
	video_output/video_widgets.c \
	video_output/vout_subpictures.c \
292
	video_output/vout_spuregion_helper.h \
293
	video_output/window.c \
294
	video_output/window.h \
295
	video_output/opengl.c \
296
	video_output/vout_intf.c \
Laurent Aimar's avatar
Laurent Aimar committed
297
	video_output/vout_internal.h \
298
	video_output/vout_control.h \
299
	video_output/vout_wrapper.c \
300
	network/getaddrinfo.c \
301
	network/http_auth.c \
302
	network/httpd.c \
303 304 305
	network/io.c \
	network/tcp.c \
	network/udp.c \
306
	network/rootbind.c \
307
	network/stream.c \
308
	network/tls.c \
309
	text/charset.c \
310
	text/memstream.c \
311 312
	text/strings.c \
	text/unicode.c \
313
	text/url.c \
314
	text/filesystem.c \
315 316
	text/iso_lang.c \
	text/iso-639_def.h \
317
	misc/actions.c \
318 319
	misc/background_worker.c \
	misc/background_worker.h \
320
	misc/md5.c \
321
	misc/probe.c \
322
	misc/rand.c \
323 324
	misc/mtime.c \
	misc/block.c \
325
	misc/fifo.c \
326
	misc/fourcc.c \
327
	misc/fourcc_list.h \
328
	misc/es_format.c \
329
	misc/picture.c \
330
	misc/picture.h \
331 332
	misc/picture_fifo.c \
	misc/picture_pool.c \
333 334
	misc/interrupt.h \
	misc/interrupt.c \
Thomas Guillem's avatar
Thomas Guillem committed
335
	misc/keystore.c \
336
	misc/renderer_discovery.c \
337 338
	misc/threads.c \
	misc/cpu.c \
339
	misc/epg.c \
340
	misc/exit.c \
341
	misc/events.c \
342 343
	misc/image.c \
	misc/messages.c \
344
	misc/mime.c \
345
	misc/objects.c \
346
	misc/objres.c \
347
	misc/variables.h \
348 349 350
	misc/variables.c \
	misc/error.c \
	misc/xml.c \
351
	misc/addons.c \
352
	misc/filter.c \
353
	misc/filter_chain.c \
354
	misc/httpcookies.c \
355
	misc/fingerprinter.c \
356
	misc/text_style.c \
357
	misc/subpicture.c \
358
	misc/subpicture.h
359 360 361 362
libvlccore_la_LIBADD = $(LIBS_libvlccore) \
	../compat/libcompat.la \
	$(LTLIBINTL) $(LTLIBICONV) \
	$(IDN_LIBS) $(LIBPTHREAD) $(SOCKET_LIBS) $(LIBRT) $(LIBDL) $(LIBM)
363

364 365 366 367 368 369 370
if HAVE_WIN32
libvlccore_la_SOURCES += \
	win32/dirs.c \
	win32/error.c \
	win32/filesystem.c \
	win32/netconf.c \
	win32/plugin.c \
371
	win32/rand.c \
372
	win32/specific.c \
373 374
	win32/thread.c \
	win32/winsock.c
375 376 377 378 379
if HAVE_WINSTORE
libvlccore_la_SOURCES += posix/timer.c
else
libvlccore_la_SOURCES += win32/timer.c
endif
380 381 382 383 384 385
else
if HAVE_OS2
libvlccore_la_SOURCES += \
	os2/dirs.c \
	darwin/error.c \
	os2/filesystem.c \
386
	os2/getaddrinfo.c \
387 388 389
	os2/netconf.c \
	os2/plugin.c \
	os2/specific.c \
390 391 392
	os2/rand.c \
	os2/thread.c
else
393 394 395 396 397 398 399 400 401 402
if HAVE_NACL
libvlccore_la_SOURCES += \
	android/error.c \
	posix/dirs.c \
	posix/filesystem.c \
	posix/netconf.c \
	posix/rand.c \
	posix/specific.c \
	posix/timer.c
else
403 404 405 406 407 408 409 410 411
libvlccore_la_SOURCES += \
	posix/filesystem.c \
	posix/plugin.c \
	posix/rand.c \
	posix/timer.c
if HAVE_ANDROID
libvlccore_la_SOURCES += \
	android/error.c \
	android/specific.c \
Thomas Guillem's avatar
Thomas Guillem committed
412 413 414
	android/thread.c \
	linux/cpu.c \
	linux/dirs.c \
415
	linux/thread.c
416 417 418 419 420 421 422 423
else
if HAVE_DARWIN
libvlccore_la_SOURCES += \
	darwin/dirs.c \
	darwin/error.c \
	darwin/netconf.c \
	darwin/specific.c \
	darwin/thread.c
424 425 426 427 428 429
else
libvlccore_la_SOURCES += \
	posix/dirs.c \
	posix/error.c \
	posix/netconf.c \
	posix/specific.c \
430 431 432 433 434
	posix/thread.c
if HAVE_LINUX
libvlccore_la_SOURCES += \
	linux/cpu.c \
	linux/dirs.c \
435
	linux/filesystem.c \
436
	linux/thread.c
437 438 439 440
endif
if HAVE_LIBANL
libvlccore_la_SOURCES += \
	linux/getaddrinfo.c
441 442 443 444 445 446 447 448
libvlccore_la_LIBADD += -lanl
else
libvlccore_la_SOURCES += \
	posix/getaddrinfo.c
endif
endif
endif
endif
449
endif
450
endif
451

452 453 454 455 456 457 458 459
if ENABLE_SOUT
libvlccore_la_SOURCES += \
	stream_output/sap.c stream_output/sdp.c \
	stream_output/stream_output.c stream_output/stream_output.h
if ENABLE_VLM
libvlccore_la_SOURCES += input/vlm.c input/vlm_event.c input/vlmshell.c
endif
endif
460

461 462 463 464 465 466 467 468 469
if UPDATE_CHECK
libvlccore_la_SOURCES += \
	misc/update.h misc/update.c \
	misc/update_crypto.c
AM_CPPFLAGS += -DUPDATE_CHECK
AM_CFLAGS += $(GCRYPT_CFLAGS)
libvlccore_la_LIBADD += $(GCRYPT_LIBS)
endif

470 471
libvlccore_la_LDFLAGS = \
	$(LDFLAGS_libvlccore) \
472
	-no-undefined \
473
	-export-symbols $(srcdir)/libvlccore.sym \
474
	-version-info 9:0:0
475 476 477
libvlccore_la_DEPENDENCIES = libvlccore.sym
if HAVE_WIN32
libvlccore_la_DEPENDENCIES += libvlc_win32_rc.$(OBJEXT)
478
libvlccore_la_LDFLAGS += -Wl,libvlc_win32_rc.$(OBJEXT) -avoid-version -Wc,-static $(LIBCOM)
479 480 481 482 483 484 485
endif
if HAVE_OS2
libvlccore_la_LDFLAGS += -avoid-version
endif
if HAVE_DBUS
libvlccore_la_LIBADD += $(DBUS_LIBS)
endif
486 487 488
if HAVE_DARWIN
libvlccore_la_LDFLAGS += -Xlinker -install_name -Xlinker @rpath/libvlccore.dylib
endif
489

490
libvlc_win32_rc.$(OBJEXT): libvlc_win32_rc.rc $(top_srcdir)/extras/package/win32/libvlc.dll.manifest
491
	$(WINDRES) --include-dir $(top_srcdir)/share --include-dir $(top_srcdir)/extras/package/win32 -i $< -o $@
492

493 494 495
# FourCC tables
BUILT_SOURCES += fourcc_tables.h
EXTRA_DIST += misc/fourcc_gen.c
496
MOSTLYCLEANFILES = fourcc_gen$(BUILDEXEEXT)
497

498
fourcc_gen$(BUILDEXEEXT): misc/fourcc_gen.c misc/fourcc_list.h ../include/vlc_fourcc.h
499 500 501
	$(AM_V_at)rm -f -- $@
	$(AM_V_CC)$(BUILDCC) -I$(srcdir) -o $@ $<

502
fourcc_tables.h: fourcc_gen$(BUILDEXEEXT)
503
	$(AM_V_at)rm -f -- $@.tmp
504
	$(AM_V_GEN)$(builddir)/fourcc_gen$(BUILDEXEEXT) > $@.tmp
505 506
	$(AM_V_at)mv -f -- $@.tmp $@

507 508 509 510 511 512
# Unit/regression tests
#
check_PROGRAMS = \
	test_block \
	test_dictionary \
	test_i18n_atof \
513
	test_interrupt \
514
	test_md5 \
515
	test_picture_pool \
516
	test_sort \
517 518 519 520
	test_timer \
	test_url \
	test_utf8 \
	test_xmlent \
521 522
	test_headers \
	test_mrl_helpers
523

524
TESTS = $(check_PROGRAMS) check_symbols
525 526 527 528 529 530 531

test_block_SOURCES = test/block_test.c
test_block_LDADD = $(LDADD) $(LIBS_libvlccore)
test_block_DEPENDENCIES =

test_dictionary_SOURCES = test/dictionary.c
test_i18n_atof_SOURCES = test/i18n_atof.c
532 533
test_interrupt_SOURCES = test/interrupt.c
test_interrupt_LDADD = $(LDADD) $(LIBS_libvlccore) $(LIBPTHREAD)
534
test_md5_SOURCES = test/md5.c
535
test_picture_pool_SOURCES = test/picture_pool.c
536
test_sort_SOURCES = test/sort.c
537 538 539 540 541
test_timer_SOURCES = test/timer.c
test_url_SOURCES = test/url.c
test_utf8_SOURCES = test/utf8.c
test_xmlent_SOURCES = test/xmlent.c
test_headers_SOURCES = test/headers.c
542
test_mrl_helpers_SOURCES = test/mrl_helpers.c
543 544 545 546 547

AM_LDFLAGS = -no-install
LDADD = libvlccore.la \
	../compat/libcompat.la

Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
548 549 550 551 552
###############################################################################
# GIT revision
###############################################################################

BUILT_SOURCES += stamp-revision
553
MAINTAINERCLEANFILES = $(srcdir)/revision.txt $(srcdir)/revision.c
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
554

555 556 557 558
$(srcdir)/revision.c: $(srcdir)/revision.txt
	$(AM_V_at)rm -f -- $@
	$(AM_V_GEN)echo "const char psz_vlc_changeset[] = \"$$(cat $<)\";" \
		> $@
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
559

560
$(srcdir)/revision.txt:
561
	$(AM_V_at)$(MAKE) stamp-revision
562
	$(AM_V_GEN)touch $@
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
563 564

stamp-revision:
565
	$(AM_V_at)rm -f -- revision.tmp
566 567 568 569 570 571
	$(AM_V_GEN)if ! git \
			--git-dir="$(top_srcdir)/.git/" describe \
			--tags --long --match '?.*.*' --always; then \
		cat $(srcdir)/revision.txt ; \
	fi > revision.tmp
	$(AM_V_at)if diff revision.tmp $(srcdir)/revision.txt >/dev/null 2>&1; then \
572 573
		rm -f -- revision.tmp; \
	else \
574 575 576
		mv -f -- revision.tmp $(srcdir)/revision.txt; \
	fi
#2>&1
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
577

578 579 580
###############################################################################
# Unit/regression test
###############################################################################
581

582
dist_check_SCRIPTS = check_headers check_symbols
583

584
check-local:
585
	for h in `echo $(pkginclude_HEADERS) | sed -e s,\.\./include/,,g`; \
586 587 588 589 590 591 592 593
	do \
		echo grep - "#include <$$h>" $(srcdir)/test/headers.c ; \
		if ! grep -- "#include <$$h>" $(srcdir)/test/headers.c ; \
		then \
			echo "Header $$h not included in test/headers.c!"; \
			exit 1; \
		fi ; \
	done
594
	$(SHELL) $(srcdir)/check_headers $(pluginsinclude_HEADERS)
595

596
FORCE:
597 598 599 600
	@echo "Generated source cannot be phony. Go away." >&2
	@exit 1

.PHONY: FORCE