3 ## genmf file for the VLC media player
5 ## Copyright (C) 2005-2007 the VideoLAN team
7 ## Authors: Sam Hocevar <sam@zoy.org>
8 ## RĂ©mi Denis-Courmont <rem # videolan # org>
10 cd $
(dirname "$0")/.. ||
exit 1
15 modf
="modules/${dir}/Modules.am"
16 if test ! -f "$modf"; then
17 echo "$modf does not exist!" >&2
20 makf
="modules/${dir}/Makefile.am"
21 basedir
="`echo "${dir}" | cut -f1 -d/`"
22 mods
="`sed -n -e 's/^ *SOURCES_\([^ ]*\).*/\1/p' < "${modf}" | sort | uniq | xargs`"
23 plugins
="`sed -n -e 's/^.*lib\([^ ]*\)_plugin\.la.*/\1/p' < "${modf}" | sort | uniq | xargs`"
24 rm -f "${makf}" && cat > "${makf}" << EOF
25 # ${makf} automatically generated from ${modf} by $0
26 # DO NOT EDIT THIS FILE DIRECTLY! See Modules.am instead.
28 ${basedir}dir = \$(pluginsdir)/${basedir}
29 ${basedir}_LTLIBRARIES =
32 EXTRA_DIST = Modules.am
34 include \$(top_srcdir)/modules/common.am
35 include \$(srcdir)/Modules.am
38 \$(srcdir)/Makefile.am: \$(srcdir)/Modules.am \$(top_srcdir)/modules/genmf
39 \$(AM_V_GEN)cd \\\$(top_srcdir) && \\\$(SHELL) modules/genmf ${dir}
44 cat >> "${makf}" << EOF
46 lib${mod}_plugin_la_SOURCES = \$(SOURCES_${mod})
47 lib${mod}_plugin_la_CPPFLAGS = \$(AM_CPPFLAGS) \$(CPPFLAGS_${mod}) \
48 -DMODULE_NAME_IS_${mod}
49 lib${mod}_plugin_la_CFLAGS = \$(AM_CFLAGS) \$(CFLAGS_${mod})
50 lib${mod}_plugin_la_CXXFLAGS = \$(AM_CXXFLAGS) \$(CXXFLAGS_${mod})
51 lib${mod}_plugin_la_OBJCFLAGS = \$(AM_OBJCFLAGS) \$(OBJCFLAGS_${mod})
52 lib${mod}_plugin_la_LIBADD = \$(LIBS_${mod})
53 lib${mod}_plugin_la_LDFLAGS = \$(AM_LDFLAGS) -rpath '\$(${basedir}dir)' \$(LDFLAGS_${mod})
55 case " ${plugins} " in
59 cat >> "${makf}" << EOF
60 EXTRA_LTLIBRARIES += lib${mod}_plugin.la
61 ${basedir}_LTLIBRARIES += \$(LTLIB${mod})