70ec034dc9a208e1590a741dd40db2685a0ae219
[vlc.git] / src / Makefile.am
1 ###############################################################################
2 # Automake targets and declarations
3 ###############################################################################
4
5 AUTOMAKE_OPTIONS = subdir-objects
6
7 NULL =
8 EXTRA_DIST = extras/COPYING modules/builtin.h.in libvlc.sym
9
10 BUILT_SOURCES = modules/builtin.h misc/revision.c ../include/vlc_about.h
11 CLEANFILES = $(BUILT_SOURCES)
12
13 ###############################################################################
14 # Headers
15 ###############################################################################
16
17 pkgincludedir = $(includedir)/vlc
18
19 dist_pkginclude_HEADERS = \
20         ../include/vlc/vlc.h \
21         ../include/vlc/libvlc.h \
22         ../include/vlc/libvlc_structures.h \
23         ../include/vlc/mediacontrol.h \
24         ../include/vlc/mediacontrol_structures.h \
25         $(NULL)
26
27 noinst_HEADERS = $(HEADERS_include)
28
29 HEADERS_include = \
30         ../include/iso_lang.h \
31         ../include/main.h \
32         ../include/mmx.h \
33         ../include/vlc_access.h \
34         ../include/vlc_acl.h \
35         ../include/vlc_aout.h \
36         ../include/vlc_arrays.h \
37         ../include/vlc_bits.h \
38         ../include/vlc_block.h \
39         ../include/vlc_block_helper.h \
40         ../include/vlc_charset.h \
41         ../include/vlc_codec.h \
42         ../include/vlc_codec_synchro.h \
43         ../include/vlc_codecs.h \
44         ../include/vlc_common.h \
45         ../include/vlc_config.h \
46         ../include/vlc_config_cat.h \
47         ../include/vlc_configuration.h \
48         ../include/vlc_demux.h \
49         ../include/vlc_devices.h \
50         ../include/vlc_epg.h \
51         ../include/vlc_es.h \
52         ../include/vlc_es_out.h \
53         ../include/vlc_events.h \
54         ../include/vlc_filter.h \
55         ../include/vlc_fixups.h \
56         ../include/vlc_httpd.h \
57         ../include/vlc_image.h \
58         ../include/vlc_input.h \
59         ../include/vlc_interface.h \
60         ../include/vlc_intf_strings.h \
61         ../include/vlc_keys.h \
62         ../include/vlc_md5.h \
63         ../include/vlc_messages.h \
64         ../include/vlc_meta.h \
65         ../include/vlc_modules.h \
66         ../include/vlc_modules_macros.h \
67         ../include/vlc_mtime.h \
68         ../include/vlc_network.h \
69         ../include/vlc_objects.h \
70         ../include/vlc_os_specific.h \
71         ../include/vlc_osd.h \
72         ../include/vlc_pgpkey.h \
73         ../include/vlc_playlist.h \
74         ../include/vlc_rand.h \
75         ../include/vlc_services_discovery.h \
76         ../include/vlc_sout.h \
77         ../include/vlc_stream.h \
78         ../include/vlc_streaming.h \
79         ../include/vlc_strings.h \
80         ../include/vlc_threads.h \
81         ../include/vlc_threads_funcs.h \
82         ../include/vlc_tls.h \
83         ../include/vlc_update.h \
84         ../include/vlc_url.h \
85         ../include/vlc_variables.h \
86         ../include/vlc_vlm.h \
87         ../include/vlc_vod.h \
88         ../include/vlc_vout.h \
89         ../include/vlc_xml.h \
90         $(NULL)
91
92 modules/builtin.h: modules/builtin.h.in ../vlc-config Makefile.am
93         rm -f -- "$@.tmp"
94         cat "$(srcdir)/modules/builtin.h.in" > "$@.tmp"
95 if !HAVE_PLUGINS
96         plugins="$$($(VLC_CONFIG) --list plugin)" ; \
97         test -n "$${plugins}" && \
98         for p in $${plugins}; do \
99                 echo "int vlc_entry__$$p (module_t *);" ; \
100         done >> "$@.tmp"
101 endif
102         echo "#define ALLOCATE_ALL_BUILTINS() \\" >> "$@.tmp"
103         echo "    do \\" >> "$@.tmp"
104         echo "    { \\" >> "$@.tmp"
105 if !HAVE_PLUGINS
106         plugins="$$($(VLC_CONFIG) --list plugin)" ; \
107         test -n "$${plugins}" && \
108         for p in $${plugins}; do \
109                 echo "        ALLOCATE_BUILTIN($$p); \\" ; \
110         done >> "$@.tmp"
111 endif
112         echo '    } while( 0 );' >> "$@.tmp"
113         mv -f -- "$@.tmp" "$@"
114
115 modules/modules.c: modules/builtin.h
116
117 ../include/vlc_about.h: Makefile.am $(top_srcdir)/COPYING $(top_srcdir)/THANKS $(top_srcdir)/AUTHORS
118         rm -f -- "$@.tmp"
119         mkdir -p -- ../include
120         echo "/* Automatically generated file - DO NOT EDIT */" > "$@.tmp"
121         echo "static const char psz_license[] =" >> "$@.tmp"
122         cat $(top_srcdir)/COPYING | sed s/'"'/'\\"'/g | $(AWK) '{ print "\""$$0"\\n\"" }' >> "$@.tmp"
123         echo ";" >> "$@.tmp"
124         echo "static const char psz_thanks[] =" >> "$@.tmp"
125         grep -v '$$Id:'  $(top_srcdir)/THANKS | sed s/'"'/'\\"'/g | $(AWK) '{ print "\""$$0"\\n\"" }'|sed s/"<.*.> "// >> "$@.tmp"
126         echo ";" >> "$@.tmp"
127         echo "static const char psz_authors[] =" >> "$@.tmp"
128         grep N: $(top_srcdir)/AUTHORS | cut -d" " -f 2- | sed s/'"'/'\\"'/g | $(AWK) '{ print "\""$$0"\\n\"" }' >> "$@.tmp"
129         echo ";" >> "$@.tmp"
130         mv -f -- "$@.tmp" "$@"
131 ###############################################################################
132 # Building libvlc
133 ###############################################################################
134
135 nice:
136         $(top_builddir)/compile
137
138 lib_LTLIBRARIES = libvlc.la libvlc-control.la
139
140 AM_LDFLAGS = -no-undefined -no-install
141 if HAVE_WIN32
142 AM_LDFLAGS += -avoid-version
143 endif
144
145 libvlc_la_SOURCES = $(SOURCES_libvlc)
146 nodist_libvlc_la_SOURCES = misc/revision.c
147 libvlc_la_CFLAGS = `$(VLC_CONFIG) --cflags libvlc`
148 libvlc_la_CXXFLAGS = `$(VLC_CONFIG) --cxxflags libvlc`
149 libvlc_la_OBJCFLAGS = `$(VLC_CONFIG) --objcflags libvlc`
150 libvlc_la_LDFLAGS = `$(VLC_CONFIG) --ldflags libvlc` $(AM_LDFLAGS) \
151         -version-info 1:0:0
152 if HAVE_COMPILER_EXPORT
153 libvlc_la_LDFLAGS += -export-dynamic
154 else
155 libvlc_la_LDFLAGS += -export-symbols $(srcdir)/libvlc.sym 
156 endif
157 libvlc_la_LIBADD = `$(VLC_CONFIG) -libs libvlc` $(AM_LIBADD) $(LTLIBINTL)
158
159 libvlc_la_DEPENDENCIES = libvlc.sym
160
161 libvlc_control_la_SOURCES = $(SOURCES_libvlc_control)
162 libvlc_control_la_LIBADD = libvlc.la
163 libvlc_control_la_CFLAGS = `$(VLC_CONFIG) --cflags libvlc`
164 libvlc_control_la_LDFLAGS = $(AM_LDFLAGS) -version-info 1:0:0
165 if HAVE_COMPILER_EXPORT
166 libvlc_control_la_LDFLAGS += -export-dynamic
167 else
168 libvlc_control_la_LDFLAGS += -export-symbols-regex '^_?(libvlc|mediacontrol)_.*'
169 endif
170
171 EXTRA_libvlc_la_SOURCES = \
172         $(SOURCES_libvlc_beos) \
173         $(SOURCES_libvlc_darwin) \
174         $(SOURCES_libvlc_win32) \
175         $(SOURCES_libvlc_dirent) \
176         $(SOURCES_libvlc_getopt) \
177         $(NULL)
178 if HAVE_BEOS
179 libvlc_la_SOURCES += $(SOURCES_libvlc_beos)
180 endif
181 if HAVE_DARWIN
182 libvlc_la_SOURCES += $(SOURCES_libvlc_darwin)
183 endif
184 if HAVE_WIN32
185 libvlc_la_SOURCES += $(SOURCES_libvlc_win32)
186 endif
187 if HAVE_WINCE
188 libvlc_la_SOURCES += $(SOURCES_libvlc_win32)
189 endif
190 if BUILD_DIRENT
191 libvlc_la_SOURCES += $(SOURCES_libvlc_dirent)
192 endif
193 if BUILD_GETOPT
194 libvlc_la_SOURCES += $(SOURCES_libvlc_getopt)
195 endif
196
197 SOURCES_libvlc_beos = \
198         misc/beos_specific.cpp \
199         $(NULL)
200
201 SOURCES_libvlc_darwin = \
202         misc/darwin_specific.c \
203         $(NULL)
204
205 SOURCES_libvlc_win32 = \
206         misc/win32_specific.c \
207         $(NULL)
208
209 SOURCES_libvlc_dirent = \
210         extras/dirent.c \
211         $(NULL)
212
213 SOURCES_libvlc_getopt = \
214         extras/getopt.c \
215         extras/getopt.h \
216         extras/getopt1.c \
217         $(NULL)
218
219 SOURCES_libvlc_common = \
220         libvlc.c \
221         libvlc-common.c \
222         libvlc.h \
223         libvlc-module.c \
224         interface/interface.h \
225         interface/interface.c \
226         interface/intf_eject.c \
227         interface/interaction.c \
228         playlist/playlist_internal.h \
229         playlist/thread.c \
230         playlist/control.c \
231         playlist/engine.c \
232         playlist/sort.c \
233         playlist/loadsave.c \
234         playlist/tree.c \
235         playlist/item.c \
236         playlist/search.c \
237         playlist/services_discovery.c \
238         input/item.c \
239         input/access.c \
240         input/clock.c \
241         input/control.c \
242         input/decoder.c \
243         input/decoder_synchro.c \
244         input/demux.c \
245         input/es_out.c \
246         input/input.c \
247         input/meta.c \
248         input/input_internal.h \
249         input/vlm_internal.h \
250         input/stream.c \
251         input/mem_stream.c \
252         input/subtitles.c \
253         input/var.c \
254         video_output/video_output.c \
255         video_output/vout_pictures.c \
256         video_output/vout_pictures.h \
257         video_output/video_text.c \
258         video_output/video_widgets.c \
259         video_output/vout_subpictures.c \
260         video_output/vout_intf.c \
261         audio_output/aout_internal.h \
262         audio_output/common.c \
263         audio_output/dec.c \
264         audio_output/filters.c \
265         audio_output/input.c \
266         audio_output/mixer.c \
267         audio_output/output.c \
268         audio_output/intf.c \
269         stream_output/stream_output.c \
270         stream_output/stream_output.h \
271         stream_output/announce.c \
272         stream_output/profiles.c \
273         stream_output/sap.c \
274         stream_output/sdp.c \
275         osd/osd.c \
276         osd/osd_text.c \
277         osd/osd_widgets.c \
278         network/acl.c \
279         network/getaddrinfo.c \
280         network/io.c \
281         network/error.c \
282         network/tcp.c \
283         network/udp.c \
284         network/httpd.c \
285         network/rootwrap.c \
286         network/tls.c \
287         network/poll.c \
288         text/charset.c \
289         text/strings.c \
290         text/unicode.c \
291         text/wincp.c \
292         text/iso_lang.c \
293         text/iso-639_def.h \
294         misc/md5.c \
295         misc/rand.c \
296         misc/mtime.c \
297         misc/block.c \
298         modules/modules.h \
299         modules/modules.c \
300         modules/cache.c \
301         modules/entry.c \
302         modules/os.c \
303         misc/threads.c \
304         misc/stats.c \
305         misc/cpu.c \
306         config/configuration.h \
307         config/core.c \
308         config/chain.c \
309         config/file.c \
310         config/cmdline.c \
311         misc/events.c \
312         misc/image.c \
313         misc/messages.c \
314         misc/objects.c \
315         misc/variables.h \
316         misc/variables.c \
317         misc/error.c \
318         misc/update.c \
319         input/vlm.c \
320         misc/xml.c \
321         misc/devices.c \
322         extras/libc.c \
323         $(NULL)
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 SOURCES_libvlc_control = \
335         control/libvlc_internal.h \
336         control/core.c \
337         control/log.c \
338         control/playlist.c \
339         control/vlm.c \
340         control/video.c \
341         control/audio.c \
342         control/dynamic_media_list.c \
343         control/event.c \
344         control/flat_media_list_view.c \
345         control/hierarchical_media_list_view.c \
346         control/hierarchical_node_media_list_view.c \
347         control/media_descriptor.c \
348         control/media_instance.c \
349         control/media_list.c \
350         control/media_list_path.h \
351         control/media_list_player.c \
352         control/media_list_view.c \
353         control/media_library.c \
354         control/mediacontrol_internal.h \
355         control/mediacontrol_core.c \
356         control/mediacontrol_util.c \
357         control/mediacontrol_audio_video.c \
358         control/media_discoverer.c \
359         control/tag_query.c
360
361 ###############################################################################
362 # Stamp rules
363 ###############################################################################
364
365 misc/revision.c:
366         rm -f $@ $@.tmp
367         echo "/* AUTOGENERATED FILE - DO NOT EDIT */" > $@.tmp
368         REVISION="$$(LANG=C svnversion "$(top_srcdir)" 2>/dev/null || echo exported)" ; \
369         echo "const char psz_vlc_changeset[] = \"$$REVISION\";" >> $@.tmp
370         mv -f $@.tmp $@
371
372 ###############################################################################
373 # Unit/regression test
374 ###############################################################################
375 check_PROGRAMS = \
376         test_i18n_atof \
377         test_url \
378         test_utf8 \
379         test_headers \
380         test_control \
381         $(NULL)
382
383 dist_check_SCRIPTS = check_symbols
384 TESTS = $(check_PROGRAMS) $(dist_check_SCRIPTS)
385
386 CFLAGS_tests = `$(VLC_CONFIG) --cflags libvlc`
387
388 test_i18n_atof_SOURCES = test/i18n_atof.c text/charset.c
389 test_i18n_atof_CFLAGS = $(CFLAGS_tests)
390
391 test_url_SOURCES = test/url.c
392 test_url_LDADD = libvlc.la
393 test_url_CFLAGS = $(CFLAGS_tests)
394
395 test_utf8_SOURCES = test/utf8.c
396 test_utf8_LDADD = libvlc.la
397 test_utf8_CFLAGS = $(CFLAGS_tests)
398
399 test_headers_SOURCES = test/headers.c
400 test_headers_CFLAGS = $(CFLAGS_tests)
401
402 test_control_SOURCES = control/testapi.c
403 test_control_LDADD = libvlc-control.la
404 test_control_CFLAGS = $(CFLAGS_tests)
405
406 check-local:
407         for h in `echo $(dist_pkginclude_HEADERS) $(pkginclude_HEADERS) | sed -e s,\.\./include/,,g`; \
408         do \
409                 echo grep - "#include <$$h>" $(srcdir)/test/headers.c ; \
410                 if ! grep -- "#include <$$h>" $(srcdir)/test/headers.c ; \
411                 then \
412                         echo "Header $$h not included in test/headers.c!"; \
413                         exit 1; \
414                 fi ; \
415         done
416
417 FORCE:
418         @echo "Generated source cannot be phony. Go away." >&2
419         @exit 1
420
421 .PHONY: FORCE