Browse Source

modules: add SUBDIRS support for vlc_modules_list generation

Move the vlc_modules_list generation logic to a shared modulelist.mk file
that can be included by both modules/Makefile.am and modules/gui/qt/Makefile.am.

Now each directory generates its own vlc_modules_list using LTLIBRARIES,
and the parent concatenates lists from SUBDIRS.
pull/199/head
Alexandre Janniaux 2 months ago
committed by Felix Paul Kühne
parent
commit
0e01acb9fc
  1. 20
      modules/Makefile.am
  2. 30
      modules/modulelist.mk

20
modules/Makefile.am

@ -127,22 +127,6 @@ SUFFIXES += -client-protocol.h -protocol.c .xml
$(AM_V_GEN)$(WAYLAND_SCANNER) private-code < "$^" > "$@.tmp" $(AM_V_GEN)$(WAYLAND_SCANNER) private-code < "$^" > "$@.tmp"
$(AM_V_at)mv -f -- "$@.tmp" "$@" $(AM_V_at)mv -f -- "$@.tmp" "$@"
# Remove the non-plugins, it needs intermediate steps because # Generate vlc_modules_list (local plugins + SUBDIRS)
# we can only replace and not match inverse. Instead we; include modulelist.mk
# 1/ replace plugins .la targets by plugins names
# 2/ remove every word which is a .la target (ie. non-plugins)
# 3/ rename every plugin name back into the target name
ALL_TARGETS_PLUGIN_RENAMED := $(LTLIBRARIES:lib%_plugin.la=%_plugin)
PLUGINS_NAMES := $(ALL_TARGETS_PLUGIN_RENAMED:%.la=)
# Generate a list containing the name and path of every plugin being built
# Format: plugin_name: relative/path/to/plugin.dylib
# This allows plugins from SUBDIRS (like Qt) to specify their actual location
vlc_modules_list: Makefile
$(AM_V_GEN)rm -f $@.tmp; for plugin in $(PLUGINS_NAMES); do \
printf "$${plugin}: $(subdir)/.libs/lib$${plugin}.dylib\n" >> $@.tmp; done
mv $@.tmp $@
BUILT_SOURCES += vlc_modules_list
CLEANFILES += vlc_modules_list
SUBDIRS += . SUBDIRS += .

30
modules/modulelist.mk

@ -0,0 +1,30 @@
# modulelist.mk - Generate vlc_modules_list from LTLIBRARIES and SUBDIRS
# Paths are relative to top_builddir using automake's $(subdir)
# Remove the non-plugins, it needs intermediate steps because
# we can only replace and not match inverse. Instead we:
# 1/ replace plugins .la targets by plugins names
# 2/ remove every word which is a .la target (ie. non-plugins)
# 3/ rename every plugin name back into the target name
VLC_PLUGINS_RENAMED = $(LTLIBRARIES:lib%_plugin.la=%_plugin)
VLC_PLUGINS = $(VLC_PLUGINS_RENAMED:%.la=)
# Generate a list containing the name and path of every plugin being built
# Format: plugin_name: relative/path/to/plugin$(LIBEXT)
# This allows plugins from SUBDIRS (like Qt) to specify their actual location
# The recipee concatenates records from local plugins and those from SUBDIRS
vlc_modules_list: Makefile
$(AM_V_GEN)rm -f $@.tmp; \
for plugin in $(VLC_PLUGINS); do \
printf "$${plugin}: $(subdir)/.libs/lib$${plugin}$(LIBEXT)\n" >> $@.tmp; \
done; \
for subdir in $(SUBDIRS); do \
[ "$$subdir" = "." ] && continue; \
[ -f "$$subdir/vlc_modules_list" ] && \
cat "$$subdir/vlc_modules_list" >> $@.tmp; \
done; \
if [ -s "$@.tmp" ]; then mv $@.tmp $@; else rm -f $@.tmp && touch $@; fi
BUILT_SOURCES += vlc_modules_list
CLEANFILES += vlc_modules_list
Loading…
Cancel
Save