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

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

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

143
	mv -f -- "$@.tmp" "$@"
144

145 146 147 148 149
###############################################################################
# pkg-config integration
###############################################################################

pkgconfigdir = $(libdir)/pkgconfig
150
pkgconfig_DATA = libvlc.pc vlc-plugin.pc
151 152
CLEANFILES += $(pkgconfig_DATA)

153 154 155 156
.pc.in.pc: $(top_builddir)/config.status
	cd "$(top_builddir)" && \
	$(SHELL) ./config.status --file="src/$@"

157 158 159 160
###############################################################################
# Building libvlc
###############################################################################

161 162 163
nice:
	$(top_builddir)/compile

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

166
AM_LDFLAGS = -no-undefined
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
167
if HAVE_WIN32
168
AM_LDFLAGS += -avoid-version
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
169
endif
170 171 172
if HAVE_WINCE
AM_LDFLAGS += -avoid-version
endif
173

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

195 196 197
libvlc_win32_rc.$(OBJEXT): $(top_builddir)/share/libvlc_win32_rc.rc
	$(WINDRES) --include-dir $(top_srcdir)/share -i $< -o $@

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

212

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

262
SOURCES_libvlc_beos = \
263
	misc/pthread.c \
264 265 266
	$(NULL)

SOURCES_libvlc_darwin = \
267
	config/dirs_macos.c \
268
	misc/pthread.c \
269
	misc/darwin_specific.c \
270 271
	$(NULL)

272
SOURCES_libvlc_linux = \
273
	config/dirs_xdg.c \
274
	misc/pthread.c \
275 276 277
	misc/linux_specific.c \
	$(NULL)

278
SOURCES_libvlc_win32 = \
279
	config/dirs_win.c \
280
	misc/w32thread.c \
281
	misc/win32_specific.c \
282
	network/winsock.c \
283 284
	$(NULL)

285
SOURCES_libvlc_other = \
286
	config/dirs_xdg.c \
287 288
	misc/pthread.c \
	misc/not_specific.c
289

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

443 444 445 446
SOURCES_libvlc_httpd = \
	network/httpd.c \
	$(NULL)

447 448 449 450 451 452 453 454
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)

455 456
SOURCES_libvlc_vlm = \
	input/vlm.c \
Laurent Aimar's avatar
Laurent Aimar committed
457
	input/vlm_event.c \
458 459 460
	input/vlmshell.c \
	$(NULL)

461 462 463 464 465 466 467 468 469
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)

470
SOURCES_libvlc_control = \
Clément Stenac's avatar
Clément Stenac committed
471
	control/libvlc_internal.h \
472
	control/event_internal.h \
473 474 475 476
	control/media_internal.h \
	control/media_list_internal.h \
	control/media_list_view_internal.h \
	control/media_player_internal.h \
477
	control/core.c \
478
	control/error.c \
479 480 481 482 483
	control/log.c \
	control/playlist.c \
	control/vlm.c \
	control/video.c \
	control/audio.c \
Filippo Carone's avatar
Filippo Carone committed
484
	control/event.c \
485
	control/event_async.c \
486
	control/flat_media_list_view.c \
487
	control/hierarchical_media_list_view.c \
488
	control/hierarchical_node_media_list_view.c \
489 490
	control/media.c \
	control/media_player.c \
491
	control/media_list.c \
492
	control/media_list_path.h \
493
	control/media_list_player.c \
494
	control/media_list_view.c \
495
	control/media_library.c \
Clément Stenac's avatar
Clément Stenac committed
496
	control/mediacontrol_internal.h \
497 498
	control/mediacontrol_core.c \
	control/mediacontrol_util.c \
499
	control/mediacontrol_audio_video.c \
500
	control/media_discoverer.c
501

Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
502 503 504 505 506 507 508 509 510
###############################################################################
# GIT revision
###############################################################################

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

revision.c: revision.txt
	rm -f -- revision.c
511
	echo "const char psz_vlc_changeset[] = \"$$(cat revision.txt)\";" \
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
512 513 514 515 516 517 518 519
		> revision.c

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

stamp-revision:
	rm -f -- revision.tmp
520 521
	(git --git-dir="$(top_srcdir)/.git/" describe --tags --long \
		--always || echo exported) > revision.tmp
522 523 524 525 526
	if diff revision.tmp revision.txt >/dev/null; then \
		rm -f -- revision.tmp; \
	else \
		mv -f -- revision.tmp revision.txt; \
	fi 2>&1
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
527

528 529 530
###############################################################################
# Unit/regression test
###############################################################################
531

532
dist_check_SCRIPTS = check_symbols check_headers
533
TESTS = check_symbols
534

535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550
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

551
check-local:
552
	for h in `echo $(pkginclude_HEADERS) | sed -e s,\.\./include/,,g`; \
553 554 555 556 557 558 559 560
	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
561
	$(srcdir)/check_headers $(pkginclude_HEADERS)
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
562
	$(srcdir)/check_headers $(pluginsinclude_HEADERS)
563

564
FORCE:
565 566 567 568
	@echo "Generated source cannot be phony. Go away." >&2
	@exit 1

.PHONY: FORCE