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

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

120 121 122 123 124
../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
125
	sed 's/"/\\"/g;s/^.*$$/\"&\\n\"/' "$(top_srcdir)/COPYING" >> "$@.tmp"
126 127
	echo ";" >> "$@.tmp"
	echo "static const char psz_thanks[] =" >> "$@.tmp"
JP Dinger's avatar
JP Dinger committed
128 129
	sed '/\$$Id:/d;s/"/\\"/g;s/<.*.> //;s/^.*$$/\"&\\n\"/' \
		"$(top_srcdir)/THANKS" >> "$@.tmp"
130 131
	echo ";" >> "$@.tmp"
	echo "static const char psz_authors[] =" >> "$@.tmp"
JP Dinger's avatar
JP Dinger committed
132 133
	sed -n '/^N: /{;s///;s/"/\\"/g;s/^.*$$/\"&\\n\"/;p;}' \
		"$(top_srcdir)/AUTHORS" >> "$@.tmp"
134
	echo ";" >> "$@.tmp"
JP Dinger's avatar
JP Dinger committed
135

136
	mv -f -- "$@.tmp" "$@"
137

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

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

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

150 151 152 153
###############################################################################
# Building libvlc
###############################################################################

154 155 156
nice:
	$(top_builddir)/compile

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

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

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

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

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

205

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

255
SOURCES_libvlc_beos = \
256
	misc/pthread.c \
257 258 259
	$(NULL)

SOURCES_libvlc_darwin = \
260
	misc/pthread.c \
261
	misc/darwin_specific.c \
262 263
	$(NULL)

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

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

275 276 277
SOURCES_libvlc_other = \
	misc/pthread.c \
	misc/not_specific.c
278

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

425 426 427 428
SOURCES_libvlc_httpd = \
	network/httpd.c \
	$(NULL)

429 430 431 432 433 434 435 436
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)

437 438
SOURCES_libvlc_vlm = \
	input/vlm.c \
Laurent Aimar's avatar
Laurent Aimar committed
439
	input/vlm_event.c \
440 441 442
	input/vlmshell.c \
	$(NULL)

443 444 445 446 447 448 449 450 451
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)

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

Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
483 484 485 486 487 488 489 490 491
###############################################################################
# GIT revision
###############################################################################

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

revision.c: revision.txt
	rm -f -- revision.c
492
	echo "const char psz_vlc_changeset[] = \"$$(cat revision.txt)\";" \
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
493 494 495 496 497 498 499 500
		> revision.c

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

stamp-revision:
	rm -f -- revision.tmp
501 502
	(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
503 504 505
	diff revision.tmp revision.txt >/dev/null 2>&1 || \
	mv -f -- revision.tmp revision.txt

506 507 508
###############################################################################
# Unit/regression test
###############################################################################
509

510
dist_check_SCRIPTS = check_symbols check_headers
511
TESTS = check_symbols
512

513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528
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

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

542
FORCE:
543 544 545 546
	@echo "Generated source cannot be phony. Go away." >&2
	@exit 1

.PHONY: FORCE