summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile61
-rw-r--r--plugins/profiler/vdrDVBProfiler/Makefile62
-rw-r--r--plugins/provider/recProvider/Makefile62
-rw-r--r--plugins/provider/vdrProvider/Makefile62
4 files changed, 75 insertions, 172 deletions
diff --git a/Makefile b/Makefile
index 71adef3..9027284 100644
--- a/Makefile
+++ b/Makefile
@@ -9,51 +9,26 @@
# 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 version number of this plugin (taken from the main source file):
+### our common config
-VERSION = $(shell grep 'static const char \*VERSION *=' $(PLUGIN).h | awk '{ print $$6 }' | sed -e 's/[";]//g')
-
-### The C++ compiler and options:
-
-CXX ?= g++
-ECPPC ?= ecppc
-CXXFLAGS ?= -g -O3 -Wall -Werror=overloaded-virtual -Wno-parentheses
-
-### The directory environment:
-
-VDRDIR ?= ../../..
-LIBDIR ?= ../../lib
-TMPDIR ?= /tmp
-
-PLUGINDIR= ./PLUGINS
-PLUGINLIBDIR= /usr/lib/vdr/plugins/upnp
+-include Make.config
### Make sure that necessary options are included:
-include $(VDRDIR)/Make.global
+-include $(VDRDIR)/Make.global
-### Allow user defined options to overwrite defaults:
+### Allow user defined VDR options to overwrite defaults:
-include $(VDRDIR)/Make.config
-### 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)
+SUBPLUGDIR ?= ./plugins
### The name of the distribution archive:
ARCHIVE = $(PLUGIN)-$(VERSION)
PACKAGE = vdr-$(ARCHIVE)
-### Includes and Defines (add further entries here):
-
-INCLUDES += -I$(VDRDIR)/include
-
-DEFINES += -D_GNU_SOURCE -DPLUGIN_NAME_I18N='"$(PLUGIN)"'
-DEFINES += -DPLUGINDIR=\"$(PLUGINLIBDIR)\"
-
### The object files (add further files here):
TNTOBJ = httptnt/deviceDescription.o \
@@ -80,6 +55,7 @@ OBJS = $(PLUGIN).o \
LIBS += -lupnp -lcxxtools -ltntnet -ltntdb -ldl
+
### The main target:
all: libvdr-$(PLUGIN).so i18n
@@ -132,13 +108,36 @@ libvdr-$(PLUGIN).so: $(OBJS)
$(CXX) $(CXXFLAGS) $(LDFLAGS) -rdynamic -shared $(OBJS) $(LIBS) -o $@
@cp --remove-destination $@ $(LIBDIR)/$@.$(APIVERSION)
+install: all
+ @mkdir -p $(VDRPLUGINLIBDIR)
+ @mkdir -p $(VDRCFGDIR)
+# @mkdir -p $(VDRRESDIR)
+ install -m 755 -o root -g root $(PRESTRIP) $(LIBDIR)/libvdr-$(PLUGIN).so.$(APIVERSION) $(VDRPLUGINLIBDIR)
+ cp --remove-destination --recursive httpdocs $(VDRCFGDIR)
+
+uninstall:
+ rm --recursive $(VDRPLUGINLIBDIR)/libvdr-$(PLUGIN).so.$(APIVERSION)
+# rm --recursive $(VDRCFGDIR)/httpdocs
+
dist: $(I18Npo) clean
@-rm -rf $(TMPDIR)/$(ARCHIVE)
@mkdir $(TMPDIR)/$(ARCHIVE)
@cp -a * $(TMPDIR)/$(ARCHIVE)
- @tar czf $(PACKAGE).tgz -C $(TMPDIR) --exclude debian --exclude CVS --exclude .svn $(ARCHIVE)
+ @tar czf $(PACKAGE).tgz -C $(TMPDIR) --exclude debian --exclude CVS --exclude .svn --exclude .git --exclude .gitignore $(ARCHIVE)
@-rm -rf $(TMPDIR)/$(ARCHIVE)
@echo Distribution package created as $(PACKAGE).tgz
clean:
@-rm -f $(OBJS) $(DEPFILE) *.so *.so.$(APIVERSION) *.tgz core* *~ $(PODIR)/*.mo $(PODIR)/*.pot
+
+clean-subplugins:
+ @for i in `ls -A -I ".*" $(SUBPLUGDIR)`; do for j in `ls -A -I ".*" $(SUBPLUGDIR)/$$i`; do $(MAKE) -f ../../../Makefile.plugins -C "$(SUBPLUGDIR)/$$i/$$j" clean; done; done
+
+subplugins:
+ @for i in `ls -A -I ".*" $(SUBPLUGDIR)`; do for j in `ls -A -I ".*" $(SUBPLUGDIR)/$$i`; do $(MAKE) -f ../../../Makefile.plugins -C "$(SUBPLUGDIR)/$$i/$$j" all || exit 1; done; done
+
+install-subplugins:
+ @for i in `ls -A -I ".*" $(SUBPLUGDIR)`; do for j in `ls -A -I ".*" $(SUBPLUGDIR)/$$i`; do $(MAKE) -f ../../../Makefile.plugins -C "$(SUBPLUGDIR)/$$i/$$j" install || exit 1; done; done
+
+uninstall-subplugins:
+ @for i in `ls -A -I ".*" $(SUBPLUGDIR)`; do for j in `ls -A -I ".*" $(SUBPLUGDIR)/$$i`; do $(MAKE) -f ../../../Makefile.plugins -C "$(SUBPLUGDIR)/$$i/$$j" uninstall; done; done
diff --git a/plugins/profiler/vdrDVBProfiler/Makefile b/plugins/profiler/vdrDVBProfiler/Makefile
index 879edb2..e300fc9 100644
--- a/plugins/profiler/vdrDVBProfiler/Makefile
+++ b/plugins/profiler/vdrDVBProfiler/Makefile
@@ -1,59 +1,27 @@
#
-# Makefile for a UPnP profiler plugin
+# Makefile for a UPnP subplugin
#
# $Id$
#
-#
-# This is the profile of the profiler plugin. It is used
-# to determine how a resource may be accessed.
-#
-PROFILE = dvb
-
-### The version number of this plugin (taken from the main source file):
-
-VERSION = $(shell grep 'static const char \*VERSION *=' $(PROFILE)Profiler.cpp | awk '{ print $$6 }' | sed -e 's/[";]//g')
-
-### The C++ compiler and options:
-
-CXX ?= g++
-CXXFLAGS ?= -g -O3 -Wall -Werror=overloaded-virtual -Wno-parentheses -fPIC
-
-UPNPDIR ?= ../../..
-VDRLIBDIR ?= $(UPNPDIR)/../../lib
-
-APIVERSION = $(shell sed -ne '/define UPNPPLUGIN_VERSION/s/^.*"\(.*\)".*$$/\1/p' $(UPNPDIR)/include/plugin.h)
+SUBPLUGIN = dvb
+CATEGORY = Profiler
+TARGET = $(SUBPLUGIN)-$(CATEGORY)
-VDRDIR ?= $(UPNPDIR)/../../..
-VDRAPIVERSION = $(shell sed -ne '/define APIVERSION/s/^.*"\(.*\)".*$$/\1/p' $(VDRDIR)/config.h)
+OBJS = $(SUBPLUGIN)$(CATEGORY).o
-INCLUDES += -I$(UPNPDIR)/include -I$(VDRDIR)/include
-DEFINES += -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
+ROOTBUILDDIR = ../../..
+-include ../../../Make.config
-OBJS = $(PROFILE)Profiler.o
+all:
+ @$(MAKE) -f ../../../Makefile.plugins -C "$(shell pwd)" _all
-LIBS = -L$(VDRLIBDIR) -Wl,-R$(VDRLIBDIR) $(VDRLIBDIR)/libvdr-upnp.so.$(VDRAPIVERSION)
-
-all: libupnp-$(PROFILE)-profiler.so
-
-### Implicit rules:
-
-%.o: %.cpp
- $(CXX) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) -o $@ $<
-
-### Dependencies:
-
-MAKEDEP = $(CXX) -MM -MG
-DEPFILE = .dependencies
-$(DEPFILE): Makefile
- @$(MAKEDEP) $(DEFINES) $(INCLUDES) $(OBJS:%.o=%.cpp) > $@
+clean:
+ @$(MAKE) -f ../../../Makefile.plugins -C "$(shell pwd)" _clean
--include $(DEPFILE)
+install:
+ @$(MAKE) -f ../../../Makefile.plugins -C "$(shell pwd)" _install
-libupnp-$(PROFILE)-profiler.so: $(OBJS)
- $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared $(OBJS) $(LIBS) -o $@
- @cp --remove-destination $@ $@.$(APIVERSION)
-
-clean:
- @-rm -f $(OBJS) $(DEPFILE) *.so *.so.$(APIVERSION) core* *~
+uninstall:
+ @$(MAKE) -f ../../../Makefile.plugins -C "$(shell pwd)" _uninstall
diff --git a/plugins/provider/recProvider/Makefile b/plugins/provider/recProvider/Makefile
index 95f8f41..ffef840 100644
--- a/plugins/provider/recProvider/Makefile
+++ b/plugins/provider/recProvider/Makefile
@@ -1,59 +1,27 @@
#
-# Makefile for a UPnP provider plugin
+# Makefile for a UPnP subplugin
#
# $Id$
#
-#
-# This is the schema of the provider plugin. It is used
-# to determine how a resource may be accessed.
-#
-SCHEMA = rec
-
-### The version number of this plugin (taken from the main source file):
-
-VERSION = $(shell grep 'static const char \*VERSION *=' $(SCHEMA)Provider.cpp | awk '{ print $$6 }' | sed -e 's/[";]//g')
-
-### The C++ compiler and options:
-
-CXX ?= g++
-CXXFLAGS ?= -g -O3 -Wall -Werror=overloaded-virtual -Wno-parentheses -fPIC
-
-UPNPDIR ?= ../../..
-VDRLIBDIR ?= $(UPNPDIR)/../../lib
-
-APIVERSION = $(shell sed -ne '/define UPNPPLUGIN_VERSION/s/^.*"\(.*\)".*$$/\1/p' $(UPNPDIR)/include/plugin.h)
+SUBPLUGIN = rec
+CATEGORY = Provider
+TARGET = $(SUBPLUGIN)-$(CATEGORY)
-VDRDIR ?= $(UPNPDIR)/../../..
-VDRAPIVERSION = $(shell sed -ne '/define APIVERSION/s/^.*"\(.*\)".*$$/\1/p' $(VDRDIR)/config.h)
+OBJS = $(SUBPLUGIN)$(CATEGORY).o
-INCLUDES += -I$(UPNPDIR)/include -I$(VDRDIR)/include
-DEFINES += -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
+ROOTBUILDDIR = ../../..
+-include ../../../Make.config
-OBJS = $(SCHEMA)Provider.o
+all:
+ @$(MAKE) -f ../../../Makefile.plugins -C "$(shell pwd)" _all
-LIBS = -L$(VDRLIBDIR) -Wl,-R$(VDRLIBDIR) $(VDRLIBDIR)/libvdr-upnp.so.$(VDRAPIVERSION)
-
-all: libupnp-$(SCHEMA)-provider.so
-
-### Implicit rules:
-
-%.o: %.cpp
- $(CXX) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) -o $@ $<
-
-### Dependencies:
-
-MAKEDEP = $(CXX) -MM -MG
-DEPFILE = .dependencies
-$(DEPFILE): Makefile
- @$(MAKEDEP) $(DEFINES) $(INCLUDES) $(OBJS:%.o=%.cpp) > $@
+clean:
+ @$(MAKE) -f ../../../Makefile.plugins -C "$(shell pwd)" _clean
--include $(DEPFILE)
+install:
+ @$(MAKE) -f ../../../Makefile.plugins -C "$(shell pwd)" _install
-libupnp-$(SCHEMA)-provider.so: $(OBJS)
- $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared $(OBJS) $(LIBS) -o $@
- @cp --remove-destination $@ $@.$(APIVERSION)
-
-clean:
- @-rm -f $(OBJS) $(DEPFILE) *.so *.so.$(APIVERSION) core* *~
+uninstall:
+ @$(MAKE) -f ../../../Makefile.plugins -C "$(shell pwd)" _uninstall
diff --git a/plugins/provider/vdrProvider/Makefile b/plugins/provider/vdrProvider/Makefile
index de30380..2e47793 100644
--- a/plugins/provider/vdrProvider/Makefile
+++ b/plugins/provider/vdrProvider/Makefile
@@ -1,59 +1,27 @@
#
-# Makefile for a UPnP provider plugin
+# Makefile for a UPnP subplugin
#
# $Id$
#
-#
-# This is the schema of the provider plugin. It is used
-# to determine how a resource may be accessed.
-#
-SCHEMA = vdr
-
-### The version number of this plugin (taken from the main source file):
-
-VERSION = $(shell grep 'static const char \*VERSION *=' $(SCHEMA)Provider.cpp | awk '{ print $$6 }' | sed -e 's/[";]//g')
-
-### The C++ compiler and options:
-
-CXX ?= g++
-CXXFLAGS ?= -g -O3 -Wall -Werror=overloaded-virtual -Wno-parentheses -fPIC
-
-UPNPDIR ?= ../../..
-VDRLIBDIR ?= $(UPNPDIR)/../../lib
-
-APIVERSION = $(shell sed -ne '/define UPNPPLUGIN_VERSION/s/^.*"\(.*\)".*$$/\1/p' $(UPNPDIR)/include/plugin.h)
+SUBPLUGIN = vdr
+CATEGORY = Provider
+TARGET = $(SUBPLUGIN)-$(CATEGORY)
-VDRDIR ?= $(UPNPDIR)/../../..
-VDRAPIVERSION = $(shell sed -ne '/define APIVERSION/s/^.*"\(.*\)".*$$/\1/p' $(VDRDIR)/config.h)
+OBJS = $(SUBPLUGIN)$(CATEGORY).o
-INCLUDES += -I$(UPNPDIR)/include -I$(VDRDIR)/include
-DEFINES += -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
+ROOTBUILDDIR = ../../..
+-include ../../../Make.config
-OBJS = $(SCHEMA)Provider.o
+all:
+ @$(MAKE) -f ../../../Makefile.plugins -C "$(shell pwd)" _all
-LIBS = -L$(VDRLIBDIR) -Wl,-R$(VDRLIBDIR) $(VDRLIBDIR)/libvdr-upnp.so.$(VDRAPIVERSION)
-
-all: libupnp-$(SCHEMA)-provider.so
-
-### Implicit rules:
-
-%.o: %.cpp
- $(CXX) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) -o $@ $<
-
-### Dependencies:
-
-MAKEDEP = $(CXX) -MM -MG
-DEPFILE = .dependencies
-$(DEPFILE): Makefile
- @$(MAKEDEP) $(DEFINES) $(INCLUDES) $(OBJS:%.o=%.cpp) > $@
+clean:
+ @$(MAKE) -f ../../../Makefile.plugins -C "$(shell pwd)" _clean
--include $(DEPFILE)
+install:
+ @$(MAKE) -f ../../../Makefile.plugins -C "$(shell pwd)" _install
-libupnp-$(SCHEMA)-provider.so: $(OBJS)
- $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared $(OBJS) $(LIBS) -o $@
- @cp --remove-destination $@ $@.$(APIVERSION)
-
-clean:
- @-rm -f $(OBJS) $(DEPFILE) *.so *.so.$(APIVERSION) core* *~
+uninstall:
+ @$(MAKE) -f ../../../Makefile.plugins -C "$(shell pwd)" _uninstall