]> git.sesse.net Git - vlc/blob - src/Makefile.am
Initial callback support in libvlc + example on how to use in the java bindings
[vlc] / src / Makefile.am
1
2 # Automake targets and declarations
3 ###############################################################################
4
5 AUTOMAKE_OPTIONS = subdir-objects
6
7 NULL =
8 SUBDIRS =
9
10 EXTRA_DIST = extras/COPYING modules/builtin.h.in libvlc.sym
11
12 BUILT_SOURCES = $(CLEANFILES)
13 CLEANFILES = modules/builtin.h
14 MOSTLYCLEANFILES = $(DATA_noinst_libvlc)
15
16 TOOLBOX = srcdir=$(top_srcdir) builddir=$(top_builddir) $(top_srcdir)/toolbox
17
18 ###############################################################################
19 # Headers
20 ###############################################################################
21
22 pkgincludedir = $(includedir)/vlc
23
24 dist_pkginclude_HEADERS = \
25         ../include/vlc/vlc.h \
26         ../include/vlc/libvlc.h \
27         ../include/vlc/libvlc_structures.h \
28         ../include/vlc/mediacontrol.h \
29         ../include/vlc/mediacontrol_structures.h \
30         $(NULL)
31
32 noinst_HEADERS = $(HEADERS_include)
33 noinst_DATA = $(DATA_noinst_libvlc)
34
35 HEADERS_include = \
36         ../include/iso_lang.h \
37         ../include/main.h \
38         ../include/mmx.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 \
61         ../include/vlc_es.h \
62         ../include/vlc_es_out.h \
63         ../include/vlc_epg.h \
64         ../include/vlc_filter.h \
65         ../include/vlc_config_cat.h \
66         ../include/vlc_httpd.h \
67         ../include/vlc_tls.h \
68         ../include/vlc_md5.h \
69         ../include/vlc_devices.h \
70         ../include/vlc_image.h \
71         ../include/vlc_input.h \
72         ../include/vlc_interface.h \
73         ../include/vlc_intf_strings.h \
74         ../include/vlc_keys.h \
75         ../include/vlc_messages.h \
76         ../include/vlc_meta.h \
77         ../include/vlc_objects.h \
78         ../include/vlc_osd.h \
79         ../include/vlc_playlist.h \
80         ../include/vlc_stream.h \
81         ../include/vlc_strings.h \
82         ../include/vlc_symbols.h \
83         ../include/vlc_threads_funcs.h \
84         ../include/vlc_threads.h \
85         ../include/vlc_update.h \
86         ../include/vlc_url.h \
87         ../include/vlc_vout.h \
88         ../include/vlc_vlm.h \
89         ../include/vlc_vod.h \
90         ../include/vlc_xml.h \
91         ../include/vlc_vout_synchro.h \
92         $(NULL)
93
94 modules/builtin.h: modules/builtin.h.in
95         $(TOOLBOX) --update-includes
96         touch $@
97
98 modules/modules.c: modules/builtin.h
99
100 ###############################################################################
101 # Building libvlc
102 ###############################################################################
103
104 libvlc_a_SOURCES = $(SOURCES_libvlc) $(SOURCES_libvlc_control)
105 libvlc_a_CFLAGS = `$(VLC_CONFIG) --cflags libvlc pic` -DUSE_BUILTINS
106 libvlc_a_CXXFLAGS = `$(VLC_CONFIG) --cxxflags libvlc pic`
107 libvlc_a_OBJCFLAGS = `$(VLC_CONFIG) --objcflags libvlc pic`
108
109 libvlc_la_SOURCES = $(SOURCES_libvlc)
110 libvlc_la_LIBADD = $(INCLUDED_LIBINTL)
111 libvlc_la_CFLAGS = `$(VLC_CONFIG) --cflags libvlc`
112 libvlc_la_CXXFLAGS = `$(VLC_CONFIG) --cxxflags libvlc`
113 libvlc_la_OBJCFLAGS = `$(VLC_CONFIG) --objcflags libvlc`
114 libvlc_la_LDFLAGS = `$(VLC_CONFIG) --libs libvlc` \
115         -no-undefined -export-symbols $(srcdir)/libvlc.sym -version-info 1:0:0
116 libvlc_la_DEPENDENCIES = libvlc.sym
117
118 libvlc_control_la_SOURCES = $(SOURCES_libvlc_control)
119 libvlc_control_la_LIBADD = libvlc.la
120 libvlc_control_la_CFLAGS = `$(VLC_CONFIG) --cflags libvlc`
121 libvlc_control_la_LDFLAGS = \
122         -no-undefined -export-symbols-regex '_?(libvlc|mediacontrol)_.*' \
123         -version-info 0:0:0
124
125 if HAVE_BEOS
126 OPT_SOURCES_libvlc_beos = $(SOURCES_libvlc_beos)
127 endif
128 if HAVE_DARWIN
129 OPT_SOURCES_libvlc_darwin = $(SOURCES_libvlc_darwin)
130 endif
131 if HAVE_WIN32
132 OPT_SOURCES_libvlc_win32 = $(SOURCES_libvlc_win32)
133 endif
134 if HAVE_WINCE
135 OPT_SOURCES_libvlc_win32 = $(SOURCES_libvlc_win32)
136 endif
137 if BUILD_DIRENT
138 OPT_SOURCES_libvlc_dirent = $(SOURCES_libvlc_dirent)
139 endif
140 if BUILD_GETOPT
141 OPT_SOURCES_libvlc_getopt = $(SOURCES_libvlc_getopt)
142 endif
143
144 # Build libvlc as a shared library
145 if USE_LIBTOOL
146 lib_LTLIBRARIES = libvlc.la libvlc-control.la
147 else
148 lib_LIBRARIES = libvlc.a
149 endif
150
151 if HAVE_WIN32
152 pic =
153 else
154 pic = pic
155 endif
156
157 if HAVE_WIN32
158 DATA_noinst_libvlc = libvlc$(LIBEXT) libvlc$(LIBEXT).a
159
160 libvlc.dll.a libvlc.def: libvlc$(LIBEXT)
161         $(DLLTOOL) -z libvlc.def -l libvlc.dll.a -D $< $(libvlc_a_OBJECTS)
162
163 libvlc$(LIBEXT): $(libvlc_a_OBJECTS)
164         @ldfl="`$(VLC_CONFIG) --libs plugin libvlc pic` $(INCLUDED_LIBINTL)" ; \
165         case `$(VLC_CONFIG) --linkage libvlc` in \
166           c++)  ld="$(CXXLINK)" ;; \
167           objc) ld="$(OBJCLINK)" ;; \
168           c|*)  ld="$(LINK)" ;; \
169         esac ; \
170         echo $$ld $(libvlc_a_OBJECTS) $$ldfl; \
171         $$ld $(libvlc_a_OBJECTS) \
172                 $$ldfl
173 # It sucks big time, but we have to do that to link vlc properly
174 # on non-PIC OSes, otherwise ld will favor builtins-less libvlc.a over
175 # libvlc$(LIBEXT)
176         rm -f libvlc.a
177 # Cygwin libtool work-around
178         @if test -f "$@.exe"; then mv -f "$@.exe" "$@"; fi
179 endif
180
181 EXTRA_DIST += \
182         $(SOURCES_libvlc_beos) \
183         $(SOURCES_libvlc_darwin) \
184         $(SOURCES_libvlc_win32) \
185         $(SOURCES_libvlc_dirent) \
186         $(SOURCES_libvlc_getopt) \
187         $(NULL)
188
189 SOURCES_libvlc_beos = \
190         misc/beos_specific.cpp \
191         $(NULL)
192
193 SOURCES_libvlc_darwin = \
194         misc/darwin_specific.c \
195         $(NULL)
196
197 SOURCES_libvlc_win32 = \
198         misc/win32_specific.c \
199         $(NULL)
200
201 SOURCES_libvlc_dirent = \
202         extras/dirent.c \
203         $(NULL)
204
205 SOURCES_libvlc_getopt = \
206         extras/getopt.c \
207         extras/getopt.h \
208         extras/getopt1.c \
209         $(NULL)
210
211 SOURCES_libvlc_common = \
212         libvlc.c \
213         libvlc-common.c \
214         libvlc.h \
215         libvlc-module.c \
216         interface/interface.h \
217         interface/interface.c \
218         interface/intf_eject.c \
219         interface/interaction.c \
220         playlist/playlist_internal.h \
221         playlist/thread.c \
222         playlist/control.c \
223         playlist/engine.c \
224         playlist/sort.c \
225         playlist/loadsave.c \
226         playlist/tree.c \
227         playlist/item.c \
228         playlist/search.c \
229         playlist/services_discovery.c \
230         input/item.c \
231         input/access.c \
232         input/clock.c \
233         input/control.c \
234         input/decoder.c \
235         input/demux.c \
236         input/es_out.c \
237         input/input.c \
238         input/meta.c \
239         input/input_internal.h \
240         input/vlm_internal.h \
241         input/stream.c \
242         input/mem_stream.c \
243         input/subtitles.c \
244         input/var.c \
245         video_output/video_output.c \
246         video_output/vout_pictures.c \
247         video_output/vout_pictures.h \
248         video_output/video_text.c \
249         video_output/video_widgets.c \
250         video_output/vout_subpictures.c \
251         video_output/vout_synchro.c \
252         video_output/vout_intf.c \
253         audio_output/aout_internal.h \
254         audio_output/common.c \
255         audio_output/dec.c \
256         audio_output/filters.c \
257         audio_output/input.c \
258         audio_output/mixer.c \
259         audio_output/output.c \
260         audio_output/intf.c \
261         stream_output/stream_output.c \
262         stream_output/stream_output.h \
263         stream_output/announce.c \
264         stream_output/profiles.c \
265         stream_output/sap.c \
266         stream_output/sdp.c \
267         osd/osd.c \
268         osd/osd_parser.c \
269         osd/osd_text.c \
270         osd/osd_widgets.c \
271         network/acl.c \
272         network/getaddrinfo.c \
273         network/io.c \
274         network/error.c \
275         network/tcp.c \
276         network/udp.c \
277         network/httpd.c \
278         network/rootwrap.c \
279         network/tls.c \
280         network/poll.c \
281         text/charset.c \
282         text/strings.c \
283         text/unicode.c \
284         text/wincp.c \
285         text/iso_lang.c \
286         text/iso-639_def.h \
287         misc/md5.c \
288         misc/mtime.c \
289         misc/block.c \
290         modules/modules.h \
291         modules/modules.c \
292         modules/entry.c \
293         misc/threads.c \
294         misc/stats.c \
295         misc/cpu.c \
296         modules/configuration.h \
297         modules/configuration.c \
298         modules/configuration_chain.c \
299         misc/image.c \
300         misc/messages.c \
301         misc/objects.c \
302         misc/variables.h \
303         misc/variables.c \
304         misc/error.c \
305         misc/update.c \
306         input/vlm.c \
307         misc/xml.c \
308         misc/devices.c \
309         extras/libc.c \
310         $(NULL)
311
312 SOURCES_libvlc = \
313         $(SOURCES_libvlc_common) \
314         $(OPT_SOURCES_libvlc_beos) \
315         $(OPT_SOURCES_libvlc_darwin) \
316         $(OPT_SOURCES_libvlc_win32) \
317         $(OPT_SOURCES_libvlc_dirent) \
318         $(OPT_SOURCES_libvlc_getopt) \
319         $(NULL)
320
321 SOURCES_libvlc_control = \
322         control/libvlc_internal.h \
323         control/core.c \
324         control/log.c \
325         control/playlist.c \
326         control/vlm.c \
327         control/input.c \
328         control/video.c \
329         control/audio.c \
330         control/callback.c \
331         control/mediacontrol_internal.h \
332         control/mediacontrol_core.c \
333         control/mediacontrol_util.c \
334         control/mediacontrol_audio_video.c
335
336 if !USE_LIBTOOL
337 if !HAVE_WIN32
338 nodist_libvlc_a_SOURCES = misc/version.c
339 CLEANFILES += misc/version.c
340
341 misc/version.c: FORCE
342         $(TOOLBOX) --update-version
343 endif
344
345 # Install shared libvlc
346 install-exec-local:
347         test -z "$(DATA_noinst_libvlc)" || $(INSTALL_PROGRAM) "$(DATA_noinst_libvlc)" "$(DESTDIR)$(libdir)"
348
349 # the opposite of install-{data,exec}-local
350 uninstall-local:
351         test -z "$(DATA_noinst_libvlc)" || rm -f "$(DESTDIR)$(libdir)/$(DATA_noinst_libvlc)"
352 endif
353
354 ###############################################################################
355 # Stamp rules
356 ###############################################################################
357
358 if !USE_LIBTOOL
359 if !HAVE_WIN32
360 stamp-api: Makefile.in $(HEADERS_include) ../vlc-api.pl
361         ( cd $(srcdir) && cat $(HEADERS_include) ) | \
362           top_srcdir="$(top_srcdir)" perl $(top_srcdir)/vlc-api.pl
363         touch stamp-api
364
365 CLEANFILES += stamp-api
366 endif
367 endif
368
369 ###############################################################################
370 # Unit/regression test
371 ###############################################################################
372 if USE_LIBTOOL
373 check_PROGRAMS = test_i18n_atof test_url test_utf8
374 TESTS = $(check_PROGRAMS)
375 endif
376
377 CFLAGS_tests = `$(VLC_CONFIG) --cflags libvlc`
378
379 test_i18n_atof_SOURCES = test/i18n_atof.c text/charset.c
380 test_i18n_atof_CFLAGS = $(CFLAGS_tests)
381
382 test_url_SOURCES = test/url.c
383 test_url_LDADD = libvlc.la
384 test_url_CFLAGS = $(CFLAGS_tests)
385
386 test_utf8_SOURCES = test/utf8.c
387 test_utf8_LDADD = libvlc.la
388 test_utf8_CFLAGS = $(CFLAGS_tests)
389
390 FORCE: