1 ###############################################################################
2 # Automake targets and declarations
3 ###############################################################################
8 EXTRA_DIST = extras/COPYING misc/modules_builtin.h.in
10 BUILT_SOURCES = $(DISTCLEANFILES) $(CLEANFILES)
11 DISTCLEANFILES = stamp-api
12 CLEANFILES = misc/modules_builtin.h misc/version.c
13 MOSTLYCLEANFILES = $(DATA_noinst_libvlc) stamp-builtins
15 TOOLBOX = srcdir=$(top_srcdir) builddir=$(top_builddir) $(top_srcdir)/toolbox
17 ###############################################################################
19 ###############################################################################
21 pkgincludedir = $(includedir)/vlc
23 dist_pkginclude_HEADERS = \
24 ../include/vlc/vlc.h \
25 ../include/vlc/libvlc.h \
26 ../include/vlc/aout.h \
27 ../include/vlc/vout.h \
28 ../include/vlc/sout.h \
29 ../include/vlc/decoder.h \
30 ../include/vlc/input.h \
31 ../include/vlc/intf.h \
32 ../include/vlc/mediacontrol.h \
33 ../include/vlc/mediacontrol_structures.h \
36 noinst_HEADERS = $(HEADERS_include)
37 noinst_DATA = $(DATA_noinst_libvlc)
40 ../include/aout_internal.h \
41 ../include/audio_output.h \
42 ../include/beos_specific.h \
43 ../include/charset.h \
45 ../include/configuration.h \
46 ../include/darwin_specific.h \
47 ../include/intf_eject.h \
48 ../include/iso_lang.h \
51 ../include/modules.h \
52 ../include/modules_inner.h \
54 ../include/network.h \
55 ../include/os_specific.h \
56 ../include/snapshot.h \
57 ../include/stream_output.h \
58 ../include/variables.h \
59 ../include/video_output.h \
60 ../include/vlc_access.h \
61 ../include/vlc_acl.h \
62 ../include/vlc_bits.h \
63 ../include/vlc_block.h \
64 ../include/vlc_block_helper.h \
65 ../include/vlc_codec.h \
66 ../include/vlc_common.h \
67 ../include/vlc_config.h \
68 ../include/vlc_cpu.h \
69 ../include/vlc_demux.h \
70 ../include/vlc_error.h \
72 ../include/vlc_es_out.h \
73 ../include/vlc_filter.h \
74 ../include/vlc_config_cat.h \
75 ../include/vlc_httpd.h \
76 ../include/vlc_tls.h \
77 ../include/vlc_md5.h \
78 ../include/vlc_image.h \
79 ../include/vlc_input.h \
80 ../include/vlc_interaction.h \
81 ../include/vlc_interface.h \
82 ../include/vlc_keys.h \
83 ../include/vlc_messages.h \
84 ../include/vlc_meta.h \
85 ../include/vlc_objects.h \
86 ../include/vlc_osd.h \
87 ../include/vlc_playlist.h \
88 ../include/vlc_spu.h \
89 ../include/vlc_stream.h \
90 ../include/vlc_symbols.h \
91 ../include/vlc_threads_funcs.h \
92 ../include/vlc_threads.h \
93 ../include/vlc_update.h \
94 ../include/vlc_video.h \
95 ../include/vlc_vlm.h \
96 ../include/vlc_vod.h \
97 ../include/vlc_xml.h \
98 ../include/vout_synchro.h \
99 ../include/win32_specific.h \
100 ../include/libvlc_internal.h \
101 ../include/mediacontrol_internal.h
104 misc/modules_builtin.h: Makefile misc/modules_builtin.h.in ../vlc-config
105 $(TOOLBOX) --update-includes
108 misc/modules.c: misc/modules_builtin.h
110 misc/version.c: FORCE
111 $(TOOLBOX) --update-version
113 ###############################################################################
114 # Building builtin modules
115 ###############################################################################
117 # As long as we use builtins with a shared libvlc, we must build them before
118 # we build libvlc. Maybe one day, libvlc will handle multiple modules per
119 # shared object, which will make builtins fairly redumdant. Until then, we
120 # need this workaround.
124 @for c in `$(VLC_CONFIG) --libs builtin`; do \
126 ../modules/*.a) echo $$c ;; \
129 sed -e 's/^\(.*\)\/\([^\/]*\)\.a$$/cd \1 \&\& $(MAKE) \2.la/g' | \
130 while read cmd; do echo $$cmd; eval "($$cmd)" || exit $$? ; done
133 @if test "$(pic)" = "pic"; then ext="_pic.a"; else ext=".a"; fi ; \
134 for c in `$(VLC_CONFIG) --libs builtin`; do \
136 ../modules/*.a) echo $$c ;; \
139 sed -e 's/^\(.*\)\/\([^\/]*\)\.a$$/cd \1 \&\& $(MAKE) \2/g' | \
140 while read cmd; do echo $$cmd$$ext; eval "($$cmd$$ext)" || exit $$? ; done
144 ###############################################################################
146 ###############################################################################
148 libvlc_a_SOURCES = $(SOURCES_libvlc)
149 libvlc_a_CFLAGS = `$(VLC_CONFIG) --cflags vlc`
150 libvlc_a_CXXFLAGS = `$(VLC_CONFIG) --cxxflags vlc`
151 libvlc_a_OBJCFLAGS = `$(VLC_CONFIG) --objcflags vlc`
153 libvlc_pic_a_SOURCES = $(SOURCES_libvlc)
154 libvlc_pic_a_CFLAGS = `$(VLC_CONFIG) --cflags vlc pic`
155 libvlc_pic_a_CXXFLAGS = `$(VLC_CONFIG) --cxxflags vlc pic`
156 libvlc_pic_a_OBJCFLAGS = `$(VLC_CONFIG) --objcflags vlc pic`
158 libvlc_la_SOURCES = $(SOURCES_libvlc)
159 libvlc_la_CFLAGS = `$(VLC_CONFIG) --cflags vlc`
160 libvlc_la_CXXFLAGS = `$(VLC_CONFIG) --cxxflags vlc`
161 libvlc_la_OBJCFLAGS = `$(VLC_CONFIG) --objcflags vlc`
162 libvlc_la_LDFLAGS = `$(VLC_CONFIG) --libs vlc builtin|sed -e 's/\.a /.la /g'` \
163 -avoid-version -no-undefined
164 libvlc_la_DEPENDENCIES = stamp-builtins
168 OPT_SOURCES_libvlc_beos = $(SOURCES_libvlc_beos)
171 OPT_SOURCES_libvlc_darwin = $(SOURCES_libvlc_darwin)
174 OPT_SOURCES_libvlc_win32 = $(SOURCES_libvlc_win32)
177 OPT_SOURCES_libvlc_win32 = $(SOURCES_libvlc_win32)
180 OPT_SOURCES_libvlc_dirent = $(SOURCES_libvlc_dirent)
183 OPT_SOURCES_libvlc_getopt = $(SOURCES_libvlc_getopt)
186 # Build libvlc as a shared library
188 lib_LTLIBRARIES = libvlc.la
190 LIBRARIES_nopic = libvlc.a
191 LIBRARIES_pic = libvlc_pic.a
193 lib_LIBRARIES = $(LIBRARIES_nopic)
196 lib_LIBRARIES = $(LIBRARIES_pic)
198 lib_LIBRARIES = $(LIBRARIES_nopic)
200 lib_LIBRARIES += $(LIBRARIES_pic)
207 DATA_noinst_libvlc = libvlc$(LIBEXT)
209 OBJECTS_libvlc_so = $(libvlc_a_OBJECTS)
210 LDFLAGS_libvlc_so = -Wl,--out-implib,$(top_builddir)/src/libvlc.dll.a
212 OBJECTS_libvlc_so = $(libvlc_pic_a_OBJECTS)
216 libvlc$(LIBEXT): $(OBJECTS_libvlc_so) stamp-builtins
217 @ldfl="`$(VLC_CONFIG) --libs plugin vlc builtin $(pic)` $(INCLUDED_LIBINTL)" ; \
218 case `$(VLC_CONFIG) --linkage vlc builtin` in \
219 c++) ld="$(CXXLINK)" ;; \
220 objc) ld="$(OBJCLINK)" ;; \
221 c|*) ld="$(LINK)" ;; \
223 echo $$ld $(OBJECTS_libvlc_so) $(LDFLAGS_libvlc_so) $$ldfl; \
224 $$ld $(OBJECTS_libvlc_so) $(LDFLAGS_libvlc_so) $$ldfl
225 # It sucks big time, but we have to do that to link vlc properly
226 # on non-PIC OSes, otherwise ld will favor builtins-less libvlc.a over
231 $(SOURCES_libvlc_beos) \
232 $(SOURCES_libvlc_darwin) \
233 $(SOURCES_libvlc_win32) \
234 $(SOURCES_libvlc_dirent) \
235 $(SOURCES_libvlc_getopt) \
238 SOURCES_libvlc_beos = \
239 misc/beos_specific.cpp \
242 SOURCES_libvlc_darwin = \
243 misc/darwin_specific.m \
246 SOURCES_libvlc_win32 = \
247 misc/win32_specific.c \
250 SOURCES_libvlc_dirent = \
254 SOURCES_libvlc_getopt = \
260 SOURCES_libvlc_common = \
263 interface/interface.c \
264 interface/intf_eject.c \
265 interface/interaction.c \
266 playlist/playlist.c \
268 playlist/loadsave.c \
271 playlist/item-ext.c \
272 playlist/services_discovery.c \
280 input/input_internal.h \
285 video_output/video_output.c \
286 video_output/vout_pictures.c \
287 video_output/vout_pictures.h \
288 video_output/video_text.c \
289 video_output/video_widgets.c \
290 video_output/vout_subpictures.c \
291 video_output/vout_synchro.c \
292 video_output/vout_intf.c \
293 audio_output/common.c \
295 audio_output/filters.c \
296 audio_output/ainput.c \
297 audio_output/mixer.c \
298 audio_output/output.c \
299 audio_output/intf.c \
300 stream_output/stream_output.c \
301 stream_output/announce.c \
302 stream_output/sap.c \
308 network/getaddrinfo.c \
324 misc/configuration.c \
338 control/libvlc_core.c \
339 control/libvlc_playlist.c \
340 control/libvlc_vlm.c \
341 control/libvlc_input.c \
342 control/libvlc_video.c \
343 control/libvlc_audio.c \
344 control/mediacontrol_core.c \
345 control/mediacontrol_util.c \
346 control/mediacontrol_audio_video.c \
349 # These should be distributed, but not compiled
350 EXTRA_DIST += control/mediacontrol_init.c control/mediacontrol_plugin.c
353 $(SOURCES_libvlc_common) \
354 $(OPT_SOURCES_libvlc_beos) \
355 $(OPT_SOURCES_libvlc_darwin) \
356 $(OPT_SOURCES_libvlc_win32) \
357 $(OPT_SOURCES_libvlc_dirent) \
358 $(OPT_SOURCES_libvlc_getopt) \
362 # Install shared libvlc
364 test -z "$(DATA_noinst_libvlc)" || $(INSTALL_PROGRAM) "$(DATA_noinst_libvlc)" "$(DESTDIR)$(libdir)"
366 # the opposite of install-{data,exec}-local
368 test -z "$(DATA_noinst_libvlc)" || rm -f "$(DESTDIR)$(libdir)/$(DATA_noinst_libvlc)"
371 ###############################################################################
373 ###############################################################################
374 stamp-api: Makefile.in $(HEADERS_include) ../vlc-api.pl
375 ( cd $(srcdir) && cat $(HEADERS_include) ) | \
376 top_srcdir="$(top_srcdir)" perl $(top_srcdir)/vlc-api.pl
379 ###############################################################################
381 ###############################################################################