diff options
author | methodus <methodus@web.de> | 2012-10-29 23:06:45 +0100 |
---|---|---|
committer | methodus <methodus@web.de> | 2012-10-29 23:06:45 +0100 |
commit | a81d4ba071a41e76345ea8434c61698e2b29ba88 (patch) | |
tree | ea195d98a40e5a85b5d145bcdf78c2bbd338bd52 | |
parent | 3381403479340a23468a5a30665e7f866a8bf749 (diff) | |
download | vdr-plugin-upnp-a81d4ba071a41e76345ea8434c61698e2b29ba88.tar.gz vdr-plugin-upnp-a81d4ba071a41e76345ea8434c61698e2b29ba88.tar.bz2 |
Added missing makefile files and the INSTALL file.
-rw-r--r-- | HISTORY | 3 | ||||
-rw-r--r-- | INSTALL | 14 | ||||
-rw-r--r-- | Make.config | 56 | ||||
-rw-r--r-- | Makefile.plugins | 70 |
4 files changed, 143 insertions, 0 deletions
@@ -1,6 +1,9 @@ VDR Plugin 'upnp' Revision History ---------------------------------- + - New: Makefiles reviewed and almost completely rewritten to avoid + redundancies. + Thanks to Lucian Muresan - New: plugin makefile now links against the full file of the upnp plugin so-file. This makes symbolic link against the .so obsolete. Thanks to Lars Hanisch @@ -0,0 +1,14 @@ +- unpack as usually inside the PLUGINS dir of the VDR version against you want to build +- building the subplugins requires the main plugin to be already installed on the target +system, therefore you should execute the following sequence: + +make +make install +make subplugins +make install-subplugins + + - of course, executing the "install*" targets directly will build the binaries first... + - for building / installing just certain subplugins explicitely, just change to their + respective directories and execute 'make' / 'make install' there; + + - further targets are remove & remove-subplugins
\ No newline at end of file diff --git a/Make.config b/Make.config new file mode 100644 index 0000000..245f50b --- /dev/null +++ b/Make.config @@ -0,0 +1,56 @@ +# +# Makefile for a Video Disk Recorder plugin +# +# $Id$ + +# The official name of this plugin. +# This name will be used in the '-P...' option of VDR to load the plugin. +# By default the main source file also carries this name. +# IMPORTANT: the presence of this macro is important for the Make.config +# file. So it must be defined, even if it is not used here! +# +PLUGIN = upnp + +### The sources root build directory as seen by the called (to be overrideable by it) + +ROOTBUILDDIR ?= $(shell pwd) + +### The version number of this plugin (taken from the main source file): + +VERSION = $(shell grep 'static const char \*VERSION *=' $(ROOTBUILDDIR)/$(PLUGIN).h | awk '{ print $$6 }' | sed -e 's/[";]//g') + +### If you do not want to strip binaries on installing, you may comment this: +PRESTRIP = -s + +### The C++ compiler and options: + +CXX ?= g++ +ECPPC ?= ecppc +CXXFLAGS ?= -g -O3 -Wall -Werror=overloaded-virtual -Wno-parentheses -fPIC + +### The directory environment: + +VDRDIR ?= $(ROOTBUILDDIR)/../../.. +VDRINCDIR ?= $(VDRDIR) +VDRPLUGINLIBDIR ?= /usr/lib/vdr/plugins +VDRCFGDIR ?= /etc/vdr/plugins/$(PLUGIN) +VDRRESDIR ?= /usr/share/vdr/$(PLUGIN) +LIBDIR ?= $(ROOTBUILDDIR)/../../lib +TMPDIR ?= /tmp + +PLUGINDIR= ./PLUGINS + +### The version number of VDR's plugin API (taken from VDR's "config.h"): + +APIVERSION = $(shell sed -ne '/define APIVERSION/s/^.*"\(.*\)".*$$/\1/p' $(VDRDIR)/config.h) + +### Includes and Defines (add further entries here): + +INCLUDES += -I$(VDRDIR)/include + +DEFINES += -D_GNU_SOURCE -DPLUGIN_NAME_I18N='"$(PLUGIN)"' +DEFINES += -DPLUGINDIR=\"$(VDRPLUGINLIBDIR)\" + + +# export to subplugins makefiles: +export PRESTRIP VERSION APIVERSION INCLUDES SHAREDDEFINES SHAREDLIBS CXX CXXFLAGS VDRDIR VDRINCDIR LIBDIR TMPDIR VDRPLUGINLIBDIR diff --git a/Makefile.plugins b/Makefile.plugins new file mode 100644 index 0000000..34de307 --- /dev/null +++ b/Makefile.plugins @@ -0,0 +1,70 @@ +# +# UPnP/DLNA subplugins Makefile +# +# This code is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This code is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Or, point your browser to http://www.gnu.org/copyleft/gpl.html + +### Includes and Defines + +SINCLUDES += -I../../../include +SINCLUDES += $(shell echo "$(INCLUDES)" | sed -e 's+-I *+-I+g' | sed -e 's+-I\([^/]\)+-I../../\1+g') + +-include Makefile + +UPNPAPIVERSION = $(shell sed -ne '/define UPNPPLUGIN_VERSION/s/^.*"\(.*\)".*$$/\1/p' ../../../include/plugin.h) + +### The version number of the subplugin (taken from the main source file): +SUBPLUGVERSION = $(shell grep 'static const char \*VERSION *=' $(SUBPLUGIN)$(CATEGORY).cpp | awk '{ print $$6 }' | sed -e 's/[";]//g') + +DEFINES += -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE + +LIBS += -L$(LIBDIR) -Wl,-R$(LIBDIR) $(VDRPLUGINLIBDIR)/libvdr-upnp.so.$(APIVERSION) + +# Dependencies: + +MAKEDEP = g++ -MM -MG +DEPFILE = .dependencies +$(DEPFILE): $(OBJS:%.o=%.cpp) $(wildcard *.h) + @$(MAKEDEP) $(DEFINES) $(SHAREDDEFINES) $(SINCLUDES) $(OBJS:%.o=%.cpp) > $@ + +-include $(DEPFILE) + +### Targets: + +LIBUPNP = libupnp-$(shell echo $(TARGET) | awk '{print tolower($$0)}').so +LIBUPNPVER = $(LIBUPNP).$(UPNPAPIVERSION)-$(APIVERSION) + +BUILDTARGETS = $(LIBDIR)/$(LIBUPNPVER) + +_all: $(BUILDTARGETS) +.PHONY: clean dist + +%.o: %.cpp + $(CXX) $(CXXFLAGS) -c $(DEFINES) $(SHAREDDEFINES) $(SINCLUDES) $< + +$(LIBUPNP): $(OBJS) + $(CXX) $(CXXFLAGS) -shared $(OBJS) $(LIBS) $(SHAREDLIBS) -o $@ + +$(LIBDIR)/$(LIBUPNPVER): $(LIBUPNP) + @cp -p $< $@ + +_clean: + @-rm -f $(OBJS) $(CLEAN_RM) $(DEPFILE) $(LIBUPNP) $(LIBDIR)/$(LIBUPNPVER) core* *~ + +_install: all + install -m 755 -o root -g root $(PRESTRIP) $(LIBDIR)/$(LIBUPNPVER) $(VDRPLUGINLIBDIR) + +_uninstall: + rm $(VDRPLUGINLIBDIR)/$(LIBUPNPVER) |