]> git.sesse.net Git - vlc/blob - src/Makefile.am
libtool: prefer -export-dynamic over -export-regex, -export-symbols if compiler alrea...
[vlc] / src / Makefile.am
1 ###############################################################################
2 # Automake targets and declarations
3 ###############################################################################
4
5 AUTOMAKE_OPTIONS = subdir-objects
6
7 NULL =
8 EXTRA_DIST = extras/COPYING modules/builtin.h.in libvlc.sym
9
10 BUILT_SOURCES = modules/builtin.h misc/revision.c
11 CLEANFILES = $(BUILT_SOURCES)
12
13 TOOLBOX = srcdir=$(top_srcdir) builddir=$(top_builddir) $(top_srcdir)/toolbox
14
15 ###############################################################################
16 # Headers
17 ###############################################################################
18
19 pkgincludedir = $(includedir)/vlc
20
21 dist_pkginclude_HEADERS = \
22         ../include/vlc/vlc.h \
23         ../include/vlc/libvlc.h \
24         ../include/vlc/libvlc_structures.h \
25         ../include/vlc/mediacontrol.h \
26         ../include/vlc/mediacontrol_structures.h \
27         $(NULL)
28
29 noinst_HEADERS = $(HEADERS_include)
30
31 HEADERS_include = \
32         ../include/iso_lang.h \
33         ../include/main.h \
34         ../include/mmx.h \
35         ../include/vlc_modules.h \
36         ../include/vlc_modules_macros.h \
37         ../include/vlc_os_specific.h \
38         ../include/vlc_mtime.h \
39         ../include/vlc_network.h \
40         ../include/vlc_codecs.h \
41         ../include/vlc_configuration.h \
42         ../include/vlc_charset.h \
43         ../include/vlc_sout.h \
44         ../include/vlc_streaming.h \
45         ../include/vlc_variables.h \
46         ../include/vlc_aout.h \
47         ../include/vlc_access.h \
48         ../include/vlc_arrays.h \
49         ../include/vlc_acl.h \
50         ../include/vlc_bits.h \
51         ../include/vlc_block.h \
52         ../include/vlc_block_helper.h \
53         ../include/vlc_codec.h \
54         ../include/vlc_common.h \
55         ../include/vlc_config.h \
56         ../include/vlc_demux.h \
57         ../include/vlc_es.h \
58         ../include/vlc_es_out.h \
59         ../include/vlc_epg.h \
60         ../include/vlc_filter.h \
61         ../include/vlc_config_cat.h \
62         ../include/vlc_httpd.h \
63         ../include/vlc_tls.h \
64         ../include/vlc_md5.h \
65         ../include/vlc_devices.h \
66         ../include/vlc_image.h \
67         ../include/vlc_input.h \
68         ../include/vlc_interface.h \
69         ../include/vlc_intf_strings.h \
70         ../include/vlc_keys.h \
71         ../include/vlc_messages.h \
72         ../include/vlc_meta.h \
73         ../include/vlc_objects.h \
74         ../include/vlc_osd.h \
75         ../include/vlc_playlist.h \
76         ../include/vlc_stream.h \
77         ../include/vlc_strings.h \
78         ../include/vlc_threads_funcs.h \
79         ../include/vlc_threads.h \
80         ../include/vlc_update.h \
81         ../include/vlc_url.h \
82         ../include/vlc_vout.h \
83         ../include/vlc_vlm.h \
84         ../include/vlc_vod.h \
85         ../include/vlc_xml.h \
86         ../include/vlc_vout_synchro.h \
87         $(NULL)
88
89 modules/builtin.h: modules/builtin.h.in
90         $(TOOLBOX) --update-includes
91         touch $@
92
93 modules/modules.c: modules/builtin.h
94
95 ###############################################################################
96 # Building libvlc
97 ###############################################################################
98
99 lib_LTLIBRARIES = libvlc.la libvlc-control.la
100
101 AM_LDFLAGS = -no-undefined
102 if HAVE_WIN32
103 AM_LDFLAGS += -avoid-version
104 endif
105
106 libvlc_la_SOURCES = $(SOURCES_libvlc)
107 nodist_libvlc_la_SOURCES = misc/revision.c
108 libvlc_la_LIBADD = $(LTLIBINTL)
109 libvlc_la_CFLAGS = `$(VLC_CONFIG) --cflags libvlc`
110 libvlc_la_CXXFLAGS = `$(VLC_CONFIG) --cxxflags libvlc`
111 libvlc_la_OBJCFLAGS = `$(VLC_CONFIG) --objcflags libvlc`
112 libvlc_la_LDFLAGS = $(AM_LDFLAGS) `$(VLC_CONFIG) --libs libvlc` \
113         -version-info 1:0:0
114 if HAVE_COMPILER_EXPORT
115 libvlc_la_LDFLAGS += -export-dynamic
116 else
117 libvlc_la_LDFLAGS += -export-symbols $(srcdir)/libvlc.sym 
118 endif
119
120 libvlc_la_DEPENDENCIES = libvlc.sym
121
122 libvlc_control_la_SOURCES = $(SOURCES_libvlc_control)
123 libvlc_control_la_LIBADD = libvlc.la
124 libvlc_control_la_CFLAGS = `$(VLC_CONFIG) --cflags libvlc`
125 libvlc_control_la_LDFLAGS = $(AM_LDFLAGS) -export-symbols-regex '^_?(libvlc|mediacontrol)_.*' \
126         -version-info 0:0:0
127 if HAVE_COMPILER_EXPORT
128 libvlc_control_la_LDFLAGS += -export-dynamic
129 else
130 libvlc_control_la_LDFLAGS += -export-symbols-regex '^_?(libvlc|mediacontrol)_.*'
131 endif
132
133
134 EXTRA_libvlc_la_SOURCES = \
135         $(SOURCES_libvlc_beos) \
136         $(SOURCES_libvlc_darwin) \
137         $(SOURCES_libvlc_win32) \
138         $(SOURCES_libvlc_dirent) \
139         $(SOURCES_libvlc_getopt) \
140         $(NULL)
141 if HAVE_BEOS
142 libvlc_la_SOURCES += $(SOURCES_libvlc_beos)
143 endif
144 if HAVE_DARWIN
145 libvlc_la_SOURCES += $(SOURCES_libvlc_darwin)
146 endif
147 if HAVE_WIN32
148 libvlc_la_SOURCES += $(SOURCES_libvlc_win32)
149 endif
150 if HAVE_WINCE
151 libvlc_la_SOURCES += $(SOURCES_libvlc_win32)
152 endif
153 if BUILD_DIRENT
154 libvlc_la_SOURCES += $(SOURCES_libvlc_dirent)
155 endif
156 if BUILD_GETOPT
157 libvlc_la_SOURCES += $(SOURCES_libvlc_getopt)
158 endif
159
160 SOURCES_libvlc_beos = \
161         misc/beos_specific.cpp \
162         $(NULL)
163
164 SOURCES_libvlc_darwin = \
165         misc/darwin_specific.c \
166         $(NULL)
167
168 SOURCES_libvlc_win32 = \
169         misc/win32_specific.c \
170         $(NULL)
171
172 SOURCES_libvlc_dirent = \
173         extras/dirent.c \
174         $(NULL)
175
176 SOURCES_libvlc_getopt = \
177         extras/getopt.c \
178         extras/getopt.h \
179         extras/getopt1.c \
180         $(NULL)
181
182 SOURCES_libvlc_common = \
183         libvlc.c \
184         libvlc-common.c \
185         libvlc.h \
186         libvlc-module.c \
187         interface/interface.h \
188         interface/interface.c \
189         interface/intf_eject.c \
190         interface/interaction.c \
191         playlist/playlist_internal.h \
192         playlist/thread.c \
193         playlist/control.c \
194         playlist/engine.c \
195         playlist/sort.c \
196         playlist/loadsave.c \
197         playlist/tree.c \
198         playlist/item.c \
199         playlist/search.c \
200         playlist/services_discovery.c \
201         input/item.c \
202         input/access.c \
203         input/clock.c \
204         input/control.c \
205         input/decoder.c \
206         input/demux.c \
207         input/es_out.c \
208         input/input.c \
209         input/meta.c \
210         input/input_internal.h \
211         input/vlm_internal.h \
212         input/stream.c \
213         input/mem_stream.c \
214         input/subtitles.c \
215         input/var.c \
216         video_output/video_output.c \
217         video_output/vout_pictures.c \
218         video_output/vout_pictures.h \
219         video_output/video_text.c \
220         video_output/video_widgets.c \
221         video_output/vout_subpictures.c \
222         video_output/vout_synchro.c \
223         video_output/vout_intf.c \
224         audio_output/aout_internal.h \
225         audio_output/common.c \
226         audio_output/dec.c \
227         audio_output/filters.c \
228         audio_output/input.c \
229         audio_output/mixer.c \
230         audio_output/output.c \
231         audio_output/intf.c \
232         stream_output/stream_output.c \
233         stream_output/stream_output.h \
234         stream_output/announce.c \
235         stream_output/profiles.c \
236         stream_output/sap.c \
237         stream_output/sdp.c \
238         osd/osd.c \
239         osd/osd_parser.c \
240         osd/osd_text.c \
241         osd/osd_widgets.c \
242         network/acl.c \
243         network/getaddrinfo.c \
244         network/io.c \
245         network/error.c \
246         network/tcp.c \
247         network/udp.c \
248         network/httpd.c \
249         network/rootwrap.c \
250         network/tls.c \
251         network/poll.c \
252         text/charset.c \
253         text/strings.c \
254         text/unicode.c \
255         text/wincp.c \
256         text/iso_lang.c \
257         text/iso-639_def.h \
258         misc/md5.c \
259         misc/mtime.c \
260         misc/block.c \
261         modules/modules.h \
262         modules/modules.c \
263         modules/entry.c \
264         misc/threads.c \
265         misc/stats.c \
266         misc/cpu.c \
267         modules/configuration.h \
268         modules/configuration.c \
269         modules/configuration_chain.c \
270         misc/image.c \
271         misc/messages.c \
272         misc/objects.c \
273         misc/variables.h \
274         misc/variables.c \
275         misc/error.c \
276         misc/update.c \
277         input/vlm.c \
278         misc/xml.c \
279         misc/devices.c \
280         extras/libc.c \
281         $(NULL)
282
283 SOURCES_libvlc = \
284         $(SOURCES_libvlc_common) \
285         $(OPT_SOURCES_libvlc_beos) \
286         $(OPT_SOURCES_libvlc_darwin) \
287         $(OPT_SOURCES_libvlc_win32) \
288         $(OPT_SOURCES_libvlc_dirent) \
289         $(OPT_SOURCES_libvlc_getopt) \
290         $(NULL)
291
292 SOURCES_libvlc_control = \
293         control/libvlc_internal.h \
294         control/core.c \
295         control/log.c \
296         control/playlist.c \
297         control/vlm.c \
298         control/video.c \
299         control/audio.c \
300         control/event.c \
301         control/media_descriptor.c \
302         control/media_instance.c \
303         control/mediacontrol_internal.h \
304         control/mediacontrol_core.c \
305         control/mediacontrol_util.c \
306         control/mediacontrol_audio_video.c
307
308 ###############################################################################
309 # Stamp rules
310 ###############################################################################
311
312 misc/revision.c:
313         rm -f $@ $@.tmp
314         echo "/* AUTOGENERATED FILE - DO NOT EDIT */" > $@.tmp
315         REVISION="$$(LANG=C svnversion "$(top_srcdir)" 2>/dev/null || echo exported)" ; \
316         echo "const char psz_vlc_changeset[] = \"$$REVISION\";" >> $@.tmp
317         mv -f $@.tmp $@
318
319 ###############################################################################
320 # Unit/regression test
321 ###############################################################################
322 check_PROGRAMS = test_i18n_atof test_url test_utf8
323 TESTS = $(check_PROGRAMS)
324
325 CFLAGS_tests = `$(VLC_CONFIG) --cflags libvlc`
326
327 test_i18n_atof_SOURCES = test/i18n_atof.c text/charset.c
328 test_i18n_atof_CFLAGS = $(CFLAGS_tests)
329
330 test_url_SOURCES = test/url.c
331 test_url_LDADD = libvlc.la
332 test_url_CFLAGS = $(CFLAGS_tests)
333
334 test_utf8_SOURCES = test/utf8.c
335 test_utf8_LDADD = libvlc.la
336 test_utf8_CFLAGS = $(CFLAGS_tests)
337
338 FORCE:
339         @echo "Generated source cannot be phony. Go away." >&2
340         @exit 1
341
342 .PHONY: FORCE