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

5
AUTOMAKE_OPTIONS = subdir-objects
6
SUBDIRS = . test
7

8
NULL =
9
EXTRA_DIST = extras/COPYING \
10
	misc/beos_specific.cpp \
11
	libvlc.pc.in \
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
12
	vlc-plugin.pc.in \
13
	libvlc.sym \
14
	libvlccore.sym
15

16
BUILT_SOURCES = ../include/vlc_about.h
Christophe Mutricy's avatar
Christophe Mutricy committed
17
CLEANFILES = $(BUILT_SOURCES)
18

19 20
SUFFIXES = .pc.in .pc

21 22 23 24
###############################################################################
# Headers
###############################################################################

25
pluginsincludedir = $(pkgincludedir)/plugins
26

27
pkginclude_HEADERS = \
28
	../include/vlc/vlc.h \
29
	../include/vlc/deprecated.h \
30
	../include/vlc/libvlc.h \
31
	../include/vlc/libvlc_events.h \
32 33 34 35 36 37 38 39
	../include/vlc/libvlc_media.h \
	../include/vlc/libvlc_media_discoverer.h \
	../include/vlc/libvlc_media_library.h \
	../include/vlc/libvlc_media_list.h \
	../include/vlc/libvlc_media_list_player.h \
	../include/vlc/libvlc_media_list_view.h \
	../include/vlc/libvlc_media_player.h \
	../include/vlc/libvlc_structures.h \
40
	../include/vlc/libvlc_vlm.h \
41 42 43 44
	../include/vlc/mediacontrol.h \
	../include/vlc/mediacontrol_structures.h \
	$(NULL)

45
pluginsinclude_HEADERS = \
46 47
	../include/vlc_access.h \
	../include/vlc_acl.h \
48
	../include/vlc_aout.h \
49
	../include/vlc_aout_mixer.h \
50
	../include/vlc_arrays.h \
51
	../include/vlc_avcodec.h \
52 53 54 55 56
	../include/vlc_bits.h \
	../include/vlc_block.h \
	../include/vlc_block_helper.h \
	../include/vlc_charset.h \
	../include/vlc_codec.h \
57 58
	../include/vlc_common.h \
	../include/vlc_config.h \
59
	../include/vlc_config_cat.h \
60
	../include/vlc_configuration.h \
61
	../include/vlc_dialog.h \
62
	../include/vlc_demux.h \
63
	../include/vlc_epg.h \
64
	../include/vlc_es.h \
65 66
	../include/vlc_es_out.h \
	../include/vlc_events.h \
67
	../include/vlc_filter.h \
68
	../include/vlc_fourcc.h \
69
	../include/vlc_gcrypt.h \
70
	../include/vlc_http.h \
71
	../include/vlc_httpd.h \
72 73
	../include/vlc_image.h \
	../include/vlc_input.h \
74
	../include/vlc_input_item.h \
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
75
	../include/vlc_main.h \
76
	../include/vlc_md5.h \
77
	../include/vlc_messages.h \
78
	../include/vlc_meta.h \
79 80 81
	../include/vlc_modules.h \
	../include/vlc_mtime.h \
	../include/vlc_objects.h \
82
	../include/vlc_picture.h \
83 84
	../include/vlc_picture_fifo.h \
	../include/vlc_picture_pool.h \
85
	../include/vlc_playlist.h \
86
	../include/vlc_plugin.h \
87 88 89
	../include/vlc_rand.h \
	../include/vlc_services_discovery.h \
	../include/vlc_sout.h \
90 91
	../include/vlc_stream.h \
	../include/vlc_strings.h \
92
	../include/vlc_subpicture.h \
93
	../include/vlc_threads.h \
94
	../include/vlc_url.h \
95 96
	../include/vlc_variables.h \
	../include/vlc_vlm.h \
97
	../include/vlc_video_splitter.h \
98
	../include/vlc_vout.h \
99
	../include/vlc_vout_display.h \
100
	../include/vlc_vout_window.h \
101
	../include/vlc_xml.h \
102
	$(NULL)
103

104
noinst_HEADERS = \
105
	../include/mmx.h \
106
	../include/vlc_codec_synchro.h \
107 108
	../include/vlc_codecs.h \
	../include/vlc_devices.h \
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
109
	../include/vlc_fixups.h \
110
	../include/vlc_interface.h \
111
	../include/vlc_intf_strings.h \
112
	../include/vlc_iso_lang.h \
113
	../include/vlc_keys.h \
114
	../include/vlc_network.h \
115
	../include/vlc_osd.h \
Rémi Denis-Courmont's avatar
Tabs  
Rémi Denis-Courmont committed
116
	../include/vlc_pgpkey.h \
117
	../include/vlc_tls.h \
118 119 120 121
	../include/vlc_update.h \
	../include/vlc_vod.h \
	$(NULL)

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

138
	mv -f -- "$@.tmp" "$@"
139

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

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

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

152 153 154 155
###############################################################################
# Building libvlc
###############################################################################

156 157 158
nice:
	$(top_builddir)/compile

159
lib_LTLIBRARIES = libvlccore.la libvlc.la
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
160

161
AM_LDFLAGS = -no-undefined
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
162
if HAVE_WIN32
163
AM_LDFLAGS += -avoid-version
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
164
endif
165 166 167
if HAVE_WINCE
AM_LDFLAGS += -avoid-version
endif
168

169
libvlccore_la_SOURCES = $(SOURCES_libvlc)
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
170
nodist_libvlccore_la_SOURCES = revision.c
171
libvlccore_la_CFLAGS = `$(VLC_CONFIG) --cflags libvlccore` \
172
	-DMODULE_STRING=\"main\" \
173
	-DLOCALEDIR=\"$(localedir)\" \
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
174
	-DSYSCONFDIR=\"$(sysconfdir)\" \
175
	-DDATA_PATH=\"$(vlcdatadir)\" \
176
	-DLIBDIR=\"$(libdir)\" \
177
	-DPLUGIN_PATH=\"$(vlclibdir)\"
178
libvlccore_la_LDFLAGS = `$(VLC_CONFIG) --ldflags libvlccore` $(AM_LDFLAGS) \
179
	-no-undefined \
180
	-export-symbols $(srcdir)/libvlccore.sym \
181
	-version-info 4:0:0
182
libvlccore_la_LIBADD = `$(VLC_CONFIG) -libs libvlccore` $(AM_LIBADD) \
183
	$(LTLIBINTL) ../compat/libcompat.la
184
libvlccore_la_DEPENDENCIES = libvlccore.sym
185
if HAVE_WIN32
186 187
libvlccore_la_DEPENDENCIES += libvlc_win32_rc.$(OBJEXT)
libvlccore_la_LDFLAGS += -Wl,libvlc_win32_rc.$(OBJEXT)
188
endif
189

190 191 192
libvlc_win32_rc.$(OBJEXT): $(top_builddir)/share/libvlc_win32_rc.rc
	$(WINDRES) --include-dir $(top_srcdir)/share -i $< -o $@

193
libvlc_la_SOURCES = $(SOURCES_libvlc_control)
194
nodist_libvlc_la_SOURCES = revision.c
195 196
libvlc_la_LIBADD = `$(VLC_CONFIG) -libs libvlc` \
	libvlccore.la ../compat/libcompat.la
197
libvlc_la_CFLAGS = `$(VLC_CONFIG) --cflags libvlc`
198
libvlc_la_LDFLAGS = $(AM_LDFLAGS) `$(VLC_CONFIG) --ldflags libvlc` \
199
	-version-info 5:0:0 \
200
	-export-symbols $(srcdir)/libvlc.sym
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
201
libvlc_la_DEPENDENCIES = libvlc.sym libvlccore.la
202
if HAVE_WIN32
203 204
libvlc_la_DEPENDENCIES += $(DATA_win32_rc_lib)
libvlc_la_LDFLAGS += -Wl,$(DATA_win32_rc_lib)
205 206
endif

207

208
EXTRA_libvlccore_la_SOURCES = \
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
209 210
	$(SOURCES_libvlc_beos) \
	$(SOURCES_libvlc_darwin) \
211
	$(SOURCES_libvlc_linux) \
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
212
	$(SOURCES_libvlc_win32) \
213
	$(SOURCES_libvlc_other) \
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
214 215
	$(SOURCES_libvlc_dirent) \
	$(SOURCES_libvlc_getopt) \
216
	$(SOURCES_libvlc_httpd) \
217
	$(SOURCES_libvlc_sout) \
218
	$(SOURCES_libvlc_vlm) \
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
219
	$(NULL)
220
if HAVE_BEOS
221
libvlccore_la_SOURCES += $(SOURCES_libvlc_beos)
222
else
223
if HAVE_DARWIN
224
libvlccore_la_SOURCES += $(SOURCES_libvlc_darwin)
225 226
else
if HAVE_LINUX
227
libvlccore_la_SOURCES += $(SOURCES_libvlc_linux)
228
else
229
if HAVE_WIN32
230
libvlccore_la_SOURCES += $(SOURCES_libvlc_win32)
231
else
232
if HAVE_WINCE
233
libvlccore_la_SOURCES += $(SOURCES_libvlc_win32)
234
else
235
libvlccore_la_SOURCES += $(SOURCES_libvlc_other)
236
endif
237 238 239 240
endif
endif
endif
endif
241
if BUILD_DIRENT
242
libvlccore_la_SOURCES += $(SOURCES_libvlc_dirent)
243 244
endif
if BUILD_GETOPT
245
libvlccore_la_SOURCES += $(SOURCES_libvlc_getopt)
246
endif
247 248 249
if BUILD_HTTPD
libvlccore_la_SOURCES += $(SOURCES_libvlc_httpd)
endif
250
if ENABLE_SOUT
251
libvlccore_la_SOURCES += $(SOURCES_libvlc_sout)
252 253 254
if ENABLE_VLM
libvlccore_la_SOURCES += $(SOURCES_libvlc_vlm)
endif
255
endif
256

257
SOURCES_libvlc_beos = \
258
	misc/pthread.c \
259 260 261
	$(NULL)

SOURCES_libvlc_darwin = \
262
	misc/pthread.c \
263
	misc/darwin_specific.c \
264 265
	$(NULL)

266
SOURCES_libvlc_linux = \
267
	misc/pthread.c \
268 269 270
	misc/linux_specific.c \
	$(NULL)

271
SOURCES_libvlc_win32 = \
272
	misc/w32thread.c \
273
	misc/win32_specific.c \
274
	network/winsock.c \
275 276
	$(NULL)

277 278 279
SOURCES_libvlc_other = \
	misc/pthread.c \
	misc/not_specific.c
280

281 282 283 284 285 286 287 288 289 290 291 292 293
SOURCES_libvlc_dirent = \
	extras/dirent.c \
	$(NULL)

SOURCES_libvlc_getopt = \
	extras/getopt.c \
	extras/getopt.h \
	extras/getopt1.c \
	$(NULL)

SOURCES_libvlc_common = \
	libvlc.c \
	libvlc.h \
294
	libvlc-module.c \
295
	missing.c \
296
	version.c \
297
	interface/dialog.c \
298 299
	interface/interface.c \
	interface/intf_eject.c \
300
	playlist/playlist_internal.h \
301
	playlist/art.c \
Christophe Mutricy's avatar
Christophe Mutricy committed
302
	playlist/art.h \
303 304 305
	playlist/thread.c \
	playlist/control.c \
	playlist/engine.c \
306
	playlist/fetcher.c \
Christophe Mutricy's avatar
Christophe Mutricy committed
307
	playlist/fetcher.h \
308 309
	playlist/sort.c \
	playlist/loadsave.c \
310
	playlist/preparser.c \
Christophe Mutricy's avatar
Christophe Mutricy committed
311
	playlist/preparser.h \
312
	playlist/tree.c \
313
	playlist/item.c \
314
	playlist/search.c \
315
	playlist/services_discovery.c \
316
	input/item.c \
317 318 319 320
	input/access.c \
	input/clock.c \
	input/control.c \
	input/decoder.c \
321
	input/decoder_synchro.c \
322 323
	input/demux.c \
	input/es_out.c \
324
	input/es_out_timeshift.c \
325
	input/event.c \
326
	input/input.c \
327
	input/meta.c \
328
	input/access.h \
329 330
	input/clock.h \
	input/decoder.h \
331
	input/demux.h \
332
	input/es_out.h \
333
	input/es_out_timeshift.h \
334
	input/event.h \
335
	input/item.h \
336
	input/stream.h \
337
	input/input_internal.h \
338
	input/input_interface.h \
339
	input/vlm_internal.h \
Laurent Aimar's avatar
Laurent Aimar committed
340
	input/vlm_event.h \
341 342
	input/resource.h \
	input/resource.c \
343
	input/stream.c \
344
	input/stream_demux.c \
345
	input/stream_filter.c \
346
	input/stream_memory.c \
347 348
	input/subtitles.c \
	input/var.c \
349 350
	video_output/display.c \
	video_output/display.h \
351 352
	video_output/snapshot.c \
	video_output/snapshot.h \
353
	video_output/statistic.h \
354 355 356 357 358 359
	video_output/video_output.c \
	video_output/vout_pictures.c \
	video_output/vout_pictures.h \
	video_output/video_text.c \
	video_output/video_widgets.c \
	video_output/vout_subpictures.c \
360
	video_output/window.c \
361
	video_output/vout_intf.c \
Laurent Aimar's avatar
Laurent Aimar committed
362
	video_output/vout_internal.h \
363
	video_output/vout_control.h \
Clément Stenac's avatar
Clément Stenac committed
364
	audio_output/aout_internal.h \
365 366 367
	audio_output/common.c \
	audio_output/dec.c \
	audio_output/filters.c \
368
	audio_output/input.c \
369 370 371 372 373 374 375 376 377 378 379
	audio_output/mixer.c \
	audio_output/output.c \
	audio_output/intf.c \
	osd/osd.c \
	osd/osd_text.c \
	osd/osd_widgets.c \
	network/acl.c \
	network/getaddrinfo.c \
	network/io.c \
	network/tcp.c \
	network/udp.c \
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
380
	network/rootbind.c \
381
	network/tls.c \
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
382
	network/poll.c \
383 384 385
	text/charset.c \
	text/strings.c \
	text/unicode.c \
386
	text/filesystem.c \
387
	text/wincp.c \
388 389
	text/iso_lang.c \
	text/iso-639_def.h \
390
	misc/md5.c \
391
	misc/rand.c \
392 393
	misc/mtime.c \
	misc/block.c \
394
	misc/fourcc.c \
395
	misc/es_format.c \
396 397
	modules/modules.h \
	modules/modules.c \
398
	modules/cache.c \
399
	modules/entry.c \
400
	modules/os.c \
401 402 403
	misc/threads.c \
	misc/stats.c \
	misc/cpu.c \
404
	misc/action.c \
405
	config/configuration.h \
406
	config/core.c \
407
	config/dirs.c \
408 409
	config/chain.c \
	config/file.c \
410
	config/intf.c \
411
	config/cmdline.c \
412
	misc/events.c \
413 414 415
	misc/image.c \
	misc/messages.c \
	misc/objects.c \
Clément Stenac's avatar
Clément Stenac committed
416
	misc/variables.h \
417 418
	misc/variables.c \
	misc/error.c \
Rafaël Carré's avatar
Typo  
Rafaël Carré committed
419
	misc/update.h \
420
	misc/update.c \
421
	misc/update_crypto.c \
422
	misc/xml.c \
423
	misc/devices.c \
424
	extras/libc.c \
Laurent Aimar's avatar
Laurent Aimar committed
425
	misc/filter.c \
426
	misc/filter_chain.c \
427
	misc/http_auth.c \
428 429
	$(NULL)

430 431 432 433
SOURCES_libvlc_httpd = \
	network/httpd.c \
	$(NULL)

434 435 436 437 438 439 440 441
SOURCES_libvlc_sout = \
	stream_output/stream_output.c \
	stream_output/stream_output.h \
	stream_output/announce.c \
	stream_output/sap.c \
	stream_output/sdp.c \
	$(NULL)

442 443
SOURCES_libvlc_vlm = \
	input/vlm.c \
Laurent Aimar's avatar
Laurent Aimar committed
444
	input/vlm_event.c \
445 446 447
	input/vlmshell.c \
	$(NULL)

448 449 450 451 452 453 454 455 456
SOURCES_libvlc = \
	$(SOURCES_libvlc_common) \
	$(OPT_SOURCES_libvlc_beos) \
	$(OPT_SOURCES_libvlc_darwin) \
	$(OPT_SOURCES_libvlc_win32) \
	$(OPT_SOURCES_libvlc_dirent) \
	$(OPT_SOURCES_libvlc_getopt) \
	$(NULL)

457
SOURCES_libvlc_control = \
Clément Stenac's avatar
Clément Stenac committed
458
	control/libvlc_internal.h \
459
	control/event_internal.h \
460 461 462 463
	control/media_internal.h \
	control/media_list_internal.h \
	control/media_list_view_internal.h \
	control/media_player_internal.h \
464
	control/core.c \
465
	control/error.c \
466 467 468 469 470
	control/log.c \
	control/playlist.c \
	control/vlm.c \
	control/video.c \
	control/audio.c \
Filippo Carone's avatar
Filippo Carone committed
471
	control/event.c \
472
	control/event_async.c \
473
	control/flat_media_list_view.c \
474
	control/hierarchical_media_list_view.c \
475
	control/hierarchical_node_media_list_view.c \
476 477
	control/media.c \
	control/media_player.c \
478
	control/media_list.c \
479
	control/media_list_path.h \
480
	control/media_list_player.c \
481
	control/media_list_view.c \
482
	control/media_library.c \
Clément Stenac's avatar
Clément Stenac committed
483
	control/mediacontrol_internal.h \
484 485
	control/mediacontrol_core.c \
	control/mediacontrol_util.c \
486
	control/mediacontrol_audio_video.c \
487
	control/media_discoverer.c
488

Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
489 490 491 492 493 494 495 496 497
###############################################################################
# GIT revision
###############################################################################

BUILT_SOURCES += stamp-revision
CLEANFILES += revision.txt revision.c

revision.c: revision.txt
	rm -f -- revision.c
498
	echo "const char psz_vlc_changeset[] = \"$$(cat revision.txt)\";" \
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
499 500 501 502 503 504 505 506
		> revision.c

revision.txt:
	$(MAKE) stamp-revision
	touch revision.txt

stamp-revision:
	rm -f -- revision.tmp
507 508
	(git --git-dir="$(top_srcdir)/.git/" describe --tags --long \
		--always || echo exported) > revision.tmp
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
509 510 511
	diff revision.tmp revision.txt >/dev/null 2>&1 || \
	mv -f -- revision.tmp revision.txt

512 513 514
###############################################################################
# Unit/regression test
###############################################################################
515

516
dist_check_SCRIPTS = check_symbols check_headers
517
TESTS = check_symbols
518

519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534
check_DATA = libvlc-headers.sym libvlc-sorted.sym
CLEANFILES += $(check_DATA)

libvlc-sorted.sym: libvlccore.sym
	rm -f libvlc-sorted.sym
	sort -fdu < "$(srcdir)/libvlccore.sym" > libvlc-sorted.sym

libvlc-headers.sym:
	rm -f libvlc-headers.sym
	cat ${srcdir}/../include/vlc_*.h ${srcdir}/control/*.h | \
	sed -n -e 's/^[ ]*VLC_EXPORT[ ]*([^,]*,\([^,]*\),.*/\1/p' | \
	sed -e 's/[^a-zA-Z0-9_]*//' | \
	sort -fdu > libvlc-headers.sym

.PHONY: libvlc-headers.sym

535
check-local:
536
	for h in `echo $(pkginclude_HEADERS) | sed -e s,\.\./include/,,g`; \
537 538 539 540 541 542 543 544
	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
545
	$(srcdir)/check_headers $(pkginclude_HEADERS)
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
546
	$(srcdir)/check_headers $(pluginsinclude_HEADERS)
547

548
FORCE:
549 550 551 552
	@echo "Generated source cannot be phony. Go away." >&2
	@exit 1

.PHONY: FORCE