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