]> git.sesse.net Git - vlc/blob - src/Makefile.am
Yet another version.c fix.
[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 libvlc.sym
11
12 BUILT_SOURCES = $(CLEANFILES)
13 CLEANFILES = misc/modules_builtin.h
14 MOSTLYCLEANFILES = $(DATA_noinst_libvlc)
15
16 TOOLBOX = srcdir=$(top_srcdir) builddir=$(top_builddir) $(top_srcdir)/toolbox
17
18 ###############################################################################
19 # Headers
20 ###############################################################################
21
22 pkgincludedir = $(includedir)/vlc
23
24 dist_pkginclude_HEADERS = \
25         ../include/vlc/vlc.h \
26         ../include/vlc/libvlc.h \
27         ../include/vlc/mediacontrol.h \
28         ../include/vlc/mediacontrol_structures.h \
29         $(NULL)
30
31 noinst_HEADERS = $(HEADERS_include)
32 noinst_DATA = $(DATA_noinst_libvlc)
33
34 HEADERS_include = \
35         ../include/iso_lang.h \
36         ../include/main.h \
37         ../include/mmx.h \
38         ../include/vlc_modules.h \
39         ../include/vlc_modules_macros.h \
40         ../include/vlc_os_specific.h \
41         ../include/vlc_mtime.h \
42         ../include/vlc_network.h \
43         ../include/vlc_codecs.h \
44         ../include/vlc_configuration.h \
45         ../include/vlc_charset.h \
46         ../include/vlc_sout.h \
47         ../include/vlc_streaming.h \
48         ../include/vlc_variables.h \
49         ../include/vlc_aout.h \
50         ../include/vlc_access.h \
51         ../include/vlc_arrays.h \
52         ../include/vlc_acl.h \
53         ../include/vlc_bits.h \
54         ../include/vlc_block.h \
55         ../include/vlc_block_helper.h \
56         ../include/vlc_codec.h \
57         ../include/vlc_common.h \
58         ../include/vlc_config.h \
59         ../include/vlc_demux.h \
60         ../include/vlc_es.h \
61         ../include/vlc_es_out.h \
62         ../include/vlc_filter.h \
63         ../include/vlc_config_cat.h \
64         ../include/vlc_httpd.h \
65         ../include/vlc_tls.h \
66         ../include/vlc_md5.h \
67         ../include/vlc_devices.h \
68         ../include/vlc_image.h \
69         ../include/vlc_input.h \
70         ../include/vlc_interface.h \
71         ../include/vlc_intf_strings.h \
72         ../include/vlc_keys.h \
73         ../include/vlc_messages.h \
74         ../include/vlc_meta.h \
75         ../include/vlc_objects.h \
76         ../include/vlc_osd.h \
77         ../include/vlc_playlist.h \
78         ../include/vlc_stream.h \
79         ../include/vlc_strings.h \
80         ../include/vlc_symbols.h \
81         ../include/vlc_threads_funcs.h \
82         ../include/vlc_threads.h \
83         ../include/vlc_update.h \
84         ../include/vlc_url.h \
85         ../include/vlc_vout.h \
86         ../include/vlc_vlm.h \
87         ../include/vlc_vod.h \
88         ../include/vlc_xml.h \
89         ../include/vlc_vout_synchro.h \
90         $(NULL)
91
92 misc/modules_builtin.h: misc/modules_builtin.h.in
93         $(TOOLBOX) --update-includes
94         touch $@
95
96 misc/modules.c: misc/modules_builtin.h
97
98 ###############################################################################
99 # Building libvlc
100 ###############################################################################
101
102 libvlc_a_SOURCES = $(SOURCES_libvlc) $(SOURCES_libvlc_control)
103 libvlc_a_CFLAGS = `$(VLC_CONFIG) --cflags libvlc pic` -DUSE_BUILTINS
104 libvlc_a_CXXFLAGS = `$(VLC_CONFIG) --cxxflags libvlc pic`
105 libvlc_a_OBJCFLAGS = `$(VLC_CONFIG) --objcflags libvlc pic`
106
107 libvlc_la_SOURCES = $(SOURCES_libvlc)
108 libvlc_la_LIBADD = $(INCLUDED_LIBINTL)
109 libvlc_la_CFLAGS = `$(VLC_CONFIG) --cflags libvlc`
110 libvlc_la_CXXFLAGS = `$(VLC_CONFIG) --cxxflags libvlc`
111 libvlc_la_OBJCFLAGS = `$(VLC_CONFIG) --objcflags libvlc`
112 libvlc_la_LDFLAGS = `$(VLC_CONFIG) --libs libvlc` \
113         -no-undefined -export-symbols $(srcdir)/libvlc.sym -version-info 1:0:0
114 libvlc_la_DEPENDENCIES = libvlc.sym
115
116 libvlc_control_la_SOURCES = $(SOURCES_libvlc_control)
117 libvlc_control_la_LIBADD = libvlc.la
118 libvlc_control_la_CFLAGS = `$(VLC_CONFIG) --cflags libvlc`
119 libvlc_control_la_LDFLAGS = \
120         -no-undefined -export-symbols-regex '_?(libvlc|mediacontrol)_.*' \
121         -version-info 0:0:0
122
123 if HAVE_BEOS
124 OPT_SOURCES_libvlc_beos = $(SOURCES_libvlc_beos)
125 endif
126 if HAVE_DARWIN
127 OPT_SOURCES_libvlc_darwin = $(SOURCES_libvlc_darwin)
128 endif
129 if HAVE_WIN32
130 OPT_SOURCES_libvlc_win32 = $(SOURCES_libvlc_win32)
131 endif
132 if HAVE_WINCE
133 OPT_SOURCES_libvlc_win32 = $(SOURCES_libvlc_win32)
134 endif
135 if BUILD_DIRENT
136 OPT_SOURCES_libvlc_dirent = $(SOURCES_libvlc_dirent)
137 endif
138 if BUILD_GETOPT
139 OPT_SOURCES_libvlc_getopt = $(SOURCES_libvlc_getopt)
140 endif
141
142 # Build libvlc as a shared library
143 if USE_LIBTOOL
144 lib_LTLIBRARIES = libvlc.la libvlc-control.la
145 else
146 lib_LIBRARIES = libvlc.a
147 endif
148
149 if HAVE_WIN32
150 pic =
151 else
152 pic = pic
153 endif
154
155 if HAVE_WIN32
156 DATA_noinst_libvlc = libvlc$(LIBEXT) libvlc$(LIBEXT).a
157
158 libvlc.dll.a libvlc.def: libvlc$(LIBEXT)
159         $(DLLTOOL) -z libvlc.def -l libvlc.dll.a -D $< $(libvlc_a_OBJECTS)
160
161 libvlc$(LIBEXT): $(libvlc_a_OBJECTS)
162         @ldfl="`$(VLC_CONFIG) --libs plugin libvlc pic` $(INCLUDED_LIBINTL)" ; \
163         case `$(VLC_CONFIG) --linkage libvlc` in \
164           c++)  ld="$(CXXLINK)" ;; \
165           objc) ld="$(OBJCLINK)" ;; \
166           c|*)  ld="$(LINK)" ;; \
167         esac ; \
168         echo $$ld $(libvlc_a_OBJECTS) $$ldfl; \
169         $$ld $(libvlc_a_OBJECTS) \
170                 $$ldfl
171 # It sucks big time, but we have to do that to link vlc properly
172 # on non-PIC OSes, otherwise ld will favor builtins-less libvlc.a over
173 # libvlc$(LIBEXT)
174         rm -f libvlc.a
175 # Cygwin libtool work-around
176         @if test -f "$@.exe"; then mv -f "$@.exe" "$@"; fi
177 endif
178
179 EXTRA_DIST += \
180         $(SOURCES_libvlc_beos) \
181         $(SOURCES_libvlc_darwin) \
182         $(SOURCES_libvlc_win32) \
183         $(SOURCES_libvlc_dirent) \
184         $(SOURCES_libvlc_getopt) \
185         $(NULL)
186
187 SOURCES_libvlc_beos = \
188         misc/beos_specific.cpp \
189         $(NULL)
190
191 SOURCES_libvlc_darwin = \
192         misc/darwin_specific.m \
193         $(NULL)
194
195 SOURCES_libvlc_win32 = \
196         misc/win32_specific.c \
197         $(NULL)
198
199 SOURCES_libvlc_dirent = \
200         extras/dirent.c \
201         $(NULL)
202
203 SOURCES_libvlc_getopt = \
204         extras/getopt.c \
205         extras/getopt.h \
206         extras/getopt1.c \
207         $(NULL)
208
209 SOURCES_libvlc_common = \
210         libvlc.c \
211         libvlc-common.c \
212         libvlc.h \
213         libvlc-module.c \
214         interface/interface.h \
215         interface/interface.c \
216         interface/intf_eject.c \
217         interface/interaction.c \
218         playlist/playlist_internal.h \
219         playlist/thread.c \
220         playlist/control.c \
221         playlist/engine.c \
222         playlist/sort.c \
223         playlist/loadsave.c \
224         playlist/tree.c \
225         playlist/item.c \
226         playlist/search.c \
227         playlist/services_discovery.c \
228         input/item.c \
229         input/access.c \
230         input/clock.c \
231         input/control.c \
232         input/decoder.c \
233         input/demux.c \
234         input/es_out.c \
235         input/input.c \
236         input/meta.c \
237         input/input_internal.h \
238         input/stream.c \
239         input/mem_stream.c \
240         input/subtitles.c \
241         input/var.c \
242         video_output/video_output.c \
243         video_output/vout_pictures.c \
244         video_output/vout_pictures.h \
245         video_output/video_text.c \
246         video_output/video_widgets.c \
247         video_output/vout_subpictures.c \
248         video_output/vout_synchro.c \
249         video_output/vout_intf.c \
250         audio_output/aout_internal.h \
251         audio_output/common.c \
252         audio_output/dec.c \
253         audio_output/filters.c \
254         audio_output/input.c \
255         audio_output/mixer.c \
256         audio_output/output.c \
257         audio_output/intf.c \
258         stream_output/stream_output.c \
259         stream_output/stream_output.h \
260         stream_output/announce.c \
261         stream_output/profiles.c \
262         stream_output/sap.c \
263         stream_output/sdp.c \
264         osd/osd.c \
265         osd/osd_parser.c \
266         osd/osd_text.c \
267         osd/osd_widgets.c \
268         network/acl.c \
269         network/getaddrinfo.c \
270         network/io.c \
271         network/error.c \
272         network/tcp.c \
273         network/udp.c \
274         network/httpd.c \
275         network/rootwrap.c \
276         network/tls.c \
277         network/poll.c \
278         text/charset.c \
279         text/strings.c \
280         text/unicode.c \
281         text/iso_lang.c \
282         text/iso-639_def.h \
283         misc/md5.c \
284         misc/mtime.c \
285         misc/block.c \
286         misc/modules.h \
287         misc/modules.c \
288         misc/threads.c \
289         misc/stats.c \
290         misc/cpu.c \
291         misc/configuration.h \
292         misc/configuration.c \
293         misc/configuration_chain.c \
294         misc/image.c \
295         misc/messages.c \
296         misc/objects.c \
297         misc/variables.h \
298         misc/variables.c \
299         misc/error.c \
300         misc/update.c \
301         input/vlm.c \
302         misc/xml.c \
303         misc/devices.c \
304         extras/libc.c \
305         $(NULL)
306
307 SOURCES_libvlc = \
308         $(SOURCES_libvlc_common) \
309         $(OPT_SOURCES_libvlc_beos) \
310         $(OPT_SOURCES_libvlc_darwin) \
311         $(OPT_SOURCES_libvlc_win32) \
312         $(OPT_SOURCES_libvlc_dirent) \
313         $(OPT_SOURCES_libvlc_getopt) \
314         $(NULL)
315
316 SOURCES_libvlc_control = \
317         control/libvlc_internal.h \
318         control/core.c \
319         control/log.c \
320         control/playlist.c \
321         control/vlm.c \
322         control/input.c \
323         control/video.c \
324         control/audio.c \
325         control/mediacontrol_internal.h \
326         control/mediacontrol_core.c \
327         control/mediacontrol_util.c \
328         control/mediacontrol_audio_video.c
329
330 if !USE_LIBTOOL
331 if !HAVE_WIN32
332 nodist_libvlc_a_SOURCES = misc/version.c
333 CLEANFILES += misc/version.c
334
335 misc/version.c: FORCE
336         $(TOOLBOX) --update-version
337 endif
338
339 # Install shared libvlc
340 install-exec-local:
341         test -z "$(DATA_noinst_libvlc)" || $(INSTALL_PROGRAM) "$(DATA_noinst_libvlc)" "$(DESTDIR)$(libdir)"
342
343 # the opposite of install-{data,exec}-local
344 uninstall-local:
345         test -z "$(DATA_noinst_libvlc)" || rm -f "$(DESTDIR)$(libdir)/$(DATA_noinst_libvlc)"
346 endif
347
348 ###############################################################################
349 # Stamp rules
350 ###############################################################################
351
352 if !USE_LIBTOOL
353 if !HAVE_WIN32
354 stamp-api: Makefile.in $(HEADERS_include) ../vlc-api.pl
355         ( cd $(srcdir) && cat $(HEADERS_include) ) | \
356           top_srcdir="$(top_srcdir)" perl $(top_srcdir)/vlc-api.pl
357         touch stamp-api
358
359 CLEANFILES += stamp-api
360 endif
361 endif
362
363 ###############################################################################
364 # Unit/regression test
365 ###############################################################################
366 if USE_LIBTOOL
367 check_PROGRAMS = test_i18n_atof test_url test_utf8
368 TESTS = $(check_PROGRAMS)
369 endif
370
371 CFLAGS_tests = `$(VLC_CONFIG) --cflags libvlc`
372
373 test_i18n_atof_SOURCES = test/i18n_atof.c
374 test_i18n_atof_LDADD = libvlc.la
375 test_i18n_atof_CFLAGS = $(CFLAGS_tests)
376
377 test_url_SOURCES = test/url.c
378 test_url_LDADD = libvlc.la
379 test_url_CFLAGS = $(CFLAGS_tests)
380
381 test_utf8_SOURCES = test/utf8.c
382 test_utf8_LDADD = libvlc.la
383 test_utf8_CFLAGS = $(CFLAGS_tests)
384
385 FORCE: