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