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