]> git.sesse.net Git - vlc/blob - src/Makefile.am
477deaf783ed831a11d4f93c5ab934fa4191b4bb
[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 # These dependencies are mandatory
114 $(SOURCES_libvlc): $(LIB_intl)
115
116 ###############################################################################
117 # Optional libintl - FIXME, bad dependencies
118 ###############################################################################
119
120 ../intl/libintl.a: FORCE
121         cd $(top_builddir)/intl && $(MAKE) $(AM_MAKEFLAGS)
122
123 if BUILD_INTL
124 LIB_intl = ../intl/libintl.a
125 endif
126
127 ###############################################################################
128 # Building libvlc
129 ###############################################################################
130
131 LIBRARIES_nopic = libvlc.a
132 LIBRARIES_pic = libvlc_pic.a
133 if HAVE_WIN32
134 lib_LIBRARIES = $(LIBRARIES_nopic)
135 else
136 if BUILD_SHARED
137 lib_LIBRARIES = $(LIBRARIES_pic)
138 else
139 lib_LIBRARIES = $(LIBRARIES_nopic)
140 if BUILD_PIC
141 lib_LIBRARIES += $(LIBRARIES_pic)
142 endif
143 endif
144 endif
145
146 libvlc_a_SOURCES = $(SOURCES_libvlc)
147 libvlc_a_CFLAGS = `$(VLC_CONFIG) --cflags vlc`
148 libvlc_a_CXXFLAGS = `$(VLC_CONFIG) --cxxflags vlc`
149 libvlc_a_OBJCFLAGS = `$(VLC_CONFIG) --objcflags vlc`
150
151 libvlc_pic_a_SOURCES = $(SOURCES_libvlc)
152 libvlc_pic_a_CFLAGS = `$(VLC_CONFIG) --cflags vlc pic`
153 libvlc_pic_a_CXXFLAGS = `$(VLC_CONFIG) --cxxflags vlc pic`
154 libvlc_pic_a_OBJCFLAGS = `$(VLC_CONFIG) --objcflags vlc pic`
155
156 if HAVE_BEOS
157 OPT_SOURCES_libvlc_beos = $(SOURCES_libvlc_beos)
158 endif
159 if HAVE_DARWIN
160 OPT_SOURCES_libvlc_darwin = $(SOURCES_libvlc_darwin)
161 endif
162 if HAVE_WIN32
163 OPT_SOURCES_libvlc_win32 = $(SOURCES_libvlc_win32)
164 endif
165 if HAVE_WINCE
166 OPT_SOURCES_libvlc_win32 = $(SOURCES_libvlc_win32)
167 endif
168 if BUILD_DIRENT
169 OPT_SOURCES_libvlc_dirent = $(SOURCES_libvlc_dirent)
170 endif
171 if BUILD_GETOPT
172 OPT_SOURCES_libvlc_getopt = $(SOURCES_libvlc_getopt)
173 endif
174
175 # Build libvlc as a shared library
176 if BUILD_SHARED
177 DATA_noinst_libvlc = libvlc$(LIBEXT)
178 if HAVE_WIN32
179 OBJECTS_libvlc_so = $(libvlc_a_OBJECTS)
180 else
181 OBJECTS_libvlc_so = $(libvlc_pic_a_OBJECTS)
182 endif
183 endif
184
185 libvlc$(LIBEXT): $(OBJECTS_libvlc_so)
186         @ldfl="`$(VLC_CONFIG) --libs plugin vlc $(pic)`" ; \
187         case `$(VLC_CONFIG) --linkage vlc` in \
188           c++)  ld="$(CXXLINK)" ;; \
189           objc) ld="$(OBJCLINK)" ;; \
190           c|*)  ld="$(LINK)" ;; \
191         esac ; \
192         echo $$ld $(OBJECTS_libvlc_so) $$ldfl ; \
193         $$ld $(OBJECTS_libvlc_so) $$ldfl
194
195 EXTRA_DIST += \
196         $(SOURCES_libvlc_beos) \
197         $(SOURCES_libvlc_darwin) \
198         $(SOURCES_libvlc_win32) \
199         $(SOURCES_libvlc_dirent) \
200         $(SOURCES_libvlc_getopt) \
201         $(NULL)
202
203 SOURCES_libvlc_beos = \
204         misc/beos_specific.cpp \
205         $(NULL)
206
207 SOURCES_libvlc_darwin = \
208         misc/darwin_specific.m \
209         $(NULL)
210
211 SOURCES_libvlc_win32 = \
212         misc/win32_specific.c \
213         $(NULL)
214
215 SOURCES_libvlc_dirent = \
216         extras/dirent.c \
217         $(NULL)
218
219 SOURCES_libvlc_getopt = \
220         extras/getopt.c \
221         extras/getopt.h \
222         extras/getopt1.c \
223         $(NULL)
224
225 SOURCES_libvlc_common = \
226         libvlc.c \
227         libvlc.h \
228         interface/interface.c \
229         interface/intf_eject.c \
230         interface/interaction.c \
231         playlist/playlist.c \
232         playlist/sort.c \
233         playlist/loadsave.c \
234         playlist/view.c \
235         playlist/item.c \
236         playlist/item-ext.c \
237         playlist/services_discovery.c \
238         input/access.c \
239         input/clock.c \
240         input/control.c \
241         input/decoder.c \
242         input/demux.c \
243         input/es_out.c \
244         input/input.c \
245         input/input_internal.h \
246         input/stream.c \
247         input/mem_stream.c \
248         input/subtitles.c \
249         input/var.c \
250         video_output/video_output.c \
251         video_output/vout_pictures.c \
252         video_output/vout_pictures.h \
253         video_output/video_text.c \
254         video_output/video_widgets.c \
255         video_output/vout_subpictures.c \
256         video_output/vout_synchro.c \
257         video_output/vout_intf.c \
258         audio_output/common.c \
259         audio_output/dec.c \
260         audio_output/filters.c \
261         audio_output/ainput.c \
262         audio_output/mixer.c \
263         audio_output/output.c \
264         audio_output/intf.c \
265         stream_output/stream_output.c \
266         stream_output/announce.c \
267         stream_output/sap.c \
268         osd/osd.c \
269         osd/osd_parser.c \
270         osd/osd_text.c \
271         osd/osd_widgets.c \
272         network/acl.c \
273         network/getaddrinfo.c \
274         network/io.c \
275         network/tcp.c \
276         network/udp.c \
277         network/httpd.c \
278         network/rootwrap.c \
279         network/tls.c \
280         misc/charset.c \
281         misc/md5.c \
282         misc/mtime.c \
283         misc/block.c \
284         misc/modules.c \
285         misc/threads.c \
286         misc/stats.c \
287         misc/unicode.c \
288         misc/cpu.c \
289         misc/configuration.c \
290         misc/image.c \
291         misc/iso_lang.c \
292         misc/iso-639_def.h \
293         misc/messages.c \
294         misc/objects.c \
295         misc/variables.c \
296         misc/error.c \
297         misc/update.c \
298         misc/vlm.c \
299         misc/xml.c \
300         misc/hashtables.c \
301         misc/version.c \
302         extras/libc.c \
303         control/core.c \
304         control/control_playlist.c \
305         control/control_vlm.c \
306         control/control_input.c \
307         control/video.c \
308         control/mediacontrol_core.c \
309         control/mediacontrol_util.c \
310         control/mediacontrol_audio_video.c \
311         $(NULL)
312
313 # These should be distributed, but not compiled
314 EXTRA_DIST += control/mediacontrol_init.c control/mediacontrol_plugin.c
315
316 SOURCES_libvlc = \
317         $(SOURCES_libvlc_common) \
318         $(OPT_SOURCES_libvlc_beos) \
319         $(OPT_SOURCES_libvlc_darwin) \
320         $(OPT_SOURCES_libvlc_win32) \
321         $(OPT_SOURCES_libvlc_dirent) \
322         $(OPT_SOURCES_libvlc_getopt) \
323         $(NULL)
324
325 # Install the symlinks and shared libvlc
326 install-exec-local:
327         test -z "$(DATA_noinst_libvlc)" || $(INSTALL_PROGRAM) "$(DATA_noinst_libvlc)" "$(DESTDIR)$(libdir)"
328
329 # the opposite of install-{data,exec}-local
330 uninstall-local:
331         test -z "$(DATA_noinst_libvlc)" || rm -f "$(DESTDIR)$(libdir)/$(DATA_noinst_libvlc)"
332
333 ###############################################################################
334 # Stamp rules
335 ###############################################################################
336 stamp-api: Makefile.in $(HEADERS_include) ../vlc-api.pl
337         ( cd $(srcdir) && cat $(HEADERS_include) ) | \
338           top_srcdir="$(top_srcdir)" perl $(top_srcdir)/vlc-api.pl
339         touch stamp-api
340
341 ###############################################################################
342 # Force rule
343 ###############################################################################
344 FORCE: