]> git.sesse.net Git - vlc/blob - src/Makefile.am
Provides libvlc.sym
[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 misc/modules_builtin.h.in libvlc.sym
11
12 BUILT_SOURCES = $(CLEANFILES)
13 CLEANFILES = misc/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/mediacontrol.h \
28         ../include/vlc/mediacontrol_structures.h \
29         $(NULL)
30
31 noinst_HEADERS = $(HEADERS_include)
32 noinst_DATA = $(DATA_noinst_libvlc)
33
34 HEADERS_include = \
35         ../include/iso_lang.h \
36         ../include/main.h \
37         ../include/mmx.h \
38         ../include/vlc_modules.h \
39         ../include/vlc_modules_macros.h \
40         ../include/vlc_os_specific.h \
41         ../include/vlc_mtime.h \
42         ../include/vlc_network.h \
43         ../include/vlc_codecs.h \
44         ../include/vlc_configuration.h \
45         ../include/vlc_charset.h \
46         ../include/vlc_sout.h \
47         ../include/vlc_streaming.h \
48         ../include/vlc_variables.h \
49         ../include/vlc_aout.h \
50         ../include/vlc_access.h \
51         ../include/vlc_arrays.h \
52         ../include/vlc_acl.h \
53         ../include/vlc_bits.h \
54         ../include/vlc_block.h \
55         ../include/vlc_block_helper.h \
56         ../include/vlc_codec.h \
57         ../include/vlc_common.h \
58         ../include/vlc_config.h \
59         ../include/vlc_demux.h \
60         ../include/vlc_es.h \
61         ../include/vlc_es_out.h \
62         ../include/vlc_filter.h \
63         ../include/vlc_config_cat.h \
64         ../include/vlc_httpd.h \
65         ../include/vlc_tls.h \
66         ../include/vlc_md5.h \
67         ../include/vlc_devices.h \
68         ../include/vlc_image.h \
69         ../include/vlc_input.h \
70         ../include/vlc_interface.h \
71         ../include/vlc_intf_strings.h \
72         ../include/vlc_keys.h \
73         ../include/vlc_messages.h \
74         ../include/vlc_meta.h \
75         ../include/vlc_objects.h \
76         ../include/vlc_osd.h \
77         ../include/vlc_playlist.h \
78         ../include/vlc_stream.h \
79         ../include/vlc_strings.h \
80         ../include/vlc_symbols.h \
81         ../include/vlc_threads_funcs.h \
82         ../include/vlc_threads.h \
83         ../include/vlc_update.h \
84         ../include/vlc_url.h \
85         ../include/vlc_vout.h \
86         ../include/vlc_vlm.h \
87         ../include/vlc_vod.h \
88         ../include/vlc_xml.h \
89         ../include/vlc_vout_synchro.h \
90         $(NULL)
91
92 misc/modules_builtin.h: misc/modules_builtin.h.in
93         $(TOOLBOX) --update-includes
94         touch $@
95
96 misc/modules.c: misc/modules_builtin.h
97
98 ###############################################################################
99 # Building libvlc
100 ###############################################################################
101
102 libvlc_a_SOURCES = $(SOURCES_libvlc) $(SOURCES_libvlc_control)
103 nodist_libvlc_a_SOURCES = misc/version.c
104 libvlc_a_CFLAGS = `$(VLC_CONFIG) --cflags libvlc pic` -DUSE_BUILTINS
105 libvlc_a_CXXFLAGS = `$(VLC_CONFIG) --cxxflags libvlc pic`
106 libvlc_a_OBJCFLAGS = `$(VLC_CONFIG) --objcflags libvlc pic`
107
108 libvlc_la_SOURCES = $(SOURCES_libvlc)
109 libvlc_la_LIBADD = $(INCLUDED_LIBINTL)
110 libvlc_la_CFLAGS = `$(VLC_CONFIG) --cflags libvlc`
111 libvlc_la_CXXFLAGS = `$(VLC_CONFIG) --cxxflags libvlc`
112 libvlc_la_OBJCFLAGS = `$(VLC_CONFIG) --objcflags libvlc`
113 libvlc_la_LDFLAGS = `$(VLC_CONFIG) --libs libvlc` \
114         -no-undefined -export-symbols $(srcdir)/libvlc.sym -version-info 1:0:0
115 libvlc_la_DEPENDENCIES = libvlc.sym
116
117 libvlc_control_la_SOURCES = $(SOURCES_libvlc_control)
118 libvlc_control_la_LIBADD = libvlc.la
119 libvlc_control_la_CFLAGS = `$(VLC_CONFIG) --cflags libvlc`
120 libvlc_control_la_LDFLAGS = \
121         -no-undefined -export-symbols-regex '_?(libvlc|mediacontrol)_.*' \
122         -version-info 0:0:0
123
124 if HAVE_BEOS
125 OPT_SOURCES_libvlc_beos = $(SOURCES_libvlc_beos)
126 endif
127 if HAVE_DARWIN
128 OPT_SOURCES_libvlc_darwin = $(SOURCES_libvlc_darwin)
129 endif
130 if HAVE_WIN32
131 OPT_SOURCES_libvlc_win32 = $(SOURCES_libvlc_win32)
132 endif
133 if HAVE_WINCE
134 OPT_SOURCES_libvlc_win32 = $(SOURCES_libvlc_win32)
135 endif
136 if BUILD_DIRENT
137 OPT_SOURCES_libvlc_dirent = $(SOURCES_libvlc_dirent)
138 endif
139 if BUILD_GETOPT
140 OPT_SOURCES_libvlc_getopt = $(SOURCES_libvlc_getopt)
141 endif
142
143 # Build libvlc as a shared library
144 if USE_LIBTOOL
145 lib_LTLIBRARIES = libvlc.la libvlc-control.la
146 else
147 lib_LIBRARIES = libvlc.a
148 endif
149
150 if HAVE_WIN32
151 pic =
152 else
153 pic = pic
154 endif
155
156 if HAVE_WIN32
157 if BUILD_SHARED
158 DATA_noinst_libvlc = libvlc$(LIBEXT) libvlc$(LIBEXT).a
159 endif
160
161 libvlc.dll.a: libvlc$(LIBEXT)
162         $(DLLTOOL) --export-all-symbols -l $@ -D $< $(libvlc_a_OBJECTS)
163
164 libvlc$(LIBEXT): $(OBJECTS_libvlc_so)
165         @ldfl="`$(VLC_CONFIG) --libs plugin libvlc pic` $(INCLUDED_LIBINTL)" ; \
166         case `$(VLC_CONFIG) --linkage libvlc` in \
167           c++)  ld="$(CXXLINK)" ;; \
168           objc) ld="$(OBJCLINK)" ;; \
169           c|*)  ld="$(LINK)" ;; \
170         esac ; \
171         echo $$ld $(OBJECTS_libvlc_so) $(LDFLAGS_libvlc_so) $$ldfl; \
172         $$ld $(libvlc_a_OBJECTS) \
173                 $$ldfl
174 # It sucks big time, but we have to do that to link vlc properly
175 # on non-PIC OSes, otherwise ld will favor builtins-less libvlc.a over
176 # libvlc$(LIBEXT)
177         rm -f libvlc.a
178 # Cygwin libtool work-around
179         @if test -f "$@.exe"; then mv -f "$@.exe" "$@"; fi
180 endif
181
182 EXTRA_DIST += \
183         $(SOURCES_libvlc_beos) \
184         $(SOURCES_libvlc_darwin) \
185         $(SOURCES_libvlc_win32) \
186         $(SOURCES_libvlc_dirent) \
187         $(SOURCES_libvlc_getopt) \
188         $(NULL)
189
190 SOURCES_libvlc_beos = \
191         misc/beos_specific.cpp \
192         $(NULL)
193
194 SOURCES_libvlc_darwin = \
195         misc/darwin_specific.m \
196         $(NULL)
197
198 SOURCES_libvlc_win32 = \
199         misc/win32_specific.c \
200         $(NULL)
201
202 SOURCES_libvlc_dirent = \
203         extras/dirent.c \
204         $(NULL)
205
206 SOURCES_libvlc_getopt = \
207         extras/getopt.c \
208         extras/getopt.h \
209         extras/getopt1.c \
210         $(NULL)
211
212 SOURCES_libvlc_common = \
213         libvlc.c \
214         libvlc-common.c \
215         libvlc.h \
216         libvlc-module.c \
217         interface/interface.h \
218         interface/interface.c \
219         interface/intf_eject.c \
220         interface/interaction.c \
221         playlist/playlist_internal.h \
222         playlist/thread.c \
223         playlist/control.c \
224         playlist/engine.c \
225         playlist/sort.c \
226         playlist/loadsave.c \
227         playlist/tree.c \
228         playlist/item.c \
229         playlist/search.c \
230         playlist/services_discovery.c \
231         input/item.c \
232         input/access.c \
233         input/clock.c \
234         input/control.c \
235         input/decoder.c \
236         input/demux.c \
237         input/es_out.c \
238         input/input.c \
239         input/meta.c \
240         input/input_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         osd/osd.c \
267         osd/osd_parser.c \
268         osd/osd_text.c \
269         osd/osd_widgets.c \
270         network/acl.c \
271         network/getaddrinfo.c \
272         network/io.c \
273         network/error.c \
274         network/tcp.c \
275         network/udp.c \
276         network/httpd.c \
277         network/rootwrap.c \
278         network/tls.c \
279         text/charset.c \
280         text/strings.c \
281         text/unicode.c \
282         text/iso_lang.c \
283         text/iso-639_def.h \
284         misc/md5.c \
285         misc/mtime.c \
286         misc/block.c \
287         misc/modules.h \
288         misc/modules.c \
289         misc/threads.c \
290         misc/stats.c \
291         misc/cpu.c \
292         misc/configuration.h \
293         misc/configuration.c \
294         misc/configuration_chain.c \
295         misc/image.c \
296         misc/messages.c \
297         misc/objects.c \
298         misc/variables.h \
299         misc/variables.c \
300         misc/error.c \
301         misc/update.c \
302         input/vlm.c \
303         misc/xml.c \
304         misc/dict.c \
305         misc/devices.c \
306         extras/libc.c \
307         $(NULL)
308
309 SOURCES_libvlc = \
310         $(SOURCES_libvlc_common) \
311         $(OPT_SOURCES_libvlc_beos) \
312         $(OPT_SOURCES_libvlc_darwin) \
313         $(OPT_SOURCES_libvlc_win32) \
314         $(OPT_SOURCES_libvlc_dirent) \
315         $(OPT_SOURCES_libvlc_getopt) \
316         $(NULL)
317
318 SOURCES_libvlc_control = \
319         control/libvlc_internal.h \
320         control/core.c \
321         control/log.c \
322         control/playlist.c \
323         control/vlm.c \
324         control/input.c \
325         control/video.c \
326         control/audio.c \
327         control/mediacontrol_internal.h \
328         control/mediacontrol_core.c \
329         control/mediacontrol_util.c \
330         control/mediacontrol_audio_video.c
331
332 if !USE_LIBTOOL
333 if !BUILD_SHARED
334 CLEANFILES += misc/version.c
335 endif
336
337 # Install shared libvlc
338 install-exec-local:
339         test -z "$(DATA_noinst_libvlc)" || $(INSTALL_PROGRAM) "$(DATA_noinst_libvlc)" "$(DESTDIR)$(libdir)"
340
341 # the opposite of install-{data,exec}-local
342 uninstall-local:
343         test -z "$(DATA_noinst_libvlc)" || rm -f "$(DESTDIR)$(libdir)/$(DATA_noinst_libvlc)"
344 endif
345
346 misc/version.c: FORCE
347         $(TOOLBOX) --update-version
348
349 ###############################################################################
350 # Stamp rules
351 ###############################################################################
352
353 if !USE_LIBTOOL
354 if !BUILD_SHARED
355 stamp-api: Makefile.in $(HEADERS_include) ../vlc-api.pl
356         ( cd $(srcdir) && cat $(HEADERS_include) ) | \
357           top_srcdir="$(top_srcdir)" perl $(top_srcdir)/vlc-api.pl
358         touch stamp-api
359
360 CLEANFILES += stamp-api
361 endif
362 endif
363
364 ###############################################################################
365 # Unit/regression test
366 ###############################################################################
367 if USE_LIBTOOL
368 check_PROGRAMS = test_i18n_atof test_url
369 TESTS = $(check_PROGRAMS)
370
371 CFLAGS_tests = `$(VLC_CONFIG) --cflags libvlc`
372
373 test_i18n_atof_SOURCES = test/i18n_atof.c
374 test_i18n_atof_LDADD = libvlc.la
375 test_i18n_atof_CFLAGS = $(CFLAGS_tests)
376
377 test_url_SOURCES = test/url.c
378 test_url_LDADD = libvlc.la
379 test_url_CFLAGS = $(CFLAGS_tests)
380 endif
381
382 FORCE: