common.am 1.34 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}"; p="$${p%_plugin*}"; p="$${p%.lo}"; echo "$$p")
19

20
AM_CPPFLAGS = -DMODULE_STRING=\"$(MODULE_NAME)\"
Rafaël Carré's avatar
Rafaël Carré committed
21
if HAVE_DYNAMIC_PLUGINS
22
AM_CPPFLAGS += -D__PLUGIN__
23 24
else
AM_CPPFLAGS += -DMODULE_NAME=$(MODULE_NAME)
25
endif
26 27 28
AM_CFLAGS =
AM_CXXFLAGS =
AM_OBJCFLAGS =
29
AM_LDFLAGS = \
30
	-avoid-version -module \
31
	-export-symbols-regex ^vlc_entry \
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
32
	-shrext $(LIBEXT) \
33
	-no-undefined \
34
	$(LTLIBVLCCORE) $(top_builddir)/compat/libcompat.la $(LIBPTHREAD)
35 36 37 38 39 40 41 42 43 44

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