]> git.sesse.net Git - vlc/blob - modules/common.am
modules: use different directory prefixes for each plugins subdirectory
[vlc] / modules / common.am
1 # Common code for VLC modules/.../Makefile.am
2 #
3 # Copyright (C) 2005-2007 the VideoLAN team
4 # Copyright (C) 2005-2008 RĂ©mi Denis-Courmont
5 #
6 # Authors: Sam Hocevar <sam@zoy.org>
7
8 AUTOMAKE_OPTIONS = subdir-objects
9
10 NULL =
11 pluginsdir = $(vlclibdir)/plugins
12 BUILT_SOURCES =
13 CLEANFILES = $(BUILT_SOURCES)
14
15 LTLIBVLCCORE = $(top_builddir)/src/libvlccore.la
16
17 # Module name from object or executable file name.
18 MODULE_NAME = $$(p="$@"; p="$${p\#\#*/}"; p="$${p\#lib}"; echo "$${p%_plugin*}")
19
20 AM_CPPFLAGS = \
21         -DMODULE_NAME_IS_$(MODULE_NAME) \
22         -DMODULE_STRING=\"$(MODULE_NAME)\"
23 if HAVE_DYNAMIC_PLUGINS
24 AM_CPPFLAGS += -D__PLUGIN__
25 else
26 AM_CPPFLAGS += -DMODULE_NAME=$(MODULE_NAME)
27 endif
28 AM_CFLAGS =
29 AM_CXXFLAGS =
30 AM_OBJCFLAGS =
31 AM_LIBADD = $(LIBPTHREAD)
32 AM_LDFLAGS = \
33         -avoid-version -module \
34         -export-symbols-regex ^vlc_entry \
35         -shrext $(LIBEXT) \
36         -no-undefined \
37         $(LTLIBVLCCORE) $(top_builddir)/compat/libcompat.la
38
39 if HAVE_WIN32
40 AM_LDFLAGS += -Wl,lib$(MODULE_NAME)_plugin.rc.$(OBJEXT)
41
42 $(top_builddir)/modules/module.rc: $(top_builddir)/modules/module.rc.in $(top_builddir)/config.status
43         $(AM_V_GEN) cd "$(top_builddir)" && $(SHELL) ./config.status --file="modules/module.rc"
44
45 lib%_plugin.rc.$(OBJEXT): $(top_builddir)/modules/module.rc
46         $(AM_V_GEN) $(WINDRES) -DMODULE_NAME=\\\"$(MODULE_NAME)\\\" --include-dir $(top_srcdir)/share --include-dir $(top_srcdir)/extras/package/win32 -i $< -o $@
47 endif