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