]> git.sesse.net Git - vlc/blob - src/Makefile.am
Basic unit test for URI decoding
[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
11
12 BUILT_SOURCES = $(DISTCLEANFILES) $(CLEANFILES)
13 DISTCLEANFILES = stamp-api
14 CLEANFILES = misc/modules_builtin.h
15 MOSTLYCLEANFILES = $(DATA_noinst_libvlc) stamp-builtins
16
17 TOOLBOX = srcdir=$(top_srcdir) builddir=$(top_builddir) $(top_srcdir)/toolbox
18
19 ###############################################################################
20 # Headers
21 ###############################################################################
22
23 pkgincludedir = $(includedir)/vlc
24
25 dist_pkginclude_HEADERS = \
26         ../include/vlc/vlc.h \
27         ../include/vlc/libvlc.h \
28         ../include/vlc/aout.h \
29         ../include/vlc/vout.h \
30         ../include/vlc/sout.h \
31         ../include/vlc/decoder.h \
32         ../include/vlc/input.h \
33         ../include/vlc/intf.h \
34         ../include/vlc/mediacontrol.h \
35         ../include/vlc/mediacontrol_structures.h \
36         $(NULL)
37
38 noinst_HEADERS = $(HEADERS_include)
39 noinst_DATA = $(DATA_noinst_libvlc)
40
41 HEADERS_include = \
42         ../include/aout_internal.h \
43         ../include/audio_output.h \
44         ../include/beos_specific.h \
45         ../include/charset.h \
46         ../include/codecs.h \
47         ../include/configuration.h \
48         ../include/darwin_specific.h \
49         ../include/intf_eject.h \
50         ../include/iso_lang.h \
51         ../include/main.h \
52         ../include/mmx.h \
53         ../include/modules.h \
54         ../include/modules_inner.h \
55         ../include/mtime.h \
56         ../include/network.h \
57         ../include/os_specific.h \
58         ../include/snapshot.h \
59         ../include/stream_output.h \
60         ../include/variables.h \
61         ../include/video_output.h \
62         ../include/vlc_access.h \
63         ../include/vlc_acl.h \
64         ../include/vlc_bits.h \
65         ../include/vlc_block.h \
66         ../include/vlc_block_helper.h \
67         ../include/vlc_codec.h \
68         ../include/vlc_common.h \
69         ../include/vlc_config.h \
70         ../include/vlc_cpu.h \
71         ../include/vlc_demux.h \
72         ../include/vlc_error.h \
73         ../include/vlc_es.h \
74         ../include/vlc_es_out.h \
75         ../include/vlc_filter.h \
76         ../include/vlc_config_cat.h \
77         ../include/vlc_httpd.h \
78         ../include/vlc_tls.h \
79         ../include/vlc_md5.h \
80         ../include/vlc_image.h \
81         ../include/vlc_input.h \
82         ../include/vlc_interaction.h \
83         ../include/vlc_interface.h \
84         ../include/vlc_keys.h \
85         ../include/vlc_messages.h \
86         ../include/vlc_meta.h \
87         ../include/vlc_objects.h \
88         ../include/vlc_osd.h \
89         ../include/vlc_playlist.h \
90         ../include/vlc_spu.h \
91         ../include/vlc_stream.h \
92         ../include/vlc_strings.h \
93         ../include/vlc_symbols.h \
94         ../include/vlc_threads_funcs.h \
95         ../include/vlc_threads.h \
96         ../include/vlc_update.h \
97         ../include/vlc_url.h \
98         ../include/vlc_video.h \
99         ../include/vlc_vlm.h \
100         ../include/vlc_vod.h \
101         ../include/vlc_xml.h \
102         ../include/vout_synchro.h \
103         ../include/win32_specific.h \
104         ../include/libvlc_internal.h \
105         ../include/mediacontrol_internal.h
106         $(NULL)
107
108 misc/modules_builtin.h: Makefile misc/modules_builtin.h.in ../vlc-config
109         $(TOOLBOX) --update-includes
110         touch $@
111
112 misc/modules.c: misc/modules_builtin.h
113
114 ###############################################################################
115 # Building builtin modules
116 ###############################################################################
117 #
118 # As long as we use builtins with a shared libvlc, we must build them before
119 # we build libvlc. Maybe one day, libvlc will handle multiple modules per
120 # shared object, which will make builtins fairly redumdant. Until then, we
121 # need this workaround.
122
123 stamp-builtins: Makefile ../vlc-config ../config.status
124 if USE_LIBTOOL
125         @for c in `$(VLC_CONFIG) --libs builtin`; do \
126                 case $$c in \
127                         ../modules/*.a) echo $$c ;; \
128                 esac ; \
129         done | \
130         sed -e 's/^\(.*\)\/\([^\/]*\)\.a$$/cd \1 \&\& $(MAKE) \2_builtin.la/g' | \
131         while read cmd; do echo $$cmd; eval "($$cmd)" || exit $$? ; done
132 endif
133 if BUILD_SHARED
134         @if test "$(pic)" = "pic"; then ext="_pic.a"; else ext=".a"; fi ; \
135         for c in `$(VLC_CONFIG) --libs builtin`; do \
136                 case $$c in \
137                         ../modules/*.a) echo $$c ;; \
138                 esac ; \
139         done | \
140         sed -e 's/^\(.*\)\/\([^\/]*\)\.a$$/cd \1 \&\& $(MAKE) \2/g' | \
141         while read cmd; do echo $$cmd$$ext; eval "($$cmd$$ext)" || exit $$? ; done
142 endif
143         touch $@
144
145 ###############################################################################
146 # Building libvlc
147 ###############################################################################
148
149 libvlc_a_SOURCES = $(SOURCES_libvlc)
150 libvlc_a_CFLAGS = `$(VLC_CONFIG) --cflags vlc`
151 libvlc_a_CXXFLAGS = `$(VLC_CONFIG) --cxxflags vlc`
152 libvlc_a_OBJCFLAGS = `$(VLC_CONFIG) --objcflags vlc`
153
154 libvlc_pic_a_SOURCES = $(SOURCES_libvlc)
155 libvlc_pic_a_CFLAGS = `$(VLC_CONFIG) --cflags vlc pic`
156 libvlc_pic_a_CXXFLAGS = `$(VLC_CONFIG) --cxxflags vlc pic`
157 libvlc_pic_a_OBJCFLAGS = `$(VLC_CONFIG) --objcflags vlc pic`
158
159 libvlc_la_SOURCES = $(SOURCES_libvlc)
160 libvlc_la_LIBADD = $(INCLUDED_LIBINTL)
161 libvlc_la_CFLAGS = `$(VLC_CONFIG) --cflags vlc`
162 libvlc_la_CXXFLAGS = `$(VLC_CONFIG) --cxxflags vlc`
163 libvlc_la_OBJCFLAGS = `$(VLC_CONFIG) --objcflags vlc`
164 libvlc_la_LDFLAGS = `$(VLC_CONFIG) --libs vlc builtin|sed -e 's/\(modules\/[^ ]*\)\.a /\1_builtin.la /g'` \
165                 -avoid-version -no-undefined
166 libvlc_la_DEPENDENCIES = stamp-builtins
167
168
169 if HAVE_BEOS
170 OPT_SOURCES_libvlc_beos = $(SOURCES_libvlc_beos)
171 endif
172 if HAVE_DARWIN
173 OPT_SOURCES_libvlc_darwin = $(SOURCES_libvlc_darwin)
174 endif
175 if HAVE_WIN32
176 OPT_SOURCES_libvlc_win32 = $(SOURCES_libvlc_win32)
177 endif
178 if HAVE_WINCE
179 OPT_SOURCES_libvlc_win32 = $(SOURCES_libvlc_win32)
180 endif
181 if BUILD_DIRENT
182 OPT_SOURCES_libvlc_dirent = $(SOURCES_libvlc_dirent)
183 endif
184 if BUILD_GETOPT
185 OPT_SOURCES_libvlc_getopt = $(SOURCES_libvlc_getopt)
186 endif
187
188 # Build libvlc as a shared library
189 if USE_LIBTOOL
190 lib_LTLIBRARIES = libvlc.la
191 else
192 lib_LIBRARIES = libvlc.a
193 if BUILD_PIC
194 lib_LIBRARIES += libvlc_pic.a
195 endif
196 endif
197
198 if HAVE_WIN32
199 if BUILD_SHARED
200 DATA_noinst_libvlc = libvlc$(LIBEXT)
201 endif
202
203 libvlc.dll.a: libvlc$(LIBEXT)
204
205 libvlc$(LIBEXT): $(OBJECTS_libvlc_so) stamp-builtins
206         @ldfl="`$(VLC_CONFIG) --libs plugin vlc builtin $(pic)` $(INCLUDED_LIBINTL)" ; \
207         case `$(VLC_CONFIG) --linkage vlc builtin` in \
208           c++)  ld="$(CXXLINK)" ;; \
209           objc) ld="$(OBJCLINK)" ;; \
210           c|*)  ld="$(LINK)" ;; \
211         esac ; \
212         echo $$ld $(OBJECTS_libvlc_so) $(LDFLAGS_libvlc_so) $$ldfl; \
213         $$ld $(libvlc_a_OBJECTS) \
214                 -Wl,--out-implib,$(top_builddir)/src/libvlc.dll.a $$ldfl
215 # It sucks big time, but we have to do that to link vlc properly
216 # on non-PIC OSes, otherwise ld will favor builtins-less libvlc.a over
217 # libvlc$(LIBEXT)
218         rm -f libvlc.a
219 # Cygwin work-around
220         @if test -f "$@.exe"; then mv -f "$@.exe" "$@"; fi
221 endif
222
223 EXTRA_DIST += \
224         $(SOURCES_libvlc_beos) \
225         $(SOURCES_libvlc_darwin) \
226         $(SOURCES_libvlc_win32) \
227         $(SOURCES_libvlc_dirent) \
228         $(SOURCES_libvlc_getopt) \
229         $(NULL)
230
231 SOURCES_libvlc_beos = \
232         misc/beos_specific.cpp \
233         $(NULL)
234
235 SOURCES_libvlc_darwin = \
236         misc/darwin_specific.m \
237         $(NULL)
238
239 SOURCES_libvlc_win32 = \
240         misc/win32_specific.c \
241         $(NULL)
242
243 SOURCES_libvlc_dirent = \
244         extras/dirent.c \
245         $(NULL)
246
247 SOURCES_libvlc_getopt = \
248         extras/getopt.c \
249         extras/getopt.h \
250         extras/getopt1.c \
251         $(NULL)
252
253 SOURCES_libvlc_common = \
254         libvlc.c \
255         libvlc.h \
256         interface/interface.c \
257         interface/intf_eject.c \
258         interface/interaction.c \
259         playlist/playlist.c \
260         playlist/sort.c \
261         playlist/loadsave.c \
262         playlist/view.c \
263         playlist/item.c \
264         playlist/item-ext.c \
265         playlist/services_discovery.c \
266         input/access.c \
267         input/clock.c \
268         input/control.c \
269         input/decoder.c \
270         input/demux.c \
271         input/es_out.c \
272         input/input.c \
273         input/input_internal.h \
274         input/stream.c \
275         input/mem_stream.c \
276         input/subtitles.c \
277         input/var.c \
278         video_output/video_output.c \
279         video_output/vout_pictures.c \
280         video_output/vout_pictures.h \
281         video_output/video_text.c \
282         video_output/video_widgets.c \
283         video_output/vout_subpictures.c \
284         video_output/vout_synchro.c \
285         video_output/vout_intf.c \
286         audio_output/common.c \
287         audio_output/dec.c \
288         audio_output/filters.c \
289         audio_output/input.c \
290         audio_output/mixer.c \
291         audio_output/output.c \
292         audio_output/intf.c \
293         stream_output/stream_output.c \
294         stream_output/announce.c \
295         stream_output/sap.c \
296         osd/osd.c \
297         osd/osd_parser.c \
298         osd/osd_text.c \
299         osd/osd_widgets.c \
300         network/acl.c \
301         network/getaddrinfo.c \
302         network/io.c \
303         network/error.c \
304         network/tcp.c \
305         network/udp.c \
306         network/httpd.c \
307         network/rootwrap.c \
308         network/tls.c \
309         misc/charset.c \
310         misc/md5.c \
311         misc/mtime.c \
312         misc/block.c \
313         misc/modules.c \
314         misc/threads.c \
315         misc/stats.c \
316         misc/strings.c \
317         misc/unicode.c \
318         misc/cpu.c \
319         misc/configuration.c \
320         misc/image.c \
321         misc/iso_lang.c \
322         misc/iso-639_def.h \
323         misc/messages.c \
324         misc/objects.c \
325         misc/variables.c \
326         misc/error.c \
327         misc/update.c \
328         misc/vlm.c \
329         misc/xml.c \
330         misc/hashtables.c \
331         extras/libc.c \
332         control/core.c \
333         control/playlist.c \
334         control/vlm.c \
335         control/input.c \
336         control/video.c \
337         control/audio.c \
338         control/mediacontrol_core.c \
339         control/mediacontrol_util.c \
340         control/mediacontrol_audio_video.c \
341         $(NULL)
342
343 # These should be distributed, but not compiled
344 EXTRA_DIST += control/mediacontrol_init.c control/mediacontrol_plugin.c
345
346 SOURCES_libvlc = \
347         $(SOURCES_libvlc_common) \
348         $(OPT_SOURCES_libvlc_beos) \
349         $(OPT_SOURCES_libvlc_darwin) \
350         $(OPT_SOURCES_libvlc_win32) \
351         $(OPT_SOURCES_libvlc_dirent) \
352         $(OPT_SOURCES_libvlc_getopt) \
353         $(NULL)
354
355
356 if !USE_LIBTOOL
357 if !BUILD_SHARED
358 SOURCES_libvlc += misc/version.c
359 CLEANFILES += misc/version.c
360
361 misc/version.c: FORCE
362         $(TOOLBOX) --update-version
363 FORCE:
364
365 endif
366
367 # Install shared libvlc
368 install-exec-local:
369         test -z "$(DATA_noinst_libvlc)" || $(INSTALL_PROGRAM) "$(DATA_noinst_libvlc)" "$(DESTDIR)$(libdir)"
370
371 # the opposite of install-{data,exec}-local
372 uninstall-local:
373         test -z "$(DATA_noinst_libvlc)" || rm -f "$(DESTDIR)$(libdir)/$(DATA_noinst_libvlc)"
374 endif
375
376 ###############################################################################
377 # Stamp rules
378 ###############################################################################
379 stamp-api: Makefile.in $(HEADERS_include) ../vlc-api.pl
380         ( cd $(srcdir) && cat $(HEADERS_include) ) | \
381           top_srcdir="$(top_srcdir)" perl $(top_srcdir)/vlc-api.pl
382         touch stamp-api
383
384 ###############################################################################
385 # Unit/regression test
386 ###############################################################################
387 if USE_LIBTOOL
388 check_PROGRAMS = test_i18n_atof test_url
389 TESTS = $(check_PROGRAMS)
390
391 CFLAGS_tests = `$(VLC_CONFIG) --cflags vlc`
392
393 test_i18n_atof_SOURCES = test/i18n_atof.c
394 test_i18n_atof_LDADD = libvlc.la
395 test_i18n_atof_CFLAGS = $(CFLAGS_tests)
396
397 test_url_SOURCES = test/url.c
398 test_url_LDADD = libvlc.la
399 test_url_CFLAGS = $(CFLAGS_tests)
400 endif
401