1 # Common code for VLC modules/.../Makefile.am
3 # Copyright (C) 2005-2007 the VideoLAN team
4 # Copyright (C) 2005-2008 RĂ©mi Denis-Courmont
6 # Authors: Sam Hocevar <sam@zoy.org>
10 libvlcdir = $(libdir)/vlc/$(basedir)
12 EXTRA_DIST = Modules.am
16 include $(srcdir)/Modules.am
19 LTLIBVLC = $(top_builddir)/src/libvlc.la
21 AM_CFLAGS = `$(VLC_CONFIG) --cflags plugin $@`
22 AM_CXXFLAGS = `$(VLC_CONFIG) --cxxflags plugin $@`
23 AM_OBJCFLAGS = `$(VLC_CONFIG) --objcflags plugin $@`
24 AM_LDFLAGS = -rpath '$(libvlcdir)' \
25 -avoid-version -module -no-undefined \
27 `$(VLC_CONFIG) --ldflags plugin $@`
28 AM_LIBADD = $(LTLIBVLC)
30 if HAVE_COMPILER_EXPORT
31 AM_LDFLAGS += -export-dynamic
33 AM_LDFLAGS += -export-symbol-regex ^vlc_entry
40 $(top_builddir)/compile
42 # Find out which modules were enabled and tell make to build them
44 @set fnord $$MAKEFLAGS; amf=$$2; targets=`\
45 z=$$($(VLC_CONFIG) --list plugin); for mod in $(mods); do case "$$z " in *\ $${mod}\ *) echo lib$${mod}_plugin.la;; esac; done; \
46 `; case "$$targets" in *lib*) $(MAKE) $(AM_MAKEFLAGS) $$targets || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; ;; esac; \
50 $(srcdir)/Makefile.am: $(srcdir)/Modules.am $(top_srcdir)/modules/genmf
51 cd \$(top_srcdir) && \$(SHELL) modules/genmf ${dir}
57 ### automake creates libvlcdir after running install-*-local
58 ### so we have to create it ourselves first
59 install-exec-local: all-modules
60 @if test -z "$(libvlc_LTLIBRARIES)"; then \
61 z=$$($(VLC_CONFIG) --list plugin); \
62 m=`for mod in $(mods); do case "$$z " in *\ $${mod}\ *) printf " lib$${mod}_plugin.la" ;; esac; done` ; \
64 $(MAKE) $(AM_MAKEFLAGS) libvlc_LTLIBRARIES="$$m" install-libvlcLTLIBRARIES || exit $$? ; \
68 @if test -z "$(libvlc_LTLIBRARIES)"; then \
69 z=$$($(VLC_CONFIG) --list plugin); \
70 m=`for mod in $(mods); do case "$$z " in *\ $${mod}\ *) printf " lib$${mod}_plugin.la" ;; esac; done` ; \
72 $(MAKE) $(AM_MAKEFLAGS) libvlc_LTLIBRARIES="$$m" uninstall-libvlcLTLIBRARIES || exit $$?; \