]> git.sesse.net Git - vlc/blob - src/Makefile.am
dist vlc_url.h
[vlc] / src / Makefile.am
1 ###############################################################################
2 # Automake targets and declarations
3 ###############################################################################
4
5 NULL =
6 SUBDIRS =
7
8 EXTRA_DIST = extras/COPYING misc/modules_builtin.h.in
9
10 BUILT_SOURCES = $(DISTCLEANFILES) $(CLEANFILES) misc/version.c
11 DISTCLEANFILES = stamp-api
12 CLEANFILES = misc/modules_builtin.h stamp-version
13 MOSTLYCLEANFILES = $(DATA_noinst_libvlc) stamp-builtins
14
15 TOOLBOX = srcdir=$(top_srcdir) builddir=$(top_builddir) $(top_srcdir)/toolbox
16
17 ###############################################################################
18 # Headers
19 ###############################################################################
20
21 pkgincludedir = $(includedir)/vlc
22
23 dist_pkginclude_HEADERS = \
24         ../include/vlc/vlc.h \
25         ../include/vlc/libvlc.h \
26         ../include/vlc/aout.h \
27         ../include/vlc/vout.h \
28         ../include/vlc/sout.h \
29         ../include/vlc/decoder.h \
30         ../include/vlc/input.h \
31         ../include/vlc/intf.h \
32         ../include/vlc/mediacontrol.h \
33         ../include/vlc/mediacontrol_structures.h \
34         $(NULL)
35
36 noinst_HEADERS = $(HEADERS_include)
37 noinst_DATA = $(DATA_noinst_libvlc)
38
39 HEADERS_include = \
40         ../include/aout_internal.h \
41         ../include/audio_output.h \
42         ../include/beos_specific.h \
43         ../include/charset.h \
44         ../include/codecs.h \
45         ../include/configuration.h \
46         ../include/darwin_specific.h \
47         ../include/intf_eject.h \
48         ../include/iso_lang.h \
49         ../include/main.h \
50         ../include/mmx.h \
51         ../include/modules.h \
52         ../include/modules_inner.h \
53         ../include/mtime.h \
54         ../include/network.h \
55         ../include/os_specific.h \
56         ../include/snapshot.h \
57         ../include/stream_output.h \
58         ../include/variables.h \
59         ../include/video_output.h \
60         ../include/vlc_access.h \
61         ../include/vlc_acl.h \
62         ../include/vlc_bits.h \
63         ../include/vlc_block.h \
64         ../include/vlc_block_helper.h \
65         ../include/vlc_codec.h \
66         ../include/vlc_common.h \
67         ../include/vlc_config.h \
68         ../include/vlc_cpu.h \
69         ../include/vlc_demux.h \
70         ../include/vlc_error.h \
71         ../include/vlc_es.h \
72         ../include/vlc_es_out.h \
73         ../include/vlc_filter.h \
74         ../include/vlc_config_cat.h \
75         ../include/vlc_httpd.h \
76         ../include/vlc_tls.h \
77         ../include/vlc_md5.h \
78         ../include/vlc_image.h \
79         ../include/vlc_input.h \
80         ../include/vlc_interaction.h \
81         ../include/vlc_interface.h \
82         ../include/vlc_keys.h \
83         ../include/vlc_messages.h \
84         ../include/vlc_meta.h \
85         ../include/vlc_objects.h \
86         ../include/vlc_osd.h \
87         ../include/vlc_playlist.h \
88         ../include/vlc_spu.h \
89         ../include/vlc_stream.h \
90         ../include/vlc_symbols.h \
91         ../include/vlc_threads_funcs.h \
92         ../include/vlc_threads.h \
93         ../include/vlc_update.h \
94         ../include/vlc_url.h \
95         ../include/vlc_video.h \
96         ../include/vlc_vlm.h \
97         ../include/vlc_vod.h \
98         ../include/vlc_xml.h \
99         ../include/vout_synchro.h \
100         ../include/win32_specific.h \
101         ../include/libvlc_internal.h \
102         ../include/mediacontrol_internal.h
103         $(NULL)
104
105 misc/modules_builtin.h: Makefile misc/modules_builtin.h.in ../vlc-config
106         $(TOOLBOX) --update-includes
107         touch $@
108
109 misc/modules.c: misc/modules_builtin.h
110
111 misc/version.c:
112         $(TOOLBOX) --update-version
113
114 stamp-version: misc/version.c
115         $(TOOLBOX) --update-version
116         touch $@
117
118 .PHONY: stamp-version
119
120 ###############################################################################
121 # Building builtin modules
122 ###############################################################################
123 #
124 # As long as we use builtins with a shared libvlc, we must build them before
125 # we build libvlc. Maybe one day, libvlc will handle multiple modules per
126 # shared object, which will make builtins fairly redumdant. Until then, we
127 # need this workaround.
128
129 stamp-builtins: Makefile ../vlc-config ../config.status
130 if USE_LIBTOOL
131         @for c in `$(VLC_CONFIG) --libs builtin`; do \
132                 case $$c in \
133                         ../modules/*.a) echo $$c ;; \
134                 esac ; \
135         done | \
136         sed -e 's/^\(.*\)\/\([^\/]*\)\.a$$/cd \1 \&\& $(MAKE) \2_builtin.la/g' | \
137         while read cmd; do echo $$cmd; eval "($$cmd)" || exit $$? ; done
138 endif
139 if BUILD_SHARED
140         @if test "$(pic)" = "pic"; then ext="_pic.a"; else ext=".a"; fi ; \
141         for c in `$(VLC_CONFIG) --libs builtin`; do \
142                 case $$c in \
143                         ../modules/*.a) echo $$c ;; \
144                 esac ; \
145         done | \
146         sed -e 's/^\(.*\)\/\([^\/]*\)\.a$$/cd \1 \&\& $(MAKE) \2/g' | \
147         while read cmd; do echo $$cmd$$ext; eval "($$cmd$$ext)" || exit $$? ; done
148 endif
149         touch $@
150
151 ###############################################################################
152 # Building libvlc
153 ###############################################################################
154
155 libvlc_a_SOURCES = $(SOURCES_libvlc)
156 libvlc_a_CFLAGS = `$(VLC_CONFIG) --cflags vlc`
157 libvlc_a_CXXFLAGS = `$(VLC_CONFIG) --cxxflags vlc`
158 libvlc_a_OBJCFLAGS = `$(VLC_CONFIG) --objcflags vlc`
159
160 libvlc_pic_a_SOURCES = $(SOURCES_libvlc)
161 libvlc_pic_a_CFLAGS = `$(VLC_CONFIG) --cflags vlc pic`
162 libvlc_pic_a_CXXFLAGS = `$(VLC_CONFIG) --cxxflags vlc pic`
163 libvlc_pic_a_OBJCFLAGS = `$(VLC_CONFIG) --objcflags vlc pic`
164
165 libvlc_la_SOURCES = $(SOURCES_libvlc)
166 libvlc_la_CFLAGS = `$(VLC_CONFIG) --cflags vlc`
167 libvlc_la_CXXFLAGS = `$(VLC_CONFIG) --cxxflags vlc`
168 libvlc_la_OBJCFLAGS = `$(VLC_CONFIG) --objcflags vlc`
169 libvlc_la_LDFLAGS = `$(VLC_CONFIG) --libs vlc builtin|sed -e 's/\(modules\/[^ ]*\)\.a /\1_builtin.la /g'` \
170                 -avoid-version -no-undefined
171 libvlc_la_DEPENDENCIES = stamp-builtins
172
173
174 if HAVE_BEOS
175 OPT_SOURCES_libvlc_beos = $(SOURCES_libvlc_beos)
176 endif
177 if HAVE_DARWIN
178 OPT_SOURCES_libvlc_darwin = $(SOURCES_libvlc_darwin)
179 endif
180 if HAVE_WIN32
181 OPT_SOURCES_libvlc_win32 = $(SOURCES_libvlc_win32)
182 endif
183 if HAVE_WINCE
184 OPT_SOURCES_libvlc_win32 = $(SOURCES_libvlc_win32)
185 endif
186 if BUILD_DIRENT
187 OPT_SOURCES_libvlc_dirent = $(SOURCES_libvlc_dirent)
188 endif
189 if BUILD_GETOPT
190 OPT_SOURCES_libvlc_getopt = $(SOURCES_libvlc_getopt)
191 endif
192
193 # Build libvlc as a shared library
194 if USE_LIBTOOL
195 lib_LTLIBRARIES = libvlc.la
196 else
197 lib_LIBRARIES = libvlc.a
198 if BUILD_PIC
199 lib_LIBRARIES += libvlc_pic.a
200 endif
201 endif
202
203 if HAVE_WIN32
204 if BUILD_SHARED
205 DATA_noinst_libvlc = libvlc$(LIBEXT)
206 endif
207
208 libvlc$(LIBEXT): $(OBJECTS_libvlc_so) stamp-builtins
209         @ldfl="`$(VLC_CONFIG) --libs plugin vlc builtin $(pic)` $(INCLUDED_LIBINTL)" ; \
210         case `$(VLC_CONFIG) --linkage vlc builtin` in \
211           c++)  ld="$(CXXLINK)" ;; \
212           objc) ld="$(OBJCLINK)" ;; \
213           c|*)  ld="$(LINK)" ;; \
214         esac ; \
215         echo $$ld $(OBJECTS_libvlc_so) $(LDFLAGS_libvlc_so) $$ldfl; \
216         $$ld $(libvlc_a_OBJECTS) \
217                 -Wl,--out-implib,$(top_builddir)/src/libvlc.dll.a $$ldfl
218 # It sucks big time, but we have to do that to link vlc properly
219 # on non-PIC OSes, otherwise ld will favor builtins-less libvlc.a over
220 # libvlc$(LIBEXT)
221         rm -f libvlc.a
222 # Cygwin work-around
223         @if test -f "$@.exe"; then mv -f "$@.exe" "$@"; fi
224 endif
225
226 EXTRA_DIST += \
227         $(SOURCES_libvlc_beos) \
228         $(SOURCES_libvlc_darwin) \
229         $(SOURCES_libvlc_win32) \
230         $(SOURCES_libvlc_dirent) \
231         $(SOURCES_libvlc_getopt) \
232         $(NULL)
233
234 SOURCES_libvlc_beos = \
235         misc/beos_specific.cpp \
236         $(NULL)
237
238 SOURCES_libvlc_darwin = \
239         misc/darwin_specific.m \
240         $(NULL)
241
242 SOURCES_libvlc_win32 = \
243         misc/win32_specific.c \
244         $(NULL)
245
246 SOURCES_libvlc_dirent = \
247         extras/dirent.c \
248         $(NULL)
249
250 SOURCES_libvlc_getopt = \
251         extras/getopt.c \
252         extras/getopt.h \
253         extras/getopt1.c \
254         $(NULL)
255
256 SOURCES_libvlc_common = \
257         libvlc.c \
258         libvlc.h \
259         interface/interface.c \
260         interface/intf_eject.c \
261         interface/interaction.c \
262         playlist/playlist.c \
263         playlist/sort.c \
264         playlist/loadsave.c \
265         playlist/view.c \
266         playlist/item.c \
267         playlist/item-ext.c \
268         playlist/services_discovery.c \
269         input/access.c \
270         input/clock.c \
271         input/control.c \
272         input/decoder.c \
273         input/demux.c \
274         input/es_out.c \
275         input/input.c \
276         input/input_internal.h \
277         input/stream.c \
278         input/mem_stream.c \
279         input/subtitles.c \
280         input/var.c \
281         video_output/video_output.c \
282         video_output/vout_pictures.c \
283         video_output/vout_pictures.h \
284         video_output/video_text.c \
285         video_output/video_widgets.c \
286         video_output/vout_subpictures.c \
287         video_output/vout_synchro.c \
288         video_output/vout_intf.c \
289         audio_output/common.c \
290         audio_output/dec.c \
291         audio_output/filters.c \
292         audio_output/ainput.c \
293         audio_output/mixer.c \
294         audio_output/output.c \
295         audio_output/intf.c \
296         stream_output/stream_output.c \
297         stream_output/announce.c \
298         stream_output/sap.c \
299         osd/osd.c \
300         osd/osd_parser.c \
301         osd/osd_text.c \
302         osd/osd_widgets.c \
303         network/acl.c \
304         network/getaddrinfo.c \
305         network/io.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/unicode.c \
319         misc/cpu.c \
320         misc/configuration.c \
321         misc/image.c \
322         misc/iso_lang.c \
323         misc/iso-639_def.h \
324         misc/messages.c \
325         misc/objects.c \
326         misc/variables.c \
327         misc/error.c \
328         misc/update.c \
329         misc/vlm.c \
330         misc/xml.c \
331         misc/hashtables.c \
332         misc/version.c \
333         extras/libc.c \
334         control/libvlc_core.c \
335         control/libvlc_playlist.c \
336         control/libvlc_vlm.c \
337         control/libvlc_input.c \
338         control/libvlc_video.c \
339         control/libvlc_audio.c \
340         control/mediacontrol_core.c \
341         control/mediacontrol_util.c \
342         control/mediacontrol_audio_video.c \
343         $(NULL)
344
345 # These should be distributed, but not compiled
346 EXTRA_DIST += control/mediacontrol_init.c control/mediacontrol_plugin.c
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 # Install shared libvlc
359 install-exec-local:
360         test -z "$(DATA_noinst_libvlc)" || $(INSTALL_PROGRAM) "$(DATA_noinst_libvlc)" "$(DESTDIR)$(libdir)"
361
362 # the opposite of install-{data,exec}-local
363 uninstall-local:
364         test -z "$(DATA_noinst_libvlc)" || rm -f "$(DESTDIR)$(libdir)/$(DATA_noinst_libvlc)"
365 endif
366
367 ###############################################################################
368 # Stamp rules
369 ###############################################################################
370 stamp-api: Makefile.in $(HEADERS_include) ../vlc-api.pl
371         ( cd $(srcdir) && cat $(HEADERS_include) ) | \
372           top_srcdir="$(top_srcdir)" perl $(top_srcdir)/vlc-api.pl
373         touch stamp-api
374