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