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