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