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
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/aout.h \
29 ../include/vlc/vout.h \
30 ../include/vlc/sout.h \
31 ../include/vlc/decoder.h \
32 ../include/vlc/input.h \
33 ../include/vlc/intf.h \
34 ../include/vlc/mediacontrol.h \
35 ../include/vlc/mediacontrol_structures.h \
38 noinst_HEADERS = $(HEADERS_include)
39 noinst_DATA = $(DATA_noinst_libvlc)
42 ../include/aout_internal.h \
43 ../include/audio_output.h \
44 ../include/beos_specific.h \
45 ../include/charset.h \
47 ../include/configuration.h \
48 ../include/darwin_specific.h \
49 ../include/intf_eject.h \
50 ../include/iso_lang.h \
53 ../include/modules.h \
54 ../include/modules_inner.h \
56 ../include/network.h \
57 ../include/os_specific.h \
58 ../include/snapshot.h \
59 ../include/stream_output.h \
60 ../include/vlc_streaming.h \
61 ../include/variables.h \
62 ../include/video_output.h \
63 ../include/vlc_access.h \
64 ../include/vlc_acl.h \
65 ../include/vlc_bits.h \
66 ../include/vlc_block.h \
67 ../include/vlc_block_helper.h \
68 ../include/vlc_codec.h \
69 ../include/vlc_common.h \
70 ../include/vlc_config.h \
71 ../include/vlc_cpu.h \
72 ../include/vlc_demux.h \
73 ../include/vlc_error.h \
75 ../include/vlc_es_out.h \
76 ../include/vlc_filter.h \
77 ../include/vlc_config_cat.h \
78 ../include/vlc_httpd.h \
79 ../include/vlc_tls.h \
80 ../include/vlc_md5.h \
81 ../include/vlc_devices.h \
82 ../include/vlc_image.h \
83 ../include/vlc_input.h \
84 ../include/vlc_interaction.h \
85 ../include/vlc_interface.h \
86 ../include/vlc_intf_strings.h \
87 ../include/vlc_keys.h \
88 ../include/vlc_messages.h \
89 ../include/vlc_meta.h \
90 ../include/vlc_objects.h \
91 ../include/vlc_osd.h \
92 ../include/vlc_playlist.h \
93 ../include/vlc_spu.h \
94 ../include/vlc_stream.h \
95 ../include/vlc_strings.h \
96 ../include/vlc_symbols.h \
97 ../include/vlc_threads_funcs.h \
98 ../include/vlc_threads.h \
99 ../include/vlc_update.h \
100 ../include/vlc_url.h \
101 ../include/vlc_video.h \
102 ../include/vlc_vlm.h \
103 ../include/vlc_vod.h \
104 ../include/vlc_xml.h \
105 ../include/vout_synchro.h \
106 ../include/win32_specific.h \
107 ../include/libvlc_internal.h \
108 ../include/mediacontrol_internal.h
111 misc/modules_builtin.h: Makefile misc/modules_builtin.h.in ../vlc-config
112 $(TOOLBOX) --update-includes
115 misc/modules.c: misc/modules_builtin.h
117 ###############################################################################
118 # Building builtin modules
119 ###############################################################################
121 # As long as we use builtins with a shared libvlc, we must build them before
122 # we build libvlc. Maybe one day, libvlc will handle multiple modules per
123 # shared object, which will make builtins fairly redumdant. Until then, we
124 # need this workaround.
126 stamp-builtins: Makefile ../vlc-config ../config.status
128 @for c in `$(VLC_CONFIG) --libs builtin`; do \
130 ../modules/*.a) echo $$c ;; \
133 sed -e 's,^\(.*\)/\([^/]*\)\.a$$,cd \1 \&\& $(MAKE) \2_builtin.la,g' | \
134 while read cmd; do echo $$cmd; eval "($$cmd)" || exit $$? ; done
137 @for c in `$(VLC_CONFIG) --libs builtin`; do \
139 ../modules/*.a) echo $$c ;; \
142 sed -e 's,^\(.*\)/\([^/]*\)\.a$$,cd \1 \&\& $(MAKE) \2,g' | \
143 while read cmd; do echo $$cmd.a; eval "($$cmd.a)" || exit $$? ; done
147 ###############################################################################
149 ###############################################################################
151 libvlc_a_SOURCES = $(SOURCES_libvlc)
152 libvlc_a_CFLAGS = `$(VLC_CONFIG) --cflags vlc pic`
153 libvlc_a_CXXFLAGS = `$(VLC_CONFIG) --cxxflags vlc pic`
154 libvlc_a_OBJCFLAGS = `$(VLC_CONFIG) --objcflags vlc pic`
156 libvlc_la_SOURCES = $(SOURCES_libvlc)
157 libvlc_la_LIBADD = $(INCLUDED_LIBINTL)
158 libvlc_la_CFLAGS = `$(VLC_CONFIG) --cflags vlc`
159 libvlc_la_CXXFLAGS = `$(VLC_CONFIG) --cxxflags vlc`
160 libvlc_la_OBJCFLAGS = `$(VLC_CONFIG) --objcflags vlc`
161 libvlc_la_LDFLAGS = `$(VLC_CONFIG) --libs vlc builtin|sed -e 's/\(modules\/[^ ]*\)\.a /\1_builtin.la /g'` -no-undefined -export-symbols libvlc.sym
162 libvlc_la_DEPENDENCIES = stamp-builtins stamp-api
166 OPT_SOURCES_libvlc_beos = $(SOURCES_libvlc_beos)
169 OPT_SOURCES_libvlc_darwin = $(SOURCES_libvlc_darwin)
172 OPT_SOURCES_libvlc_win32 = $(SOURCES_libvlc_win32)
175 OPT_SOURCES_libvlc_win32 = $(SOURCES_libvlc_win32)
178 OPT_SOURCES_libvlc_dirent = $(SOURCES_libvlc_dirent)
181 OPT_SOURCES_libvlc_getopt = $(SOURCES_libvlc_getopt)
184 # Build libvlc as a shared library
186 lib_LTLIBRARIES = libvlc.la
188 lib_LIBRARIES = libvlc.a
199 DATA_noinst_libvlc = libvlc$(LIBEXT) libvlc$(LIBEXT).a
202 libvlc.dll.a: libvlc$(LIBEXT)
203 $(DLLTOOL) --export-all-symbols -l $@ -D $< $(libvlc_a_OBJECTS)
205 libvlc$(LIBEXT): $(OBJECTS_libvlc_so) stamp-builtins
206 @ldfl="`$(VLC_CONFIG) --libs plugin vlc builtin pic` $(INCLUDED_LIBINTL)" ; \
207 case `$(VLC_CONFIG) --linkage vlc builtin` in \
208 c++) ld="$(CXXLINK)" ;; \
209 objc) ld="$(OBJCLINK)" ;; \
210 c|*) ld="$(LINK)" ;; \
212 echo $$ld $(OBJECTS_libvlc_so) $(LDFLAGS_libvlc_so) $$ldfl; \
213 $$ld $(libvlc_a_OBJECTS) \
215 # It sucks big time, but we have to do that to link vlc properly
216 # on non-PIC OSes, otherwise ld will favor builtins-less libvlc.a over
219 # Cygwin libtool work-around
220 @if test -f "$@.exe"; then mv -f "$@.exe" "$@"; fi
224 $(SOURCES_libvlc_beos) \
225 $(SOURCES_libvlc_darwin) \
226 $(SOURCES_libvlc_win32) \
227 $(SOURCES_libvlc_dirent) \
228 $(SOURCES_libvlc_getopt) \
231 SOURCES_libvlc_beos = \
232 misc/beos_specific.cpp \
235 SOURCES_libvlc_darwin = \
236 misc/darwin_specific.m \
239 SOURCES_libvlc_win32 = \
240 misc/win32_specific.c \
243 SOURCES_libvlc_dirent = \
247 SOURCES_libvlc_getopt = \
253 SOURCES_libvlc_common = \
257 interface/interface.c \
258 interface/intf_eject.c \
259 interface/interaction.c \
260 playlist/playlist_internal.h \
265 playlist/loadsave.c \
269 playlist/services_discovery.c \
279 input/input_internal.h \
284 video_output/video_output.c \
285 video_output/vout_pictures.c \
286 video_output/vout_pictures.h \
287 video_output/video_text.c \
288 video_output/video_widgets.c \
289 video_output/vout_subpictures.c \
290 video_output/vout_synchro.c \
291 video_output/vout_intf.c \
292 audio_output/common.c \
294 audio_output/filters.c \
295 audio_output/input.c \
296 audio_output/mixer.c \
297 audio_output/output.c \
298 audio_output/intf.c \
299 stream_output/stream_output.c \
300 stream_output/announce.c \
301 stream_output/profiles.c \
302 stream_output/sap.c \
308 network/getaddrinfo.c \
326 misc/configuration.c \
346 control/mediacontrol_core.c \
347 control/mediacontrol_util.c \
348 control/mediacontrol_audio_video.c \
352 $(SOURCES_libvlc_common) \
353 $(OPT_SOURCES_libvlc_beos) \
354 $(OPT_SOURCES_libvlc_darwin) \
355 $(OPT_SOURCES_libvlc_win32) \
356 $(OPT_SOURCES_libvlc_dirent) \
357 $(OPT_SOURCES_libvlc_getopt) \
362 SOURCES_libvlc += misc/version.c
363 CLEANFILES += misc/version.c
366 # Install shared libvlc
368 test -z "$(DATA_noinst_libvlc)" || $(INSTALL_PROGRAM) "$(DATA_noinst_libvlc)" "$(DESTDIR)$(libdir)"
370 # the opposite of install-{data,exec}-local
372 test -z "$(DATA_noinst_libvlc)" || rm -f "$(DESTDIR)$(libdir)/$(DATA_noinst_libvlc)"
375 misc/version.c: FORCE
376 $(TOOLBOX) --update-version
378 ###############################################################################
380 ###############################################################################
381 stamp-api: Makefile.in $(HEADERS_include) ../vlc-api.pl
382 ( cd $(srcdir) && cat $(HEADERS_include) ) | \
383 top_srcdir="$(top_srcdir)" perl $(top_srcdir)/vlc-api.pl
390 ###############################################################################
391 # Unit/regression test
392 ###############################################################################
394 check_PROGRAMS = test_i18n_atof test_url
395 TESTS = $(check_PROGRAMS)
397 CFLAGS_tests = `$(VLC_CONFIG) --cflags vlc`
399 test_i18n_atof_SOURCES = test/i18n_atof.c
400 test_i18n_atof_LDADD = libvlc.la
401 test_i18n_atof_CFLAGS = $(CFLAGS_tests)
403 test_url_SOURCES = test/url.c
404 test_url_LDADD = libvlc.la
405 test_url_CFLAGS = $(CFLAGS_tests)