]> git.sesse.net Git - vlc/blob - src/Makefile.am
src/playlist/loadsave.c, modules/demux/playlist/*, modules/gui/*,
[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 stamp-version misc/version.c
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 misc/version.c:
115         $(TOOLBOX) --update-version
116
117 stamp-version: misc/version.c
118         $(TOOLBOX) --update-version
119         touch $@
120
121 .PHONY: stamp-version
122
123 ###############################################################################
124 # Building builtin modules
125 ###############################################################################
126 #
127 # As long as we use builtins with a shared libvlc, we must build them before
128 # we build libvlc. Maybe one day, libvlc will handle multiple modules per
129 # shared object, which will make builtins fairly redumdant. Until then, we
130 # need this workaround.
131
132 stamp-builtins: Makefile ../vlc-config ../config.status
133 if USE_LIBTOOL
134         @for c in `$(VLC_CONFIG) --libs builtin`; do \
135                 case $$c in \
136                         ../modules/*.a) echo $$c ;; \
137                 esac ; \
138         done | \
139         sed -e 's/^\(.*\)\/\([^\/]*\)\.a$$/cd \1 \&\& $(MAKE) \2_builtin.la/g' | \
140         while read cmd; do echo $$cmd; eval "($$cmd)" || exit $$? ; done
141 endif
142 if BUILD_SHARED
143         @if test "$(pic)" = "pic"; then ext="_pic.a"; else ext=".a"; fi ; \
144         for c in `$(VLC_CONFIG) --libs builtin`; do \
145                 case $$c in \
146                         ../modules/*.a) echo $$c ;; \
147                 esac ; \
148         done | \
149         sed -e 's/^\(.*\)\/\([^\/]*\)\.a$$/cd \1 \&\& $(MAKE) \2/g' | \
150         while read cmd; do echo $$cmd$$ext; eval "($$cmd$$ext)" || exit $$? ; done
151 endif
152         touch $@
153
154 ###############################################################################
155 # Building libvlc
156 ###############################################################################
157
158 libvlc_a_SOURCES = $(SOURCES_libvlc)
159 libvlc_a_CFLAGS = `$(VLC_CONFIG) --cflags vlc`
160 libvlc_a_CXXFLAGS = `$(VLC_CONFIG) --cxxflags vlc`
161 libvlc_a_OBJCFLAGS = `$(VLC_CONFIG) --objcflags vlc`
162
163 libvlc_pic_a_SOURCES = $(SOURCES_libvlc)
164 libvlc_pic_a_CFLAGS = `$(VLC_CONFIG) --cflags vlc pic`
165 libvlc_pic_a_CXXFLAGS = `$(VLC_CONFIG) --cxxflags vlc pic`
166 libvlc_pic_a_OBJCFLAGS = `$(VLC_CONFIG) --objcflags vlc pic`
167
168 libvlc_la_SOURCES = $(SOURCES_libvlc)
169 libvlc_la_LIBADD = $(INCLUDED_LIBINTL)
170 libvlc_la_CFLAGS = `$(VLC_CONFIG) --cflags vlc`
171 libvlc_la_CXXFLAGS = `$(VLC_CONFIG) --cxxflags vlc`
172 libvlc_la_OBJCFLAGS = `$(VLC_CONFIG) --objcflags vlc`
173 libvlc_la_LDFLAGS = `$(VLC_CONFIG) --libs vlc builtin|sed -e 's/\(modules\/[^ ]*\)\.a /\1_builtin.la /g'` \
174                 -avoid-version -no-undefined
175 libvlc_la_DEPENDENCIES = stamp-builtins
176
177
178 if HAVE_BEOS
179 OPT_SOURCES_libvlc_beos = $(SOURCES_libvlc_beos)
180 endif
181 if HAVE_DARWIN
182 OPT_SOURCES_libvlc_darwin = $(SOURCES_libvlc_darwin)
183 endif
184 if HAVE_WIN32
185 OPT_SOURCES_libvlc_win32 = $(SOURCES_libvlc_win32)
186 endif
187 if HAVE_WINCE
188 OPT_SOURCES_libvlc_win32 = $(SOURCES_libvlc_win32)
189 endif
190 if BUILD_DIRENT
191 OPT_SOURCES_libvlc_dirent = $(SOURCES_libvlc_dirent)
192 endif
193 if BUILD_GETOPT
194 OPT_SOURCES_libvlc_getopt = $(SOURCES_libvlc_getopt)
195 endif
196
197 # Build libvlc as a shared library
198 if USE_LIBTOOL
199 lib_LTLIBRARIES = libvlc.la
200 else
201 lib_LIBRARIES = libvlc.a
202 if BUILD_PIC
203 lib_LIBRARIES += libvlc_pic.a
204 endif
205 endif
206
207 if HAVE_WIN32
208 if BUILD_SHARED
209 DATA_noinst_libvlc = libvlc$(LIBEXT)
210 endif
211
212 libvlc.dll.a: libvlc$(LIBEXT)
213
214 libvlc$(LIBEXT): $(OBJECTS_libvlc_so) stamp-builtins
215         @ldfl="`$(VLC_CONFIG) --libs plugin vlc builtin $(pic)` $(INCLUDED_LIBINTL)" ; \
216         case `$(VLC_CONFIG) --linkage vlc builtin` in \
217           c++)  ld="$(CXXLINK)" ;; \
218           objc) ld="$(OBJCLINK)" ;; \
219           c|*)  ld="$(LINK)" ;; \
220         esac ; \
221         echo $$ld $(OBJECTS_libvlc_so) $(LDFLAGS_libvlc_so) $$ldfl; \
222         $$ld $(libvlc_a_OBJECTS) \
223                 -Wl,--out-implib,$(top_builddir)/src/libvlc.dll.a $$ldfl
224 # It sucks big time, but we have to do that to link vlc properly
225 # on non-PIC OSes, otherwise ld will favor builtins-less libvlc.a over
226 # libvlc$(LIBEXT)
227         rm -f libvlc.a
228 # Cygwin work-around
229         @if test -f "$@.exe"; then mv -f "$@.exe" "$@"; fi
230 endif
231
232 EXTRA_DIST += \
233         $(SOURCES_libvlc_beos) \
234         $(SOURCES_libvlc_darwin) \
235         $(SOURCES_libvlc_win32) \
236         $(SOURCES_libvlc_dirent) \
237         $(SOURCES_libvlc_getopt) \
238         $(NULL)
239
240 SOURCES_libvlc_beos = \
241         misc/beos_specific.cpp \
242         $(NULL)
243
244 SOURCES_libvlc_darwin = \
245         misc/darwin_specific.m \
246         $(NULL)
247
248 SOURCES_libvlc_win32 = \
249         misc/win32_specific.c \
250         $(NULL)
251
252 SOURCES_libvlc_dirent = \
253         extras/dirent.c \
254         $(NULL)
255
256 SOURCES_libvlc_getopt = \
257         extras/getopt.c \
258         extras/getopt.h \
259         extras/getopt1.c \
260         $(NULL)
261
262 SOURCES_libvlc_common = \
263         libvlc.c \
264         libvlc.h \
265         interface/interface.c \
266         interface/intf_eject.c \
267         interface/interaction.c \
268         playlist/playlist.c \
269         playlist/sort.c \
270         playlist/loadsave.c \
271         playlist/view.c \
272         playlist/item.c \
273         playlist/item-ext.c \
274         playlist/services_discovery.c \
275         input/access.c \
276         input/clock.c \
277         input/control.c \
278         input/decoder.c \
279         input/demux.c \
280         input/es_out.c \
281         input/input.c \
282         input/input_internal.h \
283         input/stream.c \
284         input/mem_stream.c \
285         input/subtitles.c \
286         input/var.c \
287         video_output/video_output.c \
288         video_output/vout_pictures.c \
289         video_output/vout_pictures.h \
290         video_output/video_text.c \
291         video_output/video_widgets.c \
292         video_output/vout_subpictures.c \
293         video_output/vout_synchro.c \
294         video_output/vout_intf.c \
295         audio_output/common.c \
296         audio_output/dec.c \
297         audio_output/filters.c \
298         audio_output/input.c \
299         audio_output/mixer.c \
300         audio_output/output.c \
301         audio_output/intf.c \
302         stream_output/stream_output.c \
303         stream_output/announce.c \
304         stream_output/sap.c \
305         osd/osd.c \
306         osd/osd_parser.c \
307         osd/osd_text.c \
308         osd/osd_widgets.c \
309         network/acl.c \
310         network/getaddrinfo.c \
311         network/io.c \
312         network/error.c \
313         network/tcp.c \
314         network/udp.c \
315         network/httpd.c \
316         network/rootwrap.c \
317         network/tls.c \
318         misc/charset.c \
319         misc/md5.c \
320         misc/mtime.c \
321         misc/block.c \
322         misc/modules.c \
323         misc/threads.c \
324         misc/stats.c \
325         misc/strings.c \
326         misc/unicode.c \
327         misc/cpu.c \
328         misc/configuration.c \
329         misc/image.c \
330         misc/iso_lang.c \
331         misc/iso-639_def.h \
332         misc/messages.c \
333         misc/objects.c \
334         misc/variables.c \
335         misc/error.c \
336         misc/update.c \
337         misc/vlm.c \
338         misc/xml.c \
339         misc/hashtables.c \
340         misc/version.c \
341         extras/libc.c \
342         control/core.c \
343         control/playlist.c \
344         control/vlm.c \
345         control/input.c \
346         control/video.c \
347         control/audio.c \
348         control/mediacontrol_core.c \
349         control/mediacontrol_util.c \
350         control/mediacontrol_audio_video.c \
351         $(NULL)
352
353 # These should be distributed, but not compiled
354 EXTRA_DIST += control/mediacontrol_init.c control/mediacontrol_plugin.c
355
356 SOURCES_libvlc = \
357         $(SOURCES_libvlc_common) \
358         $(OPT_SOURCES_libvlc_beos) \
359         $(OPT_SOURCES_libvlc_darwin) \
360         $(OPT_SOURCES_libvlc_win32) \
361         $(OPT_SOURCES_libvlc_dirent) \
362         $(OPT_SOURCES_libvlc_getopt) \
363         $(NULL)
364
365 if !USE_LIBTOOL
366 # Install shared libvlc
367 install-exec-local:
368         test -z "$(DATA_noinst_libvlc)" || $(INSTALL_PROGRAM) "$(DATA_noinst_libvlc)" "$(DESTDIR)$(libdir)"
369
370 # the opposite of install-{data,exec}-local
371 uninstall-local:
372         test -z "$(DATA_noinst_libvlc)" || rm -f "$(DESTDIR)$(libdir)/$(DATA_noinst_libvlc)"
373 endif
374
375 ###############################################################################
376 # Stamp rules
377 ###############################################################################
378 stamp-api: Makefile.in $(HEADERS_include) ../vlc-api.pl
379         ( cd $(srcdir) && cat $(HEADERS_include) ) | \
380           top_srcdir="$(top_srcdir)" perl $(top_srcdir)/vlc-api.pl
381         touch stamp-api
382
383 ###############################################################################
384 # Unit/regression test
385 ###############################################################################
386 if USE_LIBTOOL
387 check_PROGRAMS = test_i18n_atof
388 TESTS = $(check_PROGRAMS)
389
390 CFLAGS_tests = `$(VLC_CONFIG) --cflags vlc`
391
392 test_i18n_atof_SOURCES = test/i18n_atof.c
393 test_i18n_atof_LDADD = libvlc.la
394 test_i18n_atof_CFLAGS = $(CFLAGS_tests)
395 endif
396