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