picture: privatize reference counting
[vlc.git] / src / Makefile.am
1 ###############################################################################
2 # Automake targets and declarations
3 ###############################################################################
4
5 AUTOMAKE_OPTIONS = subdir-objects
6
7 NULL =
8 EXTRA_DIST = \
9         vlc-plugin.pc.in \
10         libvlccore.sym \
11         revision.txt
12
13 BUILT_SOURCES = $(nodist_pluginsinclude_HEADERS)
14 CLEANFILES = $(BUILT_SOURCES)
15
16 SUFFIXES = .pc.in .pc .rc.in .rc
17
18 ###############################################################################
19 # Headers
20 ###############################################################################
21
22 pluginsincludedir = $(pkgincludedir)/plugins
23
24 pluginsinclude_HEADERS = \
25         ../include/vlc_access.h \
26         ../include/vlc_addons.h \
27         ../include/vlc_aout.h \
28         ../include/vlc_aout_volume.h \
29         ../include/vlc_arrays.h \
30         ../include/vlc_atomic.h \
31         ../include/vlc_avcodec.h \
32         ../include/vlc_bits.h \
33         ../include/vlc_block.h \
34         ../include/vlc_block_helper.h \
35         ../include/vlc_charset.h \
36         ../include/vlc_codec.h \
37         ../include/vlc_common.h \
38         ../include/vlc_config.h \
39         ../include/vlc_config_cat.h \
40         ../include/vlc_configuration.h \
41         ../include/vlc_cpu.h \
42         ../include/vlc_dialog.h \
43         ../include/vlc_demux.h \
44         ../include/vlc_epg.h \
45         ../include/vlc_es.h \
46         ../include/vlc_es_out.h \
47         ../include/vlc_events.h \
48         ../include/vlc_filter.h \
49         ../include/vlc_fourcc.h \
50         ../include/vlc_fs.h \
51         ../include/vlc_gcrypt.h \
52         ../include/vlc_opengl.h \
53         ../include/vlc_http.h \
54         ../include/vlc_httpd.h \
55         ../include/vlc_image.h \
56         ../include/vlc_inhibit.h \
57         ../include/vlc_input.h \
58         ../include/vlc_input_item.h \
59         ../include/vlc_interface.h \
60         ../include/vlc_keys.h \
61         ../include/vlc_main.h \
62         ../include/vlc_md5.h \
63         ../include/vlc_messages.h \
64         ../include/vlc_meta.h \
65         ../include/vlc_meta_fetcher.h \
66         ../include/vlc_media_library.h \
67         ../include/vlc_mime.h \
68         ../include/vlc_modules.h \
69         ../include/vlc_mouse.h \
70         ../include/vlc_mtime.h \
71         ../include/vlc_network.h \
72         ../include/vlc_objects.h \
73         ../include/vlc_picture.h \
74         ../include/vlc_picture_fifo.h \
75         ../include/vlc_picture_pool.h \
76         ../include/vlc_playlist.h \
77         ../include/vlc_plugin.h \
78         ../include/vlc_probe.h \
79         ../include/vlc_rand.h \
80         ../include/vlc_services_discovery.h \
81         ../include/vlc_fingerprinter.h \
82         ../include/vlc_sout.h \
83         ../include/vlc_spu.h \
84         ../include/vlc_stream.h \
85         ../include/vlc_strings.h \
86         ../include/vlc_subpicture.h \
87         ../include/vlc_text_style.h \
88         ../include/vlc_threads.h \
89         ../include/vlc_tls.h \
90         ../include/vlc_url.h \
91         ../include/vlc_variables.h \
92         ../include/vlc_vlm.h \
93         ../include/vlc_video_splitter.h \
94         ../include/vlc_vout.h \
95         ../include/vlc_vout_display.h \
96         ../include/vlc_vout_osd.h \
97         ../include/vlc_vout_window.h \
98         ../include/vlc_xml.h \
99         ../include/vlc_xlib.h \
100         $(NULL)
101 nodist_pluginsinclude_HEADERS = ../include/vlc_about.h
102
103 noinst_HEADERS = \
104         ../include/vlc_codec_synchro.h \
105         ../include/vlc_codecs.h \
106         ../include/vlc_extensions.h \
107         ../include/vlc_fixups.h \
108         ../include/vlc_intf_strings.h \
109         ../include/vlc_iso_lang.h \
110         ../include/vlc_memory.h \
111         ../include/vlc_pgpkey.h \
112         ../include/vlc_update.h \
113         ../include/vlc_vod.h \
114         ../include/vlc_vout_wrapper.h \
115         ../include/vlc_windows_interfaces.h \
116         $(NULL)
117
118 ../include/vlc_about.h: Makefile.am $(top_srcdir)/COPYING $(top_srcdir)/THANKS $(top_srcdir)/AUTHORS
119         $(AM_V_at)rm -f -- "$@.tmp"
120         $(AM_V_at)mkdir -p -- ../include
121         $(AM_V_GEN)(echo "/* Automatically generated file - DO NOT EDIT */" && \
122         echo "static const char psz_license[] =" && \
123         sed 's/"/\\"/g;s/^.*$$/\"&\\n\"/' "$(top_srcdir)/COPYING" && \
124         echo ";" && \
125         echo "static const char psz_thanks[] =" && \
126         sed '/\$$Id:/d;s/"/\\"/g;s/<.*.> //;s/^.*$$/\"&\\n\"/' \
127                 "$(top_srcdir)/THANKS" && \
128         echo ";" && \
129         echo "static const char psz_authors[] =" && \
130         sed '/\$$Id:/d;s/"/\\"/g;s/<.*.> //;s/^.*$$/\"&\\n\"/' \
131                 "$(top_srcdir)/AUTHORS" && \
132         echo ";") >> "$@.tmp"
133         $(AM_V_at)mv -f -- "$@.tmp" "$@"
134
135 ###############################################################################
136 # pkg-config integration
137 ###############################################################################
138
139 pkgconfigdir = $(libdir)/pkgconfig
140 pkgconfig_DATA = vlc-plugin.pc
141 CLEANFILES += $(pkgconfig_DATA)
142
143 .pc.in.pc: $(top_builddir)/config.status
144         $(AM_V_GEN)cd "$(top_builddir)" && \
145         $(SHELL) ./config.status --file="src/$@"
146
147 ##############################################################################
148 # Windows resource files
149 ##############################################################################
150
151 if HAVE_WIN32
152 noinst_DATA = libvlc_win32_rc.rc
153 endif
154 EXTRA_DIST += libvlc_win32_rc.rc.in
155
156 .rc.in.rc: $(top_builddir)/config.status
157         cd "$(top_builddir)" && \
158         $(SHELL) ./config.status --file="src/$@"
159
160 ###############################################################################
161 # Building libvlc
162 ###############################################################################
163
164 lib_LTLIBRARIES = libvlccore.la
165
166 AM_CPPFLAGS = $(INCICONV) $(IDN_CFLAGS) \
167         -DMODULE_STRING=\"core\" \
168         -DLOCALEDIR=\"$(localedir)\" \
169         -DPKGDATADIR=\"$(vlcdatadir)\" \
170         -DPKGLIBDIR=\"$(vlclibdir)\"
171 AM_CFLAGS = $(CFLAGS_libvlccore)
172 if HAVE_DYNAMIC_PLUGINS
173 AM_CPPFLAGS += -DHAVE_DYNAMIC_PLUGINS
174 endif
175 if HAVE_DBUS
176 AM_CPPFLAGS += -DHAVE_DBUS
177 AM_CFLAGS += $(DBUS_CFLAGS)
178 endif
179
180 libvlccore_la_SOURCES = $(SOURCES_libvlc)
181 libvlccore_la_LDFLAGS = \
182         $(LDFLAGS_libvlccore) \
183         -no-undefined \
184         -export-symbols $(srcdir)/libvlccore.sym \
185         -version-info 8:0:0
186 libvlccore_la_LIBADD = $(LIBS_libvlccore) \
187         ../compat/libcompat.la \
188         $(LTLIBINTL) $(LTLIBICONV) \
189         $(IDN_LIBS) $(LIBPTHREAD) $(SOCKET_LIBS) $(LIBDL) $(LIBM)
190 libvlccore_la_DEPENDENCIES = libvlccore.sym
191 if HAVE_WIN32
192 libvlccore_la_DEPENDENCIES += libvlc_win32_rc.$(OBJEXT)
193 libvlccore_la_LDFLAGS += -Wl,libvlc_win32_rc.$(OBJEXT) -avoid-version \
194                                                  -Wc,--static -Wc,-static-libgcc
195 endif
196 if HAVE_OS2
197 libvlccore_la_LDFLAGS += -avoid-version
198 endif
199 if HAVE_DBUS
200 libvlccore_la_LIBADD += $(DBUS_LIBS)
201 endif
202
203 libvlc_win32_rc.$(OBJEXT): libvlc_win32_rc.rc
204         $(WINDRES) --include-dir $(top_srcdir)/share --include-dir $(top_srcdir)/extras/package/win32 -i $< -o $@
205
206 EXTRA_libvlccore_la_SOURCES = \
207         $(SOURCES_libvlc_darwin) \
208         $(SOURCES_libvlc_android) \
209         $(SOURCES_libvlc_linux) \
210         $(SOURCES_libvlc_win32) \
211         $(SOURCES_libvlc_os2) \
212         $(SOURCES_libvlc_other) \
213         $(SOURCES_libvlc_httpd) \
214         $(SOURCES_libvlc_sout) \
215         $(SOURCES_libvlc_vlm) \
216         $(NULL)
217 if HAVE_DARWIN
218 libvlccore_la_SOURCES += $(SOURCES_libvlc_darwin)
219 else
220 if HAVE_ANDROID
221 libvlccore_la_SOURCES += $(SOURCES_libvlc_android)
222 else
223 if HAVE_LINUX
224 libvlccore_la_SOURCES += $(SOURCES_libvlc_linux)
225 else
226 if HAVE_WIN32
227 libvlccore_la_SOURCES += $(SOURCES_libvlc_win32)
228 else
229 if HAVE_SYMBIAN
230 #libvlccore_la_SOURCES += $(SOURCES_libvlc_symbian)
231 else
232 if HAVE_OS2
233 libvlccore_la_SOURCES += $(SOURCES_libvlc_os2)
234 else
235 libvlccore_la_SOURCES += $(SOURCES_libvlc_other)
236 endif
237 endif
238 endif
239 endif
240 endif
241 endif
242 if BUILD_HTTPD
243 libvlccore_la_SOURCES += $(SOURCES_libvlc_httpd)
244 endif
245 if ENABLE_SOUT
246 libvlccore_la_SOURCES += $(SOURCES_libvlc_sout)
247 if ENABLE_VLM
248 libvlccore_la_SOURCES += $(SOURCES_libvlc_vlm)
249 endif
250 endif
251
252 SOURCES_libvlc_darwin = \
253         darwin/dirs.c \
254         posix/filesystem.c \
255         posix/plugin.c \
256         darwin/thread.c \
257         posix/timer.c \
258         darwin/specific.c \
259         posix/rand.c \
260         darwin/error.c \
261         darwin/netconf.c \
262         $(NULL)
263
264 SOURCES_libvlc_android = \
265         android/dirs.c \
266         android/thread.c \
267         android/error.c \
268         posix/filesystem.c \
269         android/netconf.c \
270         posix/plugin.c \
271         posix/timer.c \
272         posix/linux_cpu.c \
273         posix/linux_specific.c \
274         posix/specific.c \
275         posix/rand.c \
276         $(NULL)
277
278 SOURCES_libvlc_linux = \
279         posix/dirs.c \
280         posix/error.c \
281         posix/filesystem.c \
282         posix/netconf.c \
283         posix/plugin.c \
284         posix/thread.c \
285         posix/timer.c \
286         posix/linux_cpu.c \
287         posix/linux_specific.c \
288         posix/specific.c \
289         posix/rand.c \
290         $(NULL)
291
292 SOURCES_libvlc_win32 = \
293         win32/dirs.c \
294         win32/error.c \
295         win32/filesystem.c \
296         win32/netconf.c \
297         win32/plugin.c \
298         win32/thread.c \
299         win32/specific.c \
300         win32/winsock.c \
301         win32/rand.c \
302         $(NULL)
303
304 SOURCES_libvlc_symbian = \
305         symbian/path.cpp \
306         symbian/dirs.c \
307         win32/plugin.c \
308         posix/rand.c \
309         $(NULL)
310
311 SOURCES_libvlc_os2 = \
312         os2/getaddrinfo.c \
313         os2/dirs.c \
314         darwin/error.c \
315         os2/filesystem.c \
316         os2/netconf.c \
317         os2/plugin.c \
318         os2/thread.c \
319         os2/specific.c \
320         os2/rand.c \
321         $(NULL)
322
323 SOURCES_libvlc_other = \
324         posix/dirs.c \
325         posix/error.c \
326         posix/filesystem.c \
327         posix/netconf.c \
328         posix/thread.c \
329         posix/timer.c \
330         posix/plugin.c \
331         posix/specific.c \
332         posix/rand.c \
333         $(NULL)
334
335 SOURCES_libvlc_common = \
336         libvlc.c \
337         libvlc.h \
338         libvlc-module.c \
339         missing.c \
340         revision.c \
341         version.c \
342         interface/dialog.c \
343         interface/interface.c \
344         playlist/playlist_internal.h \
345         playlist/art.c \
346         playlist/art.h \
347         playlist/aout.c \
348         playlist/thread.c \
349         playlist/control.c \
350         playlist/engine.c \
351         playlist/fetcher.c \
352         playlist/fetcher.h \
353         playlist/sort.c \
354         playlist/loadsave.c \
355         playlist/preparser.c \
356         playlist/preparser.h \
357         playlist/tree.c \
358         playlist/item.c \
359         playlist/search.c \
360         playlist/services_discovery.c \
361         input/item.c \
362         input/access.c \
363         input/clock.c \
364         input/control.c \
365         input/decoder.c \
366         input/decoder_synchro.c \
367         input/demux.c \
368         input/es_out.c \
369         input/es_out_timeshift.c \
370         input/event.c \
371         input/input.c \
372         input/info.h \
373         input/meta.c \
374         input/access.h \
375         input/clock.h \
376         input/decoder.h \
377         input/demux.h \
378         input/es_out.h \
379         input/es_out_timeshift.h \
380         input/event.h \
381         input/item.h \
382         input/stream.h \
383         input/input_internal.h \
384         input/input_interface.h \
385         input/vlm_internal.h \
386         input/vlm_event.h \
387         input/resource.h \
388         input/resource.c \
389         input/stats.c \
390         input/stream.c \
391         input/stream_demux.c \
392         input/stream_filter.c \
393         input/stream_memory.c \
394         input/subtitles.c \
395         input/var.c \
396         video_output/chrono.h \
397         video_output/control.c \
398         video_output/control.h \
399         video_output/display.c \
400         video_output/display.h \
401         video_output/event.h \
402         video_output/inhibit.c \
403         video_output/inhibit.h \
404         video_output/interlacing.c \
405         video_output/interlacing.h \
406         video_output/snapshot.c \
407         video_output/snapshot.h \
408         video_output/statistic.h \
409         video_output/video_output.c \
410         video_output/video_text.c \
411         video_output/video_epg.c \
412         video_output/video_widgets.c \
413         video_output/vout_subpictures.c \
414         video_output/window.c \
415         video_output/window.h \
416         video_output/opengl.c \
417         video_output/vout_intf.c \
418         video_output/vout_internal.h \
419         video_output/vout_control.h \
420         video_output/vout_wrapper.c \
421         audio_output/aout_internal.h \
422         audio_output/common.c \
423         audio_output/dec.c \
424         audio_output/filters.c \
425         audio_output/output.c \
426         audio_output/volume.c \
427         network/getaddrinfo.c \
428         network/io.c \
429         network/tcp.c \
430         network/udp.c \
431         network/rootbind.c \
432         network/tls.c \
433         text/charset.c \
434         text/strings.c \
435         text/unicode.c \
436         text/url.c \
437         text/filesystem.c \
438         text/iso_lang.c \
439         text/iso-639_def.h \
440         misc/md5.c \
441         misc/probe.c \
442         misc/rand.c \
443         misc/mtime.c \
444         misc/block.c \
445         misc/fifo.c \
446         misc/fourcc.c \
447         misc/fourcc_list.h \
448         misc/es_format.c \
449         misc/picture.c \
450         misc/picture.h \
451         misc/picture_fifo.c \
452         misc/picture_pool.c \
453         modules/modules.h \
454         modules/modules.c \
455         modules/bank.c \
456         modules/cache.c \
457         modules/entry.c \
458         modules/textdomain.c \
459         misc/threads.c \
460         misc/cpu.c \
461         misc/epg.c \
462         misc/exit.c \
463         config/configuration.h \
464         config/core.c \
465         config/chain.c \
466         config/file.c \
467         config/help.c \
468         config/intf.c \
469         config/keys.c \
470         config/cmdline.c \
471         config/getopt.c \
472         config/vlc_getopt.h \
473         misc/events.c \
474         misc/image.c \
475         misc/messages.c \
476         misc/mime.c \
477         misc/objects.c \
478         misc/variables.h \
479         misc/variables.c \
480         misc/error.c \
481         misc/update.h \
482         misc/update.c \
483         misc/update_crypto.c \
484         misc/xml.c \
485         extras/libc.c \
486         extras/tdestroy.c \
487         misc/addons.c \
488         misc/filter.c \
489         misc/filter_chain.c \
490         misc/http_auth.c \
491         misc/httpcookies.c \
492         misc/fingerprinter.c \
493         misc/text_style.c \
494         misc/subpicture.c \
495         misc/subpicture.h \
496         $(NULL)
497
498 SOURCES_libvlc_httpd = \
499         network/httpd.c \
500         $(NULL)
501
502 SOURCES_libvlc_sout = \
503         stream_output/stream_output.c \
504         stream_output/stream_output.h \
505         stream_output/sap.c \
506         stream_output/sdp.c \
507         $(NULL)
508
509 SOURCES_libvlc_vlm = \
510         input/vlm.c \
511         input/vlm_event.c \
512         input/vlmshell.c \
513         $(NULL)
514
515 SOURCES_libvlc = \
516         $(SOURCES_libvlc_common) \
517         $(NULL)
518
519 # FourCC tables
520 BUILT_SOURCES += fourcc_tables.h
521 EXTRA_DIST += misc/fourcc_gen.c
522 MOSTLYCLEANFILES = fourcc_gen
523
524 fourcc_gen: misc/fourcc_gen.c misc/fourcc_list.h ../include/vlc_fourcc.h
525         $(AM_V_at)rm -f -- $@
526         $(AM_V_CC)$(BUILDCC) -I$(srcdir) -o $@ $<
527
528 fourcc_tables.h: fourcc_gen
529         $(AM_V_at)rm -f -- $@.tmp
530         $(AM_V_GEN)$(builddir)/fourcc_gen > $@.tmp
531         $(AM_V_at)mv -f -- $@.tmp $@
532
533 # Unit/regression tests
534 #
535 check_PROGRAMS = \
536         test_block \
537         test_dictionary \
538         test_i18n_atof \
539         test_md5 \
540         test_picture_pool \
541         test_timer \
542         test_url \
543         test_utf8 \
544         test_xmlent \
545         test_headers
546
547 TESTS = $(check_PROGRAMS)
548
549 test_block_SOURCES = test/block_test.c
550 test_block_LDADD = $(LDADD) $(LIBS_libvlccore)
551 test_block_DEPENDENCIES =
552
553 test_dictionary_SOURCES = test/dictionary.c
554 test_i18n_atof_SOURCES = test/i18n_atof.c
555 test_md5_SOURCES = test/md5.c
556 test_picture_pool_SOURCES = test/picture_pool.c
557 test_timer_SOURCES = test/timer.c
558 test_url_SOURCES = test/url.c
559 test_utf8_SOURCES = test/utf8.c
560 test_xmlent_SOURCES = test/xmlent.c
561 test_headers_SOURCES = test/headers.c
562
563 AM_LDFLAGS = -no-install
564 LDADD = libvlccore.la \
565         ../compat/libcompat.la
566
567 ###############################################################################
568 # GIT revision
569 ###############################################################################
570
571 BUILT_SOURCES += stamp-revision
572 MAINTAINERCLEANFILES = $(srcdir)/revision.txt $(srcdir)/revision.c
573
574 $(srcdir)/revision.c: $(srcdir)/revision.txt
575         $(AM_V_at)rm -f -- $@
576         $(AM_V_GEN)echo "const char psz_vlc_changeset[] = \"$$(cat $<)\";" \
577                 > $@
578
579 $(srcdir)/revision.txt:
580         $(AM_V_at)$(MAKE) stamp-revision
581         $(AM_V_GEN)touch $@
582
583 stamp-revision:
584         $(AM_V_at)rm -f -- revision.tmp
585         $(AM_V_GEN)if ! git \
586                         --git-dir="$(top_srcdir)/.git/" describe \
587                         --tags --long --match '?.*.*' --always; then \
588                 cat $(srcdir)/revision.txt ; \
589         fi > revision.tmp
590         $(AM_V_at)if diff revision.tmp $(srcdir)/revision.txt >/dev/null 2>&1; then \
591                 rm -f -- revision.tmp; \
592         else \
593                 mv -f -- revision.tmp $(srcdir)/revision.txt; \
594         fi
595 #2>&1
596
597 ###############################################################################
598 # Unit/regression test
599 ###############################################################################
600
601 dist_check_SCRIPTS = check_headers
602
603 check-local:
604         for h in `echo $(pkginclude_HEADERS) | sed -e s,\.\./include/,,g`; \
605         do \
606                 echo grep - "#include <$$h>" $(srcdir)/test/headers.c ; \
607                 if ! grep -- "#include <$$h>" $(srcdir)/test/headers.c ; \
608                 then \
609                         echo "Header $$h not included in test/headers.c!"; \
610                         exit 1; \
611                 fi ; \
612         done
613         $(SHELL) $(srcdir)/check_headers $(pluginsinclude_HEADERS)
614
615 FORCE:
616         @echo "Generated source cannot be phony. Go away." >&2
617         @exit 1
618
619 .PHONY: FORCE