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