typo
[vlc.git] / 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 libvlc.sym
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/vlc_streaming.h \
61         ../include/variables.h \
62         ../include/video_output.h \
63         ../include/vlc_access.h \
64         ../include/vlc_arrays.h \
65         ../include/vlc_acl.h \
66         ../include/vlc_bits.h \
67         ../include/vlc_block.h \
68         ../include/vlc_block_helper.h \
69         ../include/vlc_codec.h \
70         ../include/vlc_common.h \
71         ../include/vlc_config.h \
72         ../include/vlc_cpu.h \
73         ../include/vlc_demux.h \
74         ../include/vlc_error.h \
75         ../include/vlc_es.h \
76         ../include/vlc_es_out.h \
77         ../include/vlc_filter.h \
78         ../include/vlc_config_cat.h \
79         ../include/vlc_httpd.h \
80         ../include/vlc_tls.h \
81         ../include/vlc_md5.h \
82         ../include/vlc_devices.h \
83         ../include/vlc_image.h \
84         ../include/vlc_input.h \
85         ../include/vlc_interaction.h \
86         ../include/vlc_interface.h \
87         ../include/vlc_intf_strings.h \
88         ../include/vlc_keys.h \
89         ../include/vlc_messages.h \
90         ../include/vlc_meta.h \
91         ../include/vlc_objects.h \
92         ../include/vlc_osd.h \
93         ../include/vlc_playlist.h \
94         ../include/vlc_spu.h \
95         ../include/vlc_stream.h \
96         ../include/vlc_strings.h \
97         ../include/vlc_symbols.h \
98         ../include/vlc_threads_funcs.h \
99         ../include/vlc_threads.h \
100         ../include/vlc_update.h \
101         ../include/vlc_url.h \
102         ../include/vlc_video.h \
103         ../include/vlc_vlm.h \
104         ../include/vlc_vod.h \
105         ../include/vlc_xml.h \
106         ../include/vout_synchro.h \
107         ../include/win32_specific.h \
108         ../include/libvlc_internal.h \
109         ../include/mediacontrol_internal.h
110         $(NULL)
111
112 misc/modules_builtin.h: Makefile misc/modules_builtin.h.in ../vlc-config
113         $(TOOLBOX) --update-includes
114         touch $@
115
116 misc/modules.c: misc/modules_builtin.h
117
118 ###############################################################################
119 # Building builtin modules
120 ###############################################################################
121 #
122 # As long as we use builtins with a shared libvlc, we must build them before
123 # we build libvlc. Maybe one day, libvlc will handle multiple modules per
124 # shared object, which will make builtins fairly redumdant. Until then, we
125 # need this workaround.
126
127 stamp-builtins: Makefile ../vlc-config ../config.status
128 if BUILD_SHARED
129         @for c in `$(VLC_CONFIG) --libs builtin`; do \
130                 case $$c in \
131                         ../modules/*.a) echo $$c ;; \
132                 esac ; \
133         done | \
134         sed -e 's,^\(.*\)/\([^/]*\)\.a$$,cd \1 \&\& $(MAKE) \2,g' | \
135         while read cmd; do echo $$cmd.a; eval "($$cmd.a)" || exit $$? ; done
136 endif
137         touch $@
138
139 ###############################################################################
140 # Building libvlc
141 ###############################################################################
142
143 libvlc_a_SOURCES = $(SOURCES_libvlc)
144 nodist_libvlc_a_SOURCES = $(SOURCES_libvlc)
145 libvlc_a_CFLAGS = `$(VLC_CONFIG) --cflags vlc pic` -DUSE_BUILTINS
146 libvlc_a_CXXFLAGS = `$(VLC_CONFIG) --cxxflags vlc pic`
147 libvlc_a_OBJCFLAGS = `$(VLC_CONFIG) --objcflags vlc pic`
148
149 libvlc_la_SOURCES = $(SOURCES_libvlc)
150 nodist_libvlc_la_SOURCES = $(SOURCES_libvlc)
151 libvlc_la_LIBADD = $(INCLUDED_LIBINTL)
152 libvlc_la_CFLAGS = `$(VLC_CONFIG) --cflags vlc`
153 libvlc_la_CXXFLAGS = `$(VLC_CONFIG) --cxxflags vlc`
154 libvlc_la_OBJCFLAGS = `$(VLC_CONFIG) --objcflags vlc`
155 libvlc_la_LDFLAGS = `$(VLC_CONFIG) --libs vlc` \
156         -no-undefined -export-symbols libvlc.sym -version-info 0:0:0
157 libvlc_la_DEPENDENCIES = stamp-builtins stamp-api
158
159
160 if HAVE_BEOS
161 OPT_SOURCES_libvlc_beos = $(SOURCES_libvlc_beos)
162 endif
163 if HAVE_DARWIN
164 OPT_SOURCES_libvlc_darwin = $(SOURCES_libvlc_darwin)
165 endif
166 if HAVE_WIN32
167 OPT_SOURCES_libvlc_win32 = $(SOURCES_libvlc_win32)
168 endif
169 if HAVE_WINCE
170 OPT_SOURCES_libvlc_win32 = $(SOURCES_libvlc_win32)
171 endif
172 if BUILD_DIRENT
173 OPT_SOURCES_libvlc_dirent = $(SOURCES_libvlc_dirent)
174 endif
175 if BUILD_GETOPT
176 OPT_SOURCES_libvlc_getopt = $(SOURCES_libvlc_getopt)
177 endif
178
179 # Build libvlc as a shared library
180 if USE_LIBTOOL
181 lib_LTLIBRARIES = libvlc.la
182 else
183 lib_LIBRARIES = libvlc.a
184 endif
185
186 if HAVE_WIN32
187 pic =
188 else
189 pic = pic
190 endif
191
192 if HAVE_WIN32
193 if BUILD_SHARED
194 DATA_noinst_libvlc = libvlc$(LIBEXT) libvlc$(LIBEXT).a
195 endif
196
197 libvlc.dll.a: libvlc$(LIBEXT)
198         $(DLLTOOL) --export-all-symbols -l $@ -D $< $(libvlc_a_OBJECTS)
199
200 libvlc$(LIBEXT): $(OBJECTS_libvlc_so) stamp-builtins
201         @ldfl="`$(VLC_CONFIG) --libs plugin vlc builtin pic` $(INCLUDED_LIBINTL)" ; \
202         case `$(VLC_CONFIG) --linkage vlc builtin` in \
203           c++)  ld="$(CXXLINK)" ;; \
204           objc) ld="$(OBJCLINK)" ;; \
205           c|*)  ld="$(LINK)" ;; \
206         esac ; \
207         echo $$ld $(OBJECTS_libvlc_so) $(LDFLAGS_libvlc_so) $$ldfl; \
208         $$ld $(libvlc_a_OBJECTS) \
209                 $$ldfl
210 # It sucks big time, but we have to do that to link vlc properly
211 # on non-PIC OSes, otherwise ld will favor builtins-less libvlc.a over
212 # libvlc$(LIBEXT)
213         rm -f libvlc.a
214 # Cygwin libtool work-around
215         @if test -f "$@.exe"; then mv -f "$@.exe" "$@"; fi
216 endif
217
218 EXTRA_DIST += \
219         $(SOURCES_libvlc_beos) \
220         $(SOURCES_libvlc_darwin) \
221         $(SOURCES_libvlc_win32) \
222         $(SOURCES_libvlc_dirent) \
223         $(SOURCES_libvlc_getopt) \
224         $(NULL)
225
226 SOURCES_libvlc_beos = \
227         misc/beos_specific.cpp \
228         $(NULL)
229
230 SOURCES_libvlc_darwin = \
231         misc/darwin_specific.m \
232         $(NULL)
233
234 SOURCES_libvlc_win32 = \
235         misc/win32_specific.c \
236         $(NULL)
237
238 SOURCES_libvlc_dirent = \
239         extras/dirent.c \
240         $(NULL)
241
242 SOURCES_libvlc_getopt = \
243         extras/getopt.c \
244         extras/getopt.h \
245         extras/getopt1.c \
246         $(NULL)
247
248 SOURCES_libvlc_common = \
249         libvlc.c \
250         libvlc-common.c \
251         libvlc.h \
252         interface/interface.c \
253         interface/intf_eject.c \
254         interface/interaction.c \
255         playlist/playlist_internal.h \
256         playlist/thread.c \
257         playlist/control.c \
258         playlist/engine.c \
259         playlist/sort.c \
260         playlist/loadsave.c \
261         playlist/tree.c \
262         playlist/item.c \
263         playlist/search.c \
264         playlist/services_discovery.c \
265         input/item.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/meta.c \
274         input/input_internal.h \
275         input/stream.c \
276         input/mem_stream.c \
277         input/subtitles.c \
278         input/var.c \
279         video_output/video_output.c \
280         video_output/vout_pictures.c \
281         video_output/vout_pictures.h \
282         video_output/video_text.c \
283         video_output/video_widgets.c \
284         video_output/vout_subpictures.c \
285         video_output/vout_synchro.c \
286         video_output/vout_intf.c \
287         audio_output/common.c \
288         audio_output/dec.c \
289         audio_output/filters.c \
290         audio_output/input.c \
291         audio_output/mixer.c \
292         audio_output/output.c \
293         audio_output/intf.c \
294         stream_output/stream_output.c \
295         stream_output/announce.c \
296         stream_output/profiles.c \
297         stream_output/sap.c \
298         osd/osd.c \
299         osd/osd_parser.c \
300         osd/osd_text.c \
301         osd/osd_widgets.c \
302         network/acl.c \
303         network/getaddrinfo.c \
304         network/io.c \
305         network/error.c \
306         network/tcp.c \
307         network/udp.c \
308         network/httpd.c \
309         network/rootwrap.c \
310         network/tls.c \
311         misc/charset.c \
312         misc/md5.c \
313         misc/mtime.c \
314         misc/block.c \
315         misc/modules.c \
316         misc/threads.c \
317         misc/stats.c \
318         misc/strings.c \
319         misc/unicode.c \
320         misc/cpu.c \
321         misc/configuration.c \
322         misc/configuration_chain.c \
323         misc/image.c \
324         misc/iso_lang.c \
325         misc/iso-639_def.h \
326         misc/messages.c \
327         misc/objects.c \
328         misc/variables.c \
329         misc/error.c \
330         misc/update.c \
331         misc/vlm.c \
332         misc/xml.c \
333         misc/dict.c \
334         misc/devices.c \
335         extras/libc.c \
336         control/core.c \
337         control/log.c \
338         control/playlist.c \
339         control/vlm.c \
340         control/input.c \
341         control/video.c \
342         control/audio.c \
343         control/mediacontrol_core.c \
344         control/mediacontrol_util.c \
345         control/mediacontrol_audio_video.c \
346         $(NULL)
347
348 SOURCES_libvlc = \
349         $(SOURCES_libvlc_common) \
350         $(OPT_SOURCES_libvlc_beos) \
351         $(OPT_SOURCES_libvlc_darwin) \
352         $(OPT_SOURCES_libvlc_win32) \
353         $(OPT_SOURCES_libvlc_dirent) \
354         $(OPT_SOURCES_libvlc_getopt) \
355         $(NULL)
356
357 if !USE_LIBTOOL
358 if !BUILD_SHARED
359 SOURCES_nodist_libvlc = misc/version.c
360 CLEANFILES += misc/version.c
361
362 misc/version.c: FORCE
363         $(TOOLBOX) --update-version
364 endif
365
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 libvlc.sym:
384         rm -f stamp-api
385         $(MAKE) stamp-api
386
387 ###############################################################################
388 # Unit/regression test
389 ###############################################################################
390 if USE_LIBTOOL
391 check_PROGRAMS = test_i18n_atof test_url
392 TESTS = $(check_PROGRAMS)
393
394 CFLAGS_tests = `$(VLC_CONFIG) --cflags vlc`
395
396 test_i18n_atof_SOURCES = test/i18n_atof.c
397 test_i18n_atof_LDADD = libvlc.la
398 test_i18n_atof_CFLAGS = $(CFLAGS_tests)
399
400 test_url_SOURCES = test/url.c
401 test_url_LDADD = libvlc.la
402 test_url_CFLAGS = $(CFLAGS_tests)
403 endif
404
405 FORCE: