1 ###############################################################################
2 # Automake targets and declarations
3 ###############################################################################
5 AUTOMAKE_OPTIONS = subdir-objects
10 EXTRA_DIST = extras/COPYING misc/modules_builtin.h.in
12 BUILT_SOURCES = $(DISTCLEANFILES) $(CLEANFILES)
13 DISTCLEANFILES = stamp-api libvlc.sym
14 CLEANFILES = misc/modules_builtin.h
15 MOSTLYCLEANFILES = $(DATA_noinst_libvlc) stamp-builtins
17 TOOLBOX = srcdir=$(top_srcdir) builddir=$(top_builddir) $(top_srcdir)/toolbox
19 ###############################################################################
21 ###############################################################################
23 pkgincludedir = $(includedir)/vlc
25 dist_pkginclude_HEADERS = \
26 ../include/vlc/vlc.h \
27 ../include/vlc/libvlc.h \
28 ../include/vlc/mediacontrol.h \
29 ../include/vlc/mediacontrol_structures.h \
32 noinst_HEADERS = $(HEADERS_include)
33 noinst_DATA = $(DATA_noinst_libvlc)
36 ../include/iso_lang.h \
39 ../include/vlc_modules.h \
40 ../include/vlc_modules_macros.h \
41 ../include/vlc_os_specific.h \
42 ../include/vlc_mtime.h \
43 ../include/vlc_network.h \
44 ../include/vlc_codecs.h \
45 ../include/vlc_configuration.h \
46 ../include/vlc_charset.h \
47 ../include/vlc_sout.h \
48 ../include/vlc_streaming.h \
49 ../include/vlc_variables.h \
50 ../include/vlc_aout.h \
51 ../include/vlc_access.h \
52 ../include/vlc_arrays.h \
53 ../include/vlc_acl.h \
54 ../include/vlc_bits.h \
55 ../include/vlc_block.h \
56 ../include/vlc_block_helper.h \
57 ../include/vlc_codec.h \
58 ../include/vlc_common.h \
59 ../include/vlc_config.h \
60 ../include/vlc_demux.h \
62 ../include/vlc_es_out.h \
63 ../include/vlc_filter.h \
64 ../include/vlc_config_cat.h \
65 ../include/vlc_httpd.h \
66 ../include/vlc_tls.h \
67 ../include/vlc_md5.h \
68 ../include/vlc_devices.h \
69 ../include/vlc_image.h \
70 ../include/vlc_input.h \
71 ../include/vlc_interface.h \
72 ../include/vlc_intf_strings.h \
73 ../include/vlc_keys.h \
74 ../include/vlc_messages.h \
75 ../include/vlc_meta.h \
76 ../include/vlc_objects.h \
77 ../include/vlc_osd.h \
78 ../include/vlc_playlist.h \
79 ../include/vlc_stream.h \
80 ../include/vlc_strings.h \
81 ../include/vlc_symbols.h \
82 ../include/vlc_threads_funcs.h \
83 ../include/vlc_threads.h \
84 ../include/vlc_update.h \
85 ../include/vlc_url.h \
86 ../include/vlc_vout.h \
87 ../include/vlc_vlm.h \
88 ../include/vlc_vod.h \
89 ../include/vlc_xml.h \
90 ../include/vlc_vout_synchro.h \
93 misc/modules_builtin.h: misc/modules_builtin.h.in
94 $(TOOLBOX) --update-includes
97 misc/modules.c: misc/modules_builtin.h
99 ###############################################################################
100 # Building builtin modules
101 ###############################################################################
103 # As long as we use builtins with a shared libvlc, we must build them before
104 # we build libvlc. Maybe one day, libvlc will handle multiple modules per
105 # shared object, which will make builtins fairly redumdant. Until then, we
106 # need this workaround.
110 stamp-builtins: Makefile ../vlc-config ../config.status
111 @for c in `$(VLC_CONFIG) --libs builtin`; do \
113 ../modules/*.a) echo $$c ;; \
116 sed -e 's,^\(.*\)/\([^/]*\)\.a$$,cd \1 \&\& $(MAKE) \2,g' | \
117 while read cmd; do echo $$cmd.a; eval "($$cmd.a)" || exit $$? ; done
121 ###############################################################################
123 ###############################################################################
125 libvlc_a_SOURCES = $(SOURCES_libvlc) $(SOURCES_libvlc_control)
126 nodist_libvlc_a_SOURCES = misc/version.c
127 libvlc_a_CFLAGS = `$(VLC_CONFIG) --cflags vlc pic` -DUSE_BUILTINS
128 libvlc_a_CXXFLAGS = `$(VLC_CONFIG) --cxxflags vlc pic`
129 libvlc_a_OBJCFLAGS = `$(VLC_CONFIG) --objcflags vlc pic`
131 libvlc_la_SOURCES = $(SOURCES_libvlc)
132 libvlc_la_LIBADD = $(INCLUDED_LIBINTL)
133 libvlc_la_CFLAGS = `$(VLC_CONFIG) --cflags vlc`
134 libvlc_la_CXXFLAGS = `$(VLC_CONFIG) --cxxflags vlc`
135 libvlc_la_OBJCFLAGS = `$(VLC_CONFIG) --objcflags vlc`
136 libvlc_la_LDFLAGS = `$(VLC_CONFIG) --libs vlc` \
137 -no-undefined -export-symbols libvlc.sym -version-info 1:0:0
138 libvlc_la_DEPENDENCIES = libvlc.sym
140 libvlc_control_la_SOURCES = $(SOURCES_libvlc_control)
141 libvlc_control_la_LIBADD = libvlc.la
142 libvlc_control_la_CFLAGS = `$(VLC_CONFIG) --cflags vlc`
143 libvlc_control_la_LDFLAGS = \
144 -no-undefined -export-symbols-regex '_?(libvlc|mediacontrol)_.*' \
148 OPT_SOURCES_libvlc_beos = $(SOURCES_libvlc_beos)
151 OPT_SOURCES_libvlc_darwin = $(SOURCES_libvlc_darwin)
154 OPT_SOURCES_libvlc_win32 = $(SOURCES_libvlc_win32)
157 OPT_SOURCES_libvlc_win32 = $(SOURCES_libvlc_win32)
160 OPT_SOURCES_libvlc_dirent = $(SOURCES_libvlc_dirent)
163 OPT_SOURCES_libvlc_getopt = $(SOURCES_libvlc_getopt)
166 # Build libvlc as a shared library
168 lib_LTLIBRARIES = libvlc.la libvlc-control.la
170 lib_LIBRARIES = libvlc.a
181 DATA_noinst_libvlc = libvlc$(LIBEXT) libvlc$(LIBEXT).a
184 libvlc.dll.a: libvlc$(LIBEXT)
185 $(DLLTOOL) --export-all-symbols -l $@ -D $< $(libvlc_a_OBJECTS)
187 libvlc$(LIBEXT): $(OBJECTS_libvlc_so) stamp-builtins
188 @ldfl="`$(VLC_CONFIG) --libs plugin vlc builtin pic` $(INCLUDED_LIBINTL)" ; \
189 case `$(VLC_CONFIG) --linkage vlc builtin` in \
190 c++) ld="$(CXXLINK)" ;; \
191 objc) ld="$(OBJCLINK)" ;; \
192 c|*) ld="$(LINK)" ;; \
194 echo $$ld $(OBJECTS_libvlc_so) $(LDFLAGS_libvlc_so) $$ldfl; \
195 $$ld $(libvlc_a_OBJECTS) \
197 # It sucks big time, but we have to do that to link vlc properly
198 # on non-PIC OSes, otherwise ld will favor builtins-less libvlc.a over
201 # Cygwin libtool work-around
202 @if test -f "$@.exe"; then mv -f "$@.exe" "$@"; fi
206 $(SOURCES_libvlc_beos) \
207 $(SOURCES_libvlc_darwin) \
208 $(SOURCES_libvlc_win32) \
209 $(SOURCES_libvlc_dirent) \
210 $(SOURCES_libvlc_getopt) \
213 SOURCES_libvlc_beos = \
214 misc/beos_specific.cpp \
217 SOURCES_libvlc_darwin = \
218 misc/darwin_specific.m \
221 SOURCES_libvlc_win32 = \
222 misc/win32_specific.c \
225 SOURCES_libvlc_dirent = \
229 SOURCES_libvlc_getopt = \
235 SOURCES_libvlc_common = \
240 interface/interface.h \
241 interface/interface.c \
242 interface/intf_eject.c \
243 interface/interaction.c \
244 playlist/playlist_internal.h \
249 playlist/loadsave.c \
253 playlist/services_discovery.c \
263 input/input_internal.h \
268 video_output/video_output.c \
269 video_output/vout_pictures.c \
270 video_output/vout_pictures.h \
271 video_output/video_text.c \
272 video_output/video_widgets.c \
273 video_output/vout_subpictures.c \
274 video_output/vout_synchro.c \
275 video_output/vout_intf.c \
276 audio_output/aout_internal.h \
277 audio_output/common.c \
279 audio_output/filters.c \
280 audio_output/input.c \
281 audio_output/mixer.c \
282 audio_output/output.c \
283 audio_output/intf.c \
284 stream_output/stream_output.c \
285 stream_output/stream_output.h \
286 stream_output/announce.c \
287 stream_output/profiles.c \
288 stream_output/sap.c \
294 network/getaddrinfo.c \
315 misc/configuration.h \
316 misc/configuration.c \
317 misc/configuration_chain.c \
333 $(SOURCES_libvlc_common) \
334 $(OPT_SOURCES_libvlc_beos) \
335 $(OPT_SOURCES_libvlc_darwin) \
336 $(OPT_SOURCES_libvlc_win32) \
337 $(OPT_SOURCES_libvlc_dirent) \
338 $(OPT_SOURCES_libvlc_getopt) \
341 SOURCES_libvlc_control = \
342 control/libvlc_internal.h \
350 control/mediacontrol_internal.h \
351 control/mediacontrol_core.c \
352 control/mediacontrol_util.c \
353 control/mediacontrol_audio_video.c
357 CLEANFILES += misc/version.c
360 # Install shared libvlc
362 test -z "$(DATA_noinst_libvlc)" || $(INSTALL_PROGRAM) "$(DATA_noinst_libvlc)" "$(DESTDIR)$(libdir)"
364 # the opposite of install-{data,exec}-local
366 test -z "$(DATA_noinst_libvlc)" || rm -f "$(DESTDIR)$(libdir)/$(DATA_noinst_libvlc)"
369 misc/version.c: FORCE
370 $(TOOLBOX) --update-version
372 ###############################################################################
374 ###############################################################################
375 stamp-api: Makefile.in $(HEADERS_include) ../vlc-api.pl
376 ( cd $(srcdir) && cat $(HEADERS_include) ) | \
377 top_srcdir="$(top_srcdir)" perl $(top_srcdir)/vlc-api.pl
380 libvlc.sym: $(HEADERS_include)
382 (cd $(srcdir) && cat $(HEADERS_include) ) | \
383 sed -ne 's/^.*VLC_EXPORT\s*(\s*\w.*\S\s*,\s*\(\w*\)\s*,\s*(\s*\w.*\S\s*)\s*)[^)]*$$/\1/p' \
386 ###############################################################################
387 # Unit/regression test
388 ###############################################################################
390 check_PROGRAMS = test_i18n_atof test_url
391 TESTS = $(check_PROGRAMS)
393 CFLAGS_tests = `$(VLC_CONFIG) --cflags vlc`
395 test_i18n_atof_SOURCES = test/i18n_atof.c
396 test_i18n_atof_LDADD = libvlc.la
397 test_i18n_atof_CFLAGS = $(CFLAGS_tests)
399 test_url_SOURCES = test/url.c
400 test_url_LDADD = libvlc.la
401 test_url_CFLAGS = $(CFLAGS_tests)