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

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

8
NULL =
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
9
EXTRA_DIST = extras/COPYING modules/builtin.h.in \
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 = modules/builtin.h ../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_structures.h \
32 33 34
	../include/vlc/libvlc_media_list.h \
	../include/vlc/libvlc_events.h \
	../include/vlc/libvlc_vlm.h \
35 36 37 38
	../include/vlc/mediacontrol.h \
	../include/vlc/mediacontrol_structures.h \
	$(NULL)

39
pluginsinclude_HEADERS = \
40 41
	../include/vlc_access.h \
	../include/vlc_acl.h \
42
	../include/vlc_aout.h \
43
	../include/vlc_arrays.h \
44 45 46 47 48
	../include/vlc_bits.h \
	../include/vlc_block.h \
	../include/vlc_block_helper.h \
	../include/vlc_charset.h \
	../include/vlc_codec.h \
49 50
	../include/vlc_common.h \
	../include/vlc_config.h \
51
	../include/vlc_config_cat.h \
52
	../include/vlc_configuration.h \
53
	../include/vlc_demux.h \
54
	../include/vlc_epg.h \
55
	../include/vlc_es.h \
56 57
	../include/vlc_es_out.h \
	../include/vlc_events.h \
58
	../include/vlc_filter.h \
59 60
	../include/vlc_gcrypt.h \
	../include/vlc_httpd.h \
61 62
	../include/vlc_image.h \
	../include/vlc_input.h \
63
	../include/vlc_input_item.h \
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
64
	../include/vlc_main.h \
65
	../include/vlc_md5.h \
66
	../include/vlc_messages.h \
67
	../include/vlc_meta.h \
68 69 70
	../include/vlc_modules.h \
	../include/vlc_mtime.h \
	../include/vlc_objects.h \
71
	../include/vlc_playlist.h \
72
	../include/vlc_plugin.h \
73 74 75
	../include/vlc_rand.h \
	../include/vlc_services_discovery.h \
	../include/vlc_sout.h \
76 77
	../include/vlc_stream.h \
	../include/vlc_strings.h \
78
	../include/vlc_threads.h \
79
	../include/vlc_url.h \
80 81 82
	../include/vlc_variables.h \
	../include/vlc_vlm.h \
	../include/vlc_vout.h \
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
83
	../include/vlc_window.h \
84
	../include/vlc_xml.h \
85
	$(NULL)
86

87
noinst_HEADERS = \
88
	../include/mmx.h \
89
	../include/vlc_codec_synchro.h \
90 91
	../include/vlc_codecs.h \
	../include/vlc_devices.h \
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
92
	../include/vlc_fixups.h \
93
	../include/vlc_interface.h \
94
	../include/vlc_intf_strings.h \
95
	../include/vlc_iso_lang.h \
96
	../include/vlc_keys.h \
97
	../include/vlc_network.h \
98
	../include/vlc_osd.h \
Rémi Denis-Courmont's avatar
Tabs  
Rémi Denis-Courmont committed
99
	../include/vlc_pgpkey.h \
100
	../include/vlc_tls.h \
101 102 103 104
	../include/vlc_update.h \
	../include/vlc_vod.h \
	$(NULL)

105 106
modules/builtin.h: modules/builtin.h.in ../vlc-config Makefile.am
	rm -f -- "$@.tmp"
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
107
	cat "$(srcdir)/modules/builtin.h.in" > "$@.tmp"
108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126
if !HAVE_PLUGINS
	plugins="$$($(VLC_CONFIG) --list plugin)" ; \
	test -n "$${plugins}" && \
	for p in $${plugins}; do \
		echo "int vlc_entry__$$p (module_t *);" ; \
	done >> "$@.tmp"
endif
	echo "#define ALLOCATE_ALL_BUILTINS() \\" >> "$@.tmp"
	echo "    do \\" >> "$@.tmp"
	echo "    { \\" >> "$@.tmp"
if !HAVE_PLUGINS
	plugins="$$($(VLC_CONFIG) --list plugin)" ; \
	test -n "$${plugins}" && \
	for p in $${plugins}; do \
		echo "        ALLOCATE_BUILTIN($$p); \\" ; \
	done >> "$@.tmp"
endif
	echo '    } while( 0 );' >> "$@.tmp"
	mv -f -- "$@.tmp" "$@"
127

128
modules/modules.c: modules/builtin.h
129

130 131 132 133 134 135 136 137 138 139 140 141 142 143
../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"
	cat $(top_srcdir)/COPYING | sed s/'"'/'\\"'/g | $(AWK) '{ print "\""$$0"\\n\"" }' >> "$@.tmp"
	echo ";" >> "$@.tmp"
	echo "static const char psz_thanks[] =" >> "$@.tmp"
	grep -v '$$Id:'  $(top_srcdir)/THANKS | sed s/'"'/'\\"'/g | $(AWK) '{ print "\""$$0"\\n\"" }'|sed s/"<.*.> "// >> "$@.tmp"
	echo ";" >> "$@.tmp"
	echo "static const char psz_authors[] =" >> "$@.tmp"
	grep N: $(top_srcdir)/AUTHORS | cut -d" " -f 2- | sed s/'"'/'\\"'/g | $(AWK) '{ print "\""$$0"\\n\"" }' >> "$@.tmp"
	echo ";" >> "$@.tmp"
	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 175 176
libvlccore_la_SOURCES = $(SOURCES_libvlc)
nodist_libvlccore_la_SOURCES = misc/revision.c
libvlccore_la_CFLAGS = `$(VLC_CONFIG) --cflags libvlc` \
177
	-DMODULE_STRING=\"main\" \
178
	-DLOCALEDIR=\"$(localedir)\" \
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
179
	-DSYSCONFDIR=\"$(sysconfdir)\" \
180
	-DDATA_PATH=\"$(pkgdatadir)\" \
181
	-DLIBDIR=\"$(libdir)\" \
182
	-DPLUGIN_PATH=\"$(pkglibdir)\"
183
libvlccore_la_LDFLAGS = `$(VLC_CONFIG) --ldflags libvlc` $(AM_LDFLAGS) \
184
	-export-symbols $(srcdir)/libvlccore.sym \
185
	-version-info 1:0:0
186 187
libvlccore_la_LIBADD = `$(VLC_CONFIG) -libs libvlc` $(AM_LIBADD) $(LTLIBINTL)
libvlccore_la_DEPENDENCIES = libvlccore.sym
188
if HAVE_WIN32
189 190
libvlccore_la_DEPENDENCIES += libvlc_win32_rc.$(OBJEXT)
libvlccore_la_LDFLAGS += -Wl,libvlc_win32_rc.$(OBJEXT)
191
endif
192

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

196 197 198
libvlc_la_SOURCES = $(SOURCES_libvlc_control)
libvlc_la_LIBADD = libvlccore.la
libvlc_la_CFLAGS = `$(VLC_CONFIG) --cflags libvlc` \
199
	-DMODULE_STRING=\"control\"
200
libvlc_la_LDFLAGS = $(AM_LDFLAGS) \
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
201
	-version-info 2:2:0 \
202
	-export-symbols $(srcdir)/libvlc.sym
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
203
libvlc_la_DEPENDENCIES = libvlc.sym libvlccore.la
204
if HAVE_WIN32
205 206
libvlc_la_DEPENDENCIES += $(DATA_win32_rc_lib)
libvlc_la_LDFLAGS += -Wl,$(DATA_win32_rc_lib)
207 208
endif

209

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

259 260 261 262
SOURCES_libvlc_beos = \
	$(NULL)

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

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

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

275 276
SOURCES_libvlc_other = misc/not_specific.c

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

416 417 418 419
SOURCES_libvlc_httpd = \
	network/httpd.c \
	$(NULL)

420 421 422 423 424 425 426 427
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)

428 429 430 431 432
SOURCES_libvlc_vlm = \
	input/vlm.c \
	input/vlmshell.c \
	$(NULL)

433 434 435 436 437 438 439 440 441
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)

442
SOURCES_libvlc_control = \
Clément Stenac's avatar
Clément Stenac committed
443
	control/libvlc_internal.h \
444 445 446 447 448 449
	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
450
	control/event.c \
451
	control/flat_media_list_view.c \
452
	control/hierarchical_media_list_view.c \
453
	control/hierarchical_node_media_list_view.c \
454 455
	control/media.c \
	control/media_player.c \
456
	control/media_list.c \
457
	control/media_list_path.h \
458
	control/media_list_player.c \
459
	control/media_list_view.c \
460
	control/media_library.c \
Clément Stenac's avatar
Clément Stenac committed
461
	control/mediacontrol_internal.h \
462 463
	control/mediacontrol_core.c \
	control/mediacontrol_util.c \
464
	control/mediacontrol_audio_video.c \
465
	control/media_discoverer.c
466

467 468 469
###############################################################################
# Stamp rules
###############################################################################
470

471 472 473 474 475 476 477 478
misc/revision.c.tmp:
	rm -f -- $@
	echo "/* AUTOGENERATED FILE - DO NOT EDIT */" > $@
	REVISION="$$(cd "$(top_srcdir)"; git describe 2>/dev/null || echo "$(VERSION)")"; \
	echo "const char psz_vlc_changeset[] = \"$$REVISION\";" >> $@
	diff $@ misc/revision.c >/dev/null 2>&1 || \
		cat misc/revision.c.tmp > misc/revision.c

479
misc/revision.c:
480 481 482 483
	$(MAKE) misc/revision.c.tmp
	cat misc/revision.c.tmp > misc/revision.c

BUILT_SOURCES += misc/revision.c.tmp misc/revision.c
484

485
.PHONY: misc/revision.c.tmp
486

487 488 489
###############################################################################
# Unit/regression test
###############################################################################
490

491
dist_check_SCRIPTS = check_symbols check_headers
492
TESTS = check_symbols
493 494

check-local:
495
	for h in `echo $(pkginclude_HEADERS) | sed -e s,\.\./include/,,g`; \
496 497 498 499 500 501 502 503
	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
504
	$(srcdir)/check_headers $(pkginclude_HEADERS)
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
505
	$(srcdir)/check_headers $(pluginsinclude_HEADERS)
506

507
FORCE:
508 509 510 511
	@echo "Generated source cannot be phony. Go away." >&2
	@exit 1

.PHONY: FORCE