]> git.sesse.net Git - vlc/blob - src/Makefile.am
ffmpeg-cvs.patch: fix upstream
[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)
11 DISTCLEANFILES = stamp-api
12 CLEANFILES = misc/modules_builtin.h misc/version.c
13 MOSTLYCLEANFILES = $(DATA_noinst_libvlc)
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_video.h \
95         ../include/vlc_vlm.h \
96         ../include/vlc_vod.h \
97         ../include/vlc_xml.h \
98         ../include/vout_synchro.h \
99         ../include/win32_specific.h \
100         ../include/libvlc_internal.h \
101         ../include/mediacontrol_internal.h
102         $(NULL)
103
104 misc/modules_builtin.h: Makefile misc/modules_builtin.h.in ../vlc-config
105         $(TOOLBOX) --update-includes
106         touch $@
107
108 misc/modules.c: misc/modules_builtin.h
109
110 misc/version.c: FORCE
111         $(TOOLBOX) --update-version
112
113 ###############################################################################
114 # Building builtin modules
115 ###############################################################################
116 #
117 # As long as we use builtins with a shared libvlc, we must build them before
118 # we build libvlc. Maybe one day, libvlc will handle multiple modules per
119 # shared object, which will make builtins fairly redumdant. Until then, we
120 # need this workaround.
121
122 builtins:
123 if BUILD_SHARED
124         @if test "$(pic)" = "pic"; then ext="_pic.a"; else ext=".a"; fi ; \
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/g' | \
131         while read cmd; do echo $$cmd$$ext; eval "($$cmd$$ext)" || exit $$? ; done
132 endif
133
134 .PHONY: builtins
135
136 ###############################################################################
137 # Building libvlc
138 ###############################################################################
139
140 LIBRARIES_nopic = libvlc.a
141 LIBRARIES_pic = libvlc_pic.a
142 if HAVE_WIN32
143 lib_LIBRARIES = $(LIBRARIES_nopic)
144 else
145 if BUILD_SHARED
146 lib_LIBRARIES = $(LIBRARIES_pic)
147 else
148 lib_LIBRARIES = $(LIBRARIES_nopic)
149 if BUILD_PIC
150 lib_LIBRARIES += $(LIBRARIES_pic)
151 endif
152 endif
153 endif
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 if HAVE_BEOS
166 OPT_SOURCES_libvlc_beos = $(SOURCES_libvlc_beos)
167 endif
168 if HAVE_DARWIN
169 OPT_SOURCES_libvlc_darwin = $(SOURCES_libvlc_darwin)
170 endif
171 if HAVE_WIN32
172 OPT_SOURCES_libvlc_win32 = $(SOURCES_libvlc_win32)
173 endif
174 if HAVE_WINCE
175 OPT_SOURCES_libvlc_win32 = $(SOURCES_libvlc_win32)
176 endif
177 if BUILD_DIRENT
178 OPT_SOURCES_libvlc_dirent = $(SOURCES_libvlc_dirent)
179 endif
180 if BUILD_GETOPT
181 OPT_SOURCES_libvlc_getopt = $(SOURCES_libvlc_getopt)
182 endif
183
184 # Build libvlc as a shared library
185 if BUILD_SHARED
186 DATA_noinst_libvlc = libvlc$(LIBEXT)
187 if HAVE_WIN32
188 OBJECTS_libvlc_so = $(libvlc_a_OBJECTS)
189 else
190 OBJECTS_libvlc_so = $(libvlc_pic_a_OBJECTS)
191 endif
192 endif
193
194 libvlc$(LIBEXT): $(OBJECTS_libvlc_so) builtins
195         @ldfl="`$(VLC_CONFIG) --libs plugin vlc builtin $(pic)` $(INCLUDED_LIBINTL)" ; \
196         case `$(VLC_CONFIG) --linkage vlc builtin` in \
197           c++)  ld="$(CXXLINK)" ;; \
198           objc) ld="$(OBJCLINK)" ;; \
199           c|*)  ld="$(LINK)" ;; \
200         esac ; \
201         echo $$ld $(OBJECTS_libvlc_so) $$ldfl ; \
202         $$ld $(OBJECTS_libvlc_so) $$ldfl
203
204 EXTRA_DIST += \
205         $(SOURCES_libvlc_beos) \
206         $(SOURCES_libvlc_darwin) \
207         $(SOURCES_libvlc_win32) \
208         $(SOURCES_libvlc_dirent) \
209         $(SOURCES_libvlc_getopt) \
210         $(NULL)
211
212 SOURCES_libvlc_beos = \
213         misc/beos_specific.cpp \
214         $(NULL)
215
216 SOURCES_libvlc_darwin = \
217         misc/darwin_specific.m \
218         $(NULL)
219
220 SOURCES_libvlc_win32 = \
221         misc/win32_specific.c \
222         $(NULL)
223
224 SOURCES_libvlc_dirent = \
225         extras/dirent.c \
226         $(NULL)
227
228 SOURCES_libvlc_getopt = \
229         extras/getopt.c \
230         extras/getopt.h \
231         extras/getopt1.c \
232         $(NULL)
233
234 SOURCES_libvlc_common = \
235         libvlc.c \
236         libvlc.h \
237         interface/interface.c \
238         interface/intf_eject.c \
239         interface/interaction.c \
240         playlist/playlist.c \
241         playlist/sort.c \
242         playlist/loadsave.c \
243         playlist/view.c \
244         playlist/item.c \
245         playlist/item-ext.c \
246         playlist/services_discovery.c \
247         input/access.c \
248         input/clock.c \
249         input/control.c \
250         input/decoder.c \
251         input/demux.c \
252         input/es_out.c \
253         input/input.c \
254         input/input_internal.h \
255         input/stream.c \
256         input/mem_stream.c \
257         input/subtitles.c \
258         input/var.c \
259         video_output/video_output.c \
260         video_output/vout_pictures.c \
261         video_output/vout_pictures.h \
262         video_output/video_text.c \
263         video_output/video_widgets.c \
264         video_output/vout_subpictures.c \
265         video_output/vout_synchro.c \
266         video_output/vout_intf.c \
267         audio_output/common.c \
268         audio_output/dec.c \
269         audio_output/filters.c \
270         audio_output/ainput.c \
271         audio_output/mixer.c \
272         audio_output/output.c \
273         audio_output/intf.c \
274         stream_output/stream_output.c \
275         stream_output/announce.c \
276         stream_output/sap.c \
277         osd/osd.c \
278         osd/osd_parser.c \
279         osd/osd_text.c \
280         osd/osd_widgets.c \
281         network/acl.c \
282         network/getaddrinfo.c \
283         network/io.c \
284         network/tcp.c \
285         network/udp.c \
286         network/httpd.c \
287         network/rootwrap.c \
288         network/tls.c \
289         misc/charset.c \
290         misc/md5.c \
291         misc/mtime.c \
292         misc/block.c \
293         misc/modules.c \
294         misc/threads.c \
295         misc/stats.c \
296         misc/unicode.c \
297         misc/cpu.c \
298         misc/configuration.c \
299         misc/image.c \
300         misc/iso_lang.c \
301         misc/iso-639_def.h \
302         misc/messages.c \
303         misc/objects.c \
304         misc/variables.c \
305         misc/error.c \
306         misc/update.c \
307         misc/vlm.c \
308         misc/xml.c \
309         misc/hashtables.c \
310         misc/version.c \
311         extras/libc.c \
312         control/libvlc_core.c \
313         control/libvlc_playlist.c \
314         control/libvlc_vlm.c \
315         control/libvlc_input.c \
316         control/libvlc_video.c \
317         control/mediacontrol_core.c \
318         control/mediacontrol_util.c \
319         control/mediacontrol_audio_video.c \
320         $(NULL)
321
322 # These should be distributed, but not compiled
323 EXTRA_DIST += control/mediacontrol_init.c control/mediacontrol_plugin.c
324
325 SOURCES_libvlc = \
326         $(SOURCES_libvlc_common) \
327         $(OPT_SOURCES_libvlc_beos) \
328         $(OPT_SOURCES_libvlc_darwin) \
329         $(OPT_SOURCES_libvlc_win32) \
330         $(OPT_SOURCES_libvlc_dirent) \
331         $(OPT_SOURCES_libvlc_getopt) \
332         $(NULL)
333
334 # Install the symlinks and shared libvlc
335 install-exec-local:
336         test -z "$(DATA_noinst_libvlc)" || $(INSTALL_PROGRAM) "$(DATA_noinst_libvlc)" "$(DESTDIR)$(libdir)"
337
338 # the opposite of install-{data,exec}-local
339 uninstall-local:
340         test -z "$(DATA_noinst_libvlc)" || rm -f "$(DESTDIR)$(libdir)/$(DATA_noinst_libvlc)"
341
342 ###############################################################################
343 # Stamp rules
344 ###############################################################################
345 stamp-api: Makefile.in $(HEADERS_include) ../vlc-api.pl
346         ( cd $(srcdir) && cat $(HEADERS_include) ) | \
347           top_srcdir="$(top_srcdir)" perl $(top_srcdir)/vlc-api.pl
348         touch stamp-api
349
350 ###############################################################################
351 # Force rule
352 ###############################################################################
353 FORCE: