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