# Common code for VLC modules/.../Makefile.am
#
# Copyright (C) 2005-2007 the VideoLAN team
# Copyright (C) 2005-2008 Rémi Denis-Courmont
#
# Authors: Sam Hocevar <sam@zoy.org>

NULL =
libvlcdir = $(vlclibdir)/plugins/$(basedir)
EXTRA_DIST = Modules.am
BUILT_SOURCES =
CLEANFILES = $(BUILT_SOURCES)

LTLIBVLCCORE = $(top_builddir)/src/libvlccore.la

# Module name from object or executable file name.
MODULE_NAME = `p="$@"; p="$${p\#\#*/}"; p="$${p\#lib}"; echo "$${p%_plugin*}"`

AM_CPPFLAGS = \
	-DMODULE_NAME=$(MODULE_NAME) \
	-DMODULE_NAME_IS_$(MODULE_NAME) \
	-DMODULE_STRING=\"$(MODULE_NAME)\"
if HAVE_DYNAMIC_PLUGINS
AM_CPPFLAGS += -D__PLUGIN__
endif
AM_CFLAGS =
AM_CXXFLAGS =
AM_OBJCFLAGS =
AM_LDFLAGS = -rpath '$(libvlcdir)' \
	-avoid-version -module \
	-export-symbols-regex ^vlc_entry \
	-shrext $(LIBEXT) \
	-no-undefined
AM_LIBADD = $(LTLIBVLCCORE) $(top_builddir)/compat/libcompat.la $(LIBS_plugin)

include $(srcdir)/Modules.am

if MAINTAINER_MODE
$(srcdir)/Makefile.am: $(srcdir)/Modules.am $(top_srcdir)/modules/genmf
	$(AM_V_GEN)cd \$(top_srcdir) && \$(SHELL) modules/genmf $(dir)
endif
