common.am 1.33 KB
Newer Older
1 2 3 4 5 6 7
# 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>

8 9
AUTOMAKE_OPTIONS = subdir-objects

10
NULL =
11
pluginsdir = $(vlclibdir)/plugins
12
BUILT_SOURCES =
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
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_STRING=\"$(MODULE_NAME)\"
Rafaël Carré's avatar
Rafaël Carré committed
22
if HAVE_DYNAMIC_PLUGINS
23
AM_CPPFLAGS += -D__PLUGIN__
24 25
else
AM_CPPFLAGS += -DMODULE_NAME=$(MODULE_NAME)
26
endif
27 28 29
AM_CFLAGS =
AM_CXXFLAGS =
AM_OBJCFLAGS =
30
AM_LIBADD = $(LIBPTHREAD)
31
AM_LDFLAGS = \
32
	-avoid-version -module \
33
	-export-symbols-regex ^vlc_entry \
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
34
	-shrext $(LIBEXT) \
35 36
	-no-undefined \
	$(LTLIBVLCCORE) $(top_builddir)/compat/libcompat.la
37 38 39 40 41 42 43 44 45 46

if HAVE_WIN32
AM_LDFLAGS += -Wl,lib$(MODULE_NAME)_plugin.rc.$(OBJEXT)

$(top_builddir)/modules/module.rc: $(top_builddir)/modules/module.rc.in $(top_builddir)/config.status
	$(AM_V_GEN) cd "$(top_builddir)" && $(SHELL) ./config.status --file="modules/module.rc"

lib%_plugin.rc.$(OBJEXT): $(top_builddir)/modules/module.rc
	$(AM_V_GEN) $(WINDRES) -DMODULE_NAME=\\\"$(MODULE_NAME)\\\" --include-dir $(top_srcdir)/share --include-dir $(top_srcdir)/extras/package/win32 -i $< -o $@
endif