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