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