diff options
author | Frank Schmirler <vdr@schmirler.de> | 2013-02-27 13:11:23 +0100 |
---|---|---|
committer | Frank Schmirler <vdr@schmirler.de> | 2013-02-27 13:11:23 +0100 |
commit | 08198729ac2717a1638a9a20f128bc71705c21cf (patch) | |
tree | 877275c97f42e4f8e8e72aedfdbf841da6a797d9 /Makefile | |
parent | 10db11acd9a9785443182da1ec032c1d83db271a (diff) | |
download | vdr-plugin-streamdev-08198729ac2717a1638a9a20f128bc71705c21cf.tar.gz vdr-plugin-streamdev-08198729ac2717a1638a9a20f128bc71705c21cf.tar.bz2 |
Adapted Makefiles to VDR 1.7.36+ (thanks to macmenot). Old makefiles have
been renamed to Makefile-1.7.33 (fixes #1199)
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 62 |
1 files changed, 25 insertions, 37 deletions
@@ -1,19 +1,13 @@ # # Makefile for a Video Disk Recorder plugin # -# $Id: Makefile,v 1.23 2010/08/02 10:36:59 schmirl Exp $ +# $Id: $ -# The main source file name. -# -PLUGIN = streamdev - -### The C/C++ compiler and options: +# 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. -CC ?= gcc -CFLAGS ?= -g -O2 -Wall - -CXX ?= g++ -CXXFLAGS ?= -g -O2 -Wall -Woverloaded-virtual -Wno-parentheses +PLUGIN = streamdev ### The version number of this plugin (taken from the main source file): @@ -21,37 +15,30 @@ VERSION = $(shell grep 'const char \*VERSION *=' common.c | awk '{ print $$5 }' ### The directory environment: -VDRDIR = ../../.. -LIBDIR = ../../lib -TMPDIR = /tmp +# 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)) +LIBDIR = $(call PKGCFG,libdir) +LOCDIR = $(call PKGCFG,locdir) +PLGCFG = $(call PKGCFG,plgcfg) +# +TMPDIR ?= /tmp + +### The compiler options: -### The version number of VDR (taken from VDR's "config.h"): +export CFLAGS = $(call PKGCFG,cflags) +export CXXFLAGS = $(call PKGCFG,cxxflags) -APIVERSION = $(shell grep 'define APIVERSION ' $(VDRDIR)/config.h | awk '{ print $$3 }' | sed -e 's/"//g') -APIVERSNUM = $(shell grep 'define APIVERSNUM ' $(VDRDIR)/config.h | awk '{ print $$3 }' | sed -e 's/"//g') -TSPLAYVERSNUM = $(shell grep 'define TSPLAY_PATCH_VERSION ' $(VDRDIR)/device.h | awk '{ print $$3 }') +### The version number of VDR's plugin API: -### Allow user defined options to overwrite defaults: +APIVERSION = $(call PKGCFG,apiversion) -ifeq ($(shell test $(APIVERSNUM) -ge 10713; echo $$?),0) -include $(VDRDIR)/Make.global -else -ifeq ($(shell test $(APIVERSNUM) -ge 10704 -o -n "$(TSPLAYVERSNUM)" ; echo $$?),0) -DEFINES += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -CFLAGS += -fPIC -CXXFLAGS += -fPIC -else -CFLAGS += -fPIC -CXXFLAGS += -fPIC -endif -endif +### Allow user defined options to overwrite defaults: --include $(VDRDIR)/Make.config +-include $(PLGCFG) ### export all vars for sub-makes, using absolute paths - -VDRDIR := $(shell cd $(VDRDIR) >/dev/null 2>&1 && pwd) LIBDIR := $(shell cd $(LIBDIR) >/dev/null 2>&1 && pwd) +LOCDIR := $(shell cd $(LOCDIR) >/dev/null 2>&1 && pwd) export unexport PLUGIN @@ -63,6 +50,7 @@ PACKAGE = vdr-$(ARCHIVE) ### Includes and Defines (add further entries here): INCLUDES += -I$(VDRDIR)/include -I.. +export INCLUDES DEFINES += -D_GNU_SOURCE @@ -82,21 +70,21 @@ all: client server client: $(MAKE) -C ./tools - $(MAKE) -C ./client + $(MAKE) -C ./client install # installs to $(LIBDIR)/libvdr-streamdev-client.so.$(APIVERSION) server: $(MAKE) -C ./tools $(MAKE) -C ./libdvbmpeg $(MAKE) -C ./remux - $(MAKE) -C ./server + $(MAKE) -C ./server install # installs to $(LIBDIR)/libvdr-streamdev-server.so.$(APIVERSION) dist: clean @-rm -rf $(TMPDIR)/$(ARCHIVE) @mkdir $(TMPDIR)/$(ARCHIVE) @cp -a * $(TMPDIR)/$(ARCHIVE) - @tar czf $(PACKAGE).tgz --exclude CVS -C $(TMPDIR) $(ARCHIVE) + @tar czf $(PACKAGE).tgz -C $(TMPDIR) $(ARCHIVE) @-rm -rf $(TMPDIR)/$(ARCHIVE) @echo Distribution package created as $(PACKAGE).tgz |