summaryrefslogtreecommitdiff
path: root/plugins/provider
diff options
context:
space:
mode:
authormethodus <methodus@web.de>2012-10-29 22:35:50 +0100
committermethodus <methodus@web.de>2012-10-29 22:35:50 +0100
commit3381403479340a23468a5a30665e7f866a8bf749 (patch)
tree57202927f223a4f4b1793decb38678f55633866a /plugins/provider
parent16b7b9cef70993f8cc82f3cdc47a8316cc9661bd (diff)
downloadvdr-plugin-upnp-3381403479340a23468a5a30665e7f866a8bf749.tar.gz
vdr-plugin-upnp-3381403479340a23468a5a30665e7f866a8bf749.tar.bz2
Implemented new makefiles, which enables building the plugins from the main makefile. Removes some redundancies. Huge thanks to Lucian Muresan
Diffstat (limited to 'plugins/provider')
-rw-r--r--plugins/provider/recProvider/Makefile62
-rw-r--r--plugins/provider/vdrProvider/Makefile62
2 files changed, 30 insertions, 94 deletions
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