]> git.sesse.net Git - vlc/blob - src/Makefile.am
Try to fix NLS on Win32
[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 = $(hacklib_DATA) $(noinst_DATA)
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
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_epg.h \
63         ../include/vlc_filter.h \
64         ../include/vlc_config_cat.h \
65         ../include/vlc_httpd.h \
66         ../include/vlc_tls.h \
67         ../include/vlc_md5.h \
68         ../include/vlc_devices.h \
69         ../include/vlc_image.h \
70         ../include/vlc_input.h \
71         ../include/vlc_interface.h \
72         ../include/vlc_intf_strings.h \
73         ../include/vlc_keys.h \
74         ../include/vlc_messages.h \
75         ../include/vlc_meta.h \
76         ../include/vlc_objects.h \
77         ../include/vlc_osd.h \
78         ../include/vlc_playlist.h \
79         ../include/vlc_stream.h \
80         ../include/vlc_strings.h \
81         ../include/vlc_symbols.h \
82         ../include/vlc_threads_funcs.h \
83         ../include/vlc_threads.h \
84         ../include/vlc_update.h \
85         ../include/vlc_url.h \
86         ../include/vlc_vout.h \
87         ../include/vlc_vlm.h \
88         ../include/vlc_vod.h \
89         ../include/vlc_xml.h \
90         ../include/vlc_vout_synchro.h \
91         $(NULL)
92
93 modules/builtin.h: modules/builtin.h.in
94         $(TOOLBOX) --update-includes
95         touch $@
96
97 modules/modules.c: modules/builtin.h
98
99 ###############################################################################
100 # Building libvlc
101 ###############################################################################
102
103 lib_LTLIBRARIES = libvlc.la libvlc-control.la
104
105 AM_LDFLAGS =
106 if HAVE_WIN32
107 AM_LDFLAGS += -static
108 endif
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` $(AM_LDFLAGS) \
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 = $(AM_LDFLAGS) \
124         -no-undefined -export-symbols-regex '^_?(libvlc|mediacontrol)_.*' \
125         -version-info 0:0:0
126
127 EXTRA_libvlc_la_SOURCES = \
128         $(SOURCES_libvlc_beos) \
129         $(SOURCES_libvlc_darwin) \
130         $(SOURCES_libvlc_win32) \
131         $(SOURCES_libvlc_dirent) \
132         $(SOURCES_libvlc_getopt) \
133         $(NULL)
134 if HAVE_BEOS
135 libvlc_la_SOURCES += $(SOURCES_libvlc_beos)
136 endif
137 if HAVE_DARWIN
138 libvlc_la_SOURCES += $(SOURCES_libvlc_darwin)
139 endif
140 if HAVE_WIN32
141 libvlc_la_SOURCES += $(SOURCES_libvlc_win32)
142 endif
143 if HAVE_WINCE
144 libvlc_la_SOURCES += $(SOURCES_libvlc_win32)
145 endif
146 if BUILD_DIRENT
147 libvlc_la_SOURCES += $(SOURCES_libvlc_dirent)
148 endif
149 if BUILD_GETOPT
150 libvlc_la_SOURCES += $(SOURCES_libvlc_getopt)
151 endif
152
153 if HAVE_WIN32
154 # Überhack. Needs fixing.
155 hacklibdir = $(libdir)
156 hacklib_DATA = libvlc.dll libvlc.dll.a
157 noinst_DATA = libvlc.def
158 endif
159
160 libvlc.dll.a libvlc.def: libvlc.dll
161         $(DLLTOOL) -z libvlc.def -l libvlc.dll.a -D $< $(libvlc_a_OBJECTS)
162
163 libvlc.dll: $(libvlc_la_OBJECTS)
164
165 .la.dll:
166         @ldfl="`$(VLC_CONFIG) --libs plugin libvlc pic` $(INCLUDED_LIBINTL)" ; \
167         objs="" ; \
168         for s in $^; do \
169                 test "$$s" = "$<" || \
170                 objs="$$objs $$(dirname "$$s")/.libs/$$(basename $${s%.lo}).o" ; \
171         done ; \
172         case `$(VLC_CONFIG) --linkage libvlc` in \
173           c++)  ld="$(CXXLINK)" ;; \
174           c|*)  ld="$(LINK)" ;; \
175         esac ; \
176         echo $$ld $$objs$ldfl; \
177         $$ld $$objs $$ldfl
178         @if test -f "$@.exe"; then mv -f "$@.exe" "$@"; fi
179
180 SOURCES_libvlc_beos = \
181         misc/beos_specific.cpp \
182         $(NULL)
183
184 SOURCES_libvlc_darwin = \
185         misc/darwin_specific.c \
186         $(NULL)
187
188 SOURCES_libvlc_win32 = \
189         misc/win32_specific.c \
190         $(NULL)
191
192 SOURCES_libvlc_dirent = \
193         extras/dirent.c \
194         $(NULL)
195
196 SOURCES_libvlc_getopt = \
197         extras/getopt.c \
198         extras/getopt.h \
199         extras/getopt1.c \
200         $(NULL)
201
202 SOURCES_libvlc_common = \
203         libvlc.c \
204         libvlc-common.c \
205         libvlc.h \
206         libvlc-module.c \
207         interface/interface.h \
208         interface/interface.c \
209         interface/intf_eject.c \
210         interface/interaction.c \
211         playlist/playlist_internal.h \
212         playlist/thread.c \
213         playlist/control.c \
214         playlist/engine.c \
215         playlist/sort.c \
216         playlist/loadsave.c \
217         playlist/tree.c \
218         playlist/item.c \
219         playlist/search.c \
220         playlist/services_discovery.c \
221         input/item.c \
222         input/access.c \
223         input/clock.c \
224         input/control.c \
225         input/decoder.c \
226         input/demux.c \
227         input/es_out.c \
228         input/input.c \
229         input/meta.c \
230         input/input_internal.h \
231         input/vlm_internal.h \
232         input/stream.c \
233         input/mem_stream.c \
234         input/subtitles.c \
235         input/var.c \
236         video_output/video_output.c \
237         video_output/vout_pictures.c \
238         video_output/vout_pictures.h \
239         video_output/video_text.c \
240         video_output/video_widgets.c \
241         video_output/vout_subpictures.c \
242         video_output/vout_synchro.c \
243         video_output/vout_intf.c \
244         audio_output/aout_internal.h \
245         audio_output/common.c \
246         audio_output/dec.c \
247         audio_output/filters.c \
248         audio_output/input.c \
249         audio_output/mixer.c \
250         audio_output/output.c \
251         audio_output/intf.c \
252         stream_output/stream_output.c \
253         stream_output/stream_output.h \
254         stream_output/announce.c \
255         stream_output/profiles.c \
256         stream_output/sap.c \
257         stream_output/sdp.c \
258         osd/osd.c \
259         osd/osd_parser.c \
260         osd/osd_text.c \
261         osd/osd_widgets.c \
262         network/acl.c \
263         network/getaddrinfo.c \
264         network/io.c \
265         network/error.c \
266         network/tcp.c \
267         network/udp.c \
268         network/httpd.c \
269         network/rootwrap.c \
270         network/tls.c \
271         network/poll.c \
272         text/charset.c \
273         text/strings.c \
274         text/unicode.c \
275         text/wincp.c \
276         text/iso_lang.c \
277         text/iso-639_def.h \
278         misc/md5.c \
279         misc/mtime.c \
280         misc/block.c \
281         modules/modules.h \
282         modules/modules.c \
283         modules/entry.c \
284         misc/threads.c \
285         misc/stats.c \
286         misc/cpu.c \
287         modules/configuration.h \
288         modules/configuration.c \
289         modules/configuration_chain.c \
290         misc/image.c \
291         misc/messages.c \
292         misc/objects.c \
293         misc/variables.h \
294         misc/variables.c \
295         misc/error.c \
296         misc/update.c \
297         input/vlm.c \
298         misc/xml.c \
299         misc/devices.c \
300         extras/libc.c \
301         $(NULL)
302
303 SOURCES_libvlc = \
304         $(SOURCES_libvlc_common) \
305         $(OPT_SOURCES_libvlc_beos) \
306         $(OPT_SOURCES_libvlc_darwin) \
307         $(OPT_SOURCES_libvlc_win32) \
308         $(OPT_SOURCES_libvlc_dirent) \
309         $(OPT_SOURCES_libvlc_getopt) \
310         $(NULL)
311
312 SOURCES_libvlc_control = \
313         control/libvlc_internal.h \
314         control/core.c \
315         control/log.c \
316         control/playlist.c \
317         control/vlm.c \
318         control/video.c \
319         control/audio.c \
320         control/event.c \
321         control/media_descriptor.c \
322         control/media_instance.c \
323         control/mediacontrol_internal.h \
324         control/mediacontrol_core.c \
325         control/mediacontrol_util.c \
326         control/mediacontrol_audio_video.c
327
328 ###############################################################################
329 # Stamp rules
330 ###############################################################################
331
332 if !USE_LIBTOOL
333 if !HAVE_WIN32
334 stamp-api: Makefile.in $(HEADERS_include) ../vlc-api.pl
335         ( cd $(srcdir) && cat $(HEADERS_include) ) | \
336           top_srcdir="$(top_srcdir)" perl $(top_srcdir)/vlc-api.pl
337         touch stamp-api
338
339 CLEANFILES += stamp-api
340 endif
341 endif
342
343 misc/revision.c:
344         rm -f $@ $@.tmp
345         echo "/* AUTOGENERATED FILE - DO NOT EDIT */" > $@.tmp
346         REVISION="$$(LANG=C svnversion "$(top_srcdir)" 2>/dev/null || echo exported)" ; \
347         echo "const char psz_vlc_changeset[] = \"$$REVISION\";" >> $@.tmp
348         mv -f $@.tmp $@
349
350 ###############################################################################
351 # Unit/regression test
352 ###############################################################################
353 if USE_LIBTOOL
354 check_PROGRAMS = test_i18n_atof test_url test_utf8
355 TESTS = $(check_PROGRAMS)
356 endif
357
358 CFLAGS_tests = `$(VLC_CONFIG) --cflags libvlc`
359
360 test_i18n_atof_SOURCES = test/i18n_atof.c text/charset.c
361 test_i18n_atof_CFLAGS = $(CFLAGS_tests)
362
363 test_url_SOURCES = test/url.c
364 test_url_LDADD = libvlc.la
365 test_url_CFLAGS = $(CFLAGS_tests)
366
367 test_utf8_SOURCES = test/utf8.c
368 test_utf8_LDADD = libvlc.la
369 test_utf8_CFLAGS = $(CFLAGS_tests)
370
371 FORCE:
372         @echo "Generated source cannot be phony. Go away." >&2
373         @exit 1
374
375 .PHONY: FORCE