From 62daedf95e3c00597748006798cc0fd812ebe1b5 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Fri, 21 Dec 2012 10:14:32 +0100 Subject: The plugin Makefiles now have a separate 'install' target --- newplugin | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) (limited to 'newplugin') diff --git a/newplugin b/newplugin index d5aa047b..d9ddba7a 100755 --- a/newplugin +++ b/newplugin @@ -12,7 +12,7 @@ # See the main source file 'vdr.c' for copyright information and # how to reach the author. # -# $Id: newplugin 2.10 2012/12/19 11:03:28 kls Exp $ +# $Id: newplugin 2.11 2012/12/20 13:58:05 kls Exp $ $PLUGIN_NAME = $ARGV[0] || die "Usage: newplugin \n"; @@ -76,9 +76,8 @@ VERSION = \$(shell grep 'static const char \\*VERSION *=' \$(PLUGIN).c | awk '{ # Use package data if installed...otherwise assume we're under the VDR source directory: PKGCFG = \$(if \$(VDRDIR),\$(shell pkg-config --variable=\$(1) \$(VDRDIR)/vdr.pc),\$(shell pkg-config --variable=\$(1) vdr || pkg-config --variable=\$(1) ../../../vdr.pc)) -INCDIR ?= \$(call PKGCFG,includedir) LIBDIR ?= \$(call PKGCFG,libdir) -LOCDIR ?= \$(call PKGCFG,localedir) +LOCDIR ?= \$(call PKGCFG,locdir) # TMPDIR ?= /tmp @@ -96,9 +95,13 @@ APIVERSION = \$(call PKGCFG,apiversion) ARCHIVE = \$(PLUGIN)-\$(VERSION) PACKAGE = vdr-\$(ARCHIVE) +### The name of the shared object file: + +SOFILE = libvdr-\$(PLUGIN).so + ### Includes and Defines (add further entries here): -INCLUDES += -I\$(INCDIR) +INCLUDES += DEFINES += -DPLUGIN_NAME_I18N='"\$(PLUGIN)"' @@ -108,7 +111,7 @@ OBJS = \$(PLUGIN).o ### The main target: -all: libvdr-\$(PLUGIN).so i18n +all: \$(SOFILE) i18n ### Implicit rules: @@ -128,6 +131,7 @@ DEPFILE = .dependencies PODIR = po I18Npo = \$(wildcard \$(PODIR)/*.po) +I18Nmo = \$(addsuffix .mo, \$(foreach file, \$(I18Npo), \$(basename \$(file)))) I18Nmsgs = \$(addprefix \$(LOCDIR)/, \$(addsuffix /LC_MESSAGES/vdr-\$(PLUGIN).mo, \$(notdir \$(foreach file, \$(I18Npo), \$(basename \$(file)))))) I18Npot = \$(PODIR)/\$(PLUGIN).pot @@ -146,13 +150,20 @@ I18Npot = \$(PODIR)/\$(PLUGIN).pot cp \$< \$\@ .PHONY: i18n -i18n: \$(I18Nmsgs) \$(I18Npot) +i18n: \$(I18Nmo) \$(I18Npot) + +install-i18n: \$(I18Nmsgs) ### Targets: -libvdr-\$(PLUGIN).so: \$(OBJS) +\$(SOFILE): \$(OBJS) \$(CXX) \$(CXXFLAGS) \$(LDFLAGS) -shared \$(OBJS) -o \$\@ - \@cp --remove-destination \$\@ \$(LIBDIR)/\$\@.\$(APIVERSION) + +install-lib: \$(SOFILE) + \@mkdir -p \$(LIBDIR) + \@cp --remove-destination \$(SOFILE) \$(LIBDIR)/\$(SOFILE).\$(APIVERSION) + +install: install-lib install-i18n dist: \$(I18Npo) clean \@-rm -rf \$(TMPDIR)/\$(ARCHIVE) @@ -163,7 +174,8 @@ dist: \$(I18Npo) clean \@echo Distribution package created as \$(PACKAGE).tgz clean: - \@-rm -f \$(OBJS) \$(DEPFILE) *.so *.tgz core* *~ \$(PODIR)/*.mo \$(PODIR)/*.pot + \@-rm -f \$(PODIR)/*.mo \$(PODIR)/*.pot + \@-rm -f \$(OBJS) \$(DEPFILE) *.so *.tgz core* *~ }; $MAIN = qq @@ -342,4 +354,3 @@ sub CreateFile print FILE $Content; close(FILE); } - -- cgit v1.2.3