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