]> git.sesse.net Git - vlc/blob - src/Makefile.am
src/Makefile.am: Only allow libvlc-control symbols that are prefixed by libvlc|mediac...
[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 = modules/builtin.h misc/revision.c
13 CLEANFILES = $(BUILT_SOURCES)
14 MOSTLYCLEANFILES = $(hacklib_DATA) $(noinst_DATA)
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
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_epg.h \
63         ../include/vlc_filter.h \
64         ../include/vlc_config_cat.h \
65         ../include/vlc_httpd.h \
66         ../include/vlc_tls.h \
67         ../include/vlc_md5.h \
68         ../include/vlc_devices.h \
69         ../include/vlc_image.h \
70         ../include/vlc_input.h \
71         ../include/vlc_interface.h \
72         ../include/vlc_intf_strings.h \
73         ../include/vlc_keys.h \
74         ../include/vlc_messages.h \
75         ../include/vlc_meta.h \
76         ../include/vlc_objects.h \
77         ../include/vlc_osd.h \
78         ../include/vlc_playlist.h \
79         ../include/vlc_stream.h \
80         ../include/vlc_strings.h \
81         ../include/vlc_symbols.h \
82         ../include/vlc_threads_funcs.h \
83         ../include/vlc_threads.h \
84         ../include/vlc_update.h \
85         ../include/vlc_url.h \
86         ../include/vlc_vout.h \
87         ../include/vlc_vlm.h \
88         ../include/vlc_vod.h \
89         ../include/vlc_xml.h \
90         ../include/vlc_vout_synchro.h \
91         $(NULL)
92
93 modules/builtin.h: modules/builtin.h.in
94         $(TOOLBOX) --update-includes
95         touch $@
96
97 modules/modules.c: modules/builtin.h
98
99 ###############################################################################
100 # Building libvlc
101 ###############################################################################
102
103 lib_LTLIBRARIES = libvlc.la libvlc-control.la
104
105 AM_LDFLAGS =
106 if HAVE_WIN32
107 AM_LDFLAGS += -static
108 endif
109
110 libvlc_la_SOURCES = $(SOURCES_libvlc)
111 nodist_libvlc_la_SOURCES = misc/revision.c
112 libvlc_la_LIBADD = $(INCLUDED_LIBINTL)
113 libvlc_la_CFLAGS = `$(VLC_CONFIG) --cflags libvlc`
114 libvlc_la_CXXFLAGS = `$(VLC_CONFIG) --cxxflags libvlc`
115 libvlc_la_OBJCFLAGS = `$(VLC_CONFIG) --objcflags libvlc`
116 libvlc_la_LDFLAGS = `$(VLC_CONFIG) --libs libvlc` $(AM_LDFLAGS) \
117         -no-undefined -export-symbols $(srcdir)/libvlc.sym -version-info 1:0:0
118 libvlc_la_DEPENDENCIES = libvlc.sym
119
120 libvlc_control_la_SOURCES = $(SOURCES_libvlc_control)
121 libvlc_control_la_LIBADD = libvlc.la
122 libvlc_control_la_CFLAGS = `$(VLC_CONFIG) --cflags libvlc`
123 libvlc_control_la_LDFLAGS = $(AM_LDFLAGS) \
124         -no-undefined -export-symbols-regex '^_?(libvlc|mediacontrol)_.*' \
125         -version-info 0:0:0
126
127 EXTRA_libvlc_la_SOURCES = \
128         $(SOURCES_libvlc_beos) \
129         $(SOURCES_libvlc_darwin) \
130         $(SOURCES_libvlc_win32) \
131         $(SOURCES_libvlc_dirent) \
132         $(SOURCES_libvlc_getopt) \
133         $(NULL)
134 if HAVE_BEOS
135 libvlc_la_SOURCES += $(SOURCES_libvlc_beos)
136 endif
137 if HAVE_DARWIN
138 libvlc_la_SOURCES += $(SOURCES_libvlc_darwin)
139 endif
140 if HAVE_WIN32
141 libvlc_la_SOURCES += $(SOURCES_libvlc_win32)
142 endif
143 if HAVE_WINCE
144 libvlc_la_SOURCES += $(SOURCES_libvlc_win32)
145 endif
146 if BUILD_DIRENT
147 libvlc_la_SOURCES += $(SOURCES_libvlc_dirent)
148 endif
149 if BUILD_GETOPT
150 libvlc_la_SOURCES += $(SOURCES_libvlc_getopt)
151 endif
152
153 if HAVE_WIN32
154 # Überhack. Needs fixing.
155 hacklibdir = $(libdir)
156 hacklib_DATA = libvlc.dll libvlc.dll.a
157 noinst_DATA = libvlc.def
158
159 libvlc.dll.a libvlc.def: libvlc.dll
160         $(DLLTOOL) -z libvlc.def -l libvlc.dll.a -D $< $(libvlc_a_OBJECTS)
161
162 libvlc.dll: $(libvlc_la_OBJECTS)
163
164 .la.dll:
165         @ldfl="`$(VLC_CONFIG) --libs plugin libvlc pic`" ; \
166         objs="" ; \
167         for s in $^; do \
168                 test "$$s" = "$<" || \
169                 objs="$$objs $$(dirname "$$s")/.libs/$$(basename $${s%.lo}).o" ; \
170         done ; \
171         case `$(VLC_CONFIG) --linkage libvlc` in \
172           c++)  ld="$(CXXLINK)" ;; \
173           c|*)  ld="$(LINK)" ;; \
174         esac ; \
175         echo $$ld $$objs$ldfl; \
176         $$ld $$objs $$ldfl 
177 # Cygwin libtool work-around
178         @if test -f "$@.exe"; then mv -f "$@.exe" "$@"; fi
179 endif
180
181 SOURCES_libvlc_beos = \
182         misc/beos_specific.cpp \
183         $(NULL)
184
185 SOURCES_libvlc_darwin = \
186         misc/darwin_specific.c \
187         $(NULL)
188
189 SOURCES_libvlc_win32 = \
190         misc/win32_specific.c \
191         $(NULL)
192
193 SOURCES_libvlc_dirent = \
194         extras/dirent.c \
195         $(NULL)
196
197 SOURCES_libvlc_getopt = \
198         extras/getopt.c \
199         extras/getopt.h \
200         extras/getopt1.c \
201         $(NULL)
202
203 SOURCES_libvlc_common = \
204         libvlc.c \
205         libvlc-common.c \
206         libvlc.h \
207         libvlc-module.c \
208         interface/interface.h \
209         interface/interface.c \
210         interface/intf_eject.c \
211         interface/interaction.c \
212         playlist/playlist_internal.h \
213         playlist/thread.c \
214         playlist/control.c \
215         playlist/engine.c \
216         playlist/sort.c \
217         playlist/loadsave.c \
218         playlist/tree.c \
219         playlist/item.c \
220         playlist/search.c \
221         playlist/services_discovery.c \
222         input/item.c \
223         input/access.c \
224         input/clock.c \
225         input/control.c \
226         input/decoder.c \
227         input/demux.c \
228         input/es_out.c \
229         input/input.c \
230         input/meta.c \
231         input/input_internal.h \
232         input/vlm_internal.h \
233         input/stream.c \
234         input/mem_stream.c \
235         input/subtitles.c \
236         input/var.c \
237         video_output/video_output.c \
238         video_output/vout_pictures.c \
239         video_output/vout_pictures.h \
240         video_output/video_text.c \
241         video_output/video_widgets.c \
242         video_output/vout_subpictures.c \
243         video_output/vout_synchro.c \
244         video_output/vout_intf.c \
245         audio_output/aout_internal.h \
246         audio_output/common.c \
247         audio_output/dec.c \
248         audio_output/filters.c \
249         audio_output/input.c \
250         audio_output/mixer.c \
251         audio_output/output.c \
252         audio_output/intf.c \
253         stream_output/stream_output.c \
254         stream_output/stream_output.h \
255         stream_output/announce.c \
256         stream_output/profiles.c \
257         stream_output/sap.c \
258         stream_output/sdp.c \
259         osd/osd.c \
260         osd/osd_parser.c \
261         osd/osd_text.c \
262         osd/osd_widgets.c \
263         network/acl.c \
264         network/getaddrinfo.c \
265         network/io.c \
266         network/error.c \
267         network/tcp.c \
268         network/udp.c \
269         network/httpd.c \
270         network/rootwrap.c \
271         network/tls.c \
272         network/poll.c \
273         text/charset.c \
274         text/strings.c \
275         text/unicode.c \
276         text/wincp.c \
277         text/iso_lang.c \
278         text/iso-639_def.h \
279         misc/md5.c \
280         misc/mtime.c \
281         misc/block.c \
282         modules/modules.h \
283         modules/modules.c \
284         modules/entry.c \
285         misc/threads.c \
286         misc/stats.c \
287         misc/cpu.c \
288         modules/configuration.h \
289         modules/configuration.c \
290         modules/configuration_chain.c \
291         misc/image.c \
292         misc/messages.c \
293         misc/objects.c \
294         misc/variables.h \
295         misc/variables.c \
296         misc/error.c \
297         misc/update.c \
298         input/vlm.c \
299         misc/xml.c \
300         misc/devices.c \
301         extras/libc.c \
302         $(NULL)
303
304 SOURCES_libvlc = \
305         $(SOURCES_libvlc_common) \
306         $(OPT_SOURCES_libvlc_beos) \
307         $(OPT_SOURCES_libvlc_darwin) \
308         $(OPT_SOURCES_libvlc_win32) \
309         $(OPT_SOURCES_libvlc_dirent) \
310         $(OPT_SOURCES_libvlc_getopt) \
311         $(NULL)
312
313 SOURCES_libvlc_control = \
314         control/libvlc_internal.h \
315         control/core.c \
316         control/log.c \
317         control/playlist.c \
318         control/vlm.c \
319         control/video.c \
320         control/audio.c \
321         control/event.c \
322         control/media_descriptor.c \
323         control/media_instance.c \
324         control/mediacontrol_internal.h \
325         control/mediacontrol_core.c \
326         control/mediacontrol_util.c \
327         control/mediacontrol_audio_video.c
328
329 ###############################################################################
330 # Stamp rules
331 ###############################################################################
332
333 if !USE_LIBTOOL
334 if !HAVE_WIN32
335 stamp-api: Makefile.in $(HEADERS_include) ../vlc-api.pl
336         ( cd $(srcdir) && cat $(HEADERS_include) ) | \
337           top_srcdir="$(top_srcdir)" perl $(top_srcdir)/vlc-api.pl
338         touch stamp-api
339
340 CLEANFILES += stamp-api
341 endif
342 endif
343
344 misc/revision.c:
345         rm -f $@ $@.tmp
346         echo "/* AUTOGENERATED FILE - DO NOT EDIT */" > $@.tmp
347         REVISION="$$(LANG=C svnversion "$(top_srcdir)" 2>/dev/null || echo exported)" ; \
348         echo "const char psz_vlc_changeset[] = \"$$REVISION\";" >> $@.tmp
349         mv -f $@.tmp $@
350
351 ###############################################################################
352 # Unit/regression test
353 ###############################################################################
354 if USE_LIBTOOL
355 check_PROGRAMS = test_i18n_atof test_url test_utf8
356 TESTS = $(check_PROGRAMS)
357 endif
358
359 CFLAGS_tests = `$(VLC_CONFIG) --cflags libvlc`
360
361 test_i18n_atof_SOURCES = test/i18n_atof.c text/charset.c
362 test_i18n_atof_CFLAGS = $(CFLAGS_tests)
363
364 test_url_SOURCES = test/url.c
365 test_url_LDADD = libvlc.la
366 test_url_CFLAGS = $(CFLAGS_tests)
367
368 test_utf8_SOURCES = test/utf8.c
369 test_utf8_LDADD = libvlc.la
370 test_utf8_CFLAGS = $(CFLAGS_tests)
371
372 FORCE:
373         @echo "Generated source cannot be phony. Go away." >&2
374         @exit 1
375
376 .PHONY: FORCE