2004-12-30 23:43:55 +01:00
|
|
|
#
|
|
|
|
# Makefile for a Video Disk Recorder plugin
|
|
|
|
#
|
2013-02-27 13:11:23 +01:00
|
|
|
# $Id: $
|
2004-12-30 23:43:55 +01:00
|
|
|
|
2013-02-27 13:11:23 +01:00
|
|
|
# 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.
|
2004-12-30 23:43:55 +01:00
|
|
|
|
2013-02-27 13:11:23 +01:00
|
|
|
PLUGIN = streamdev
|
2010-12-02 09:57:17 +01:00
|
|
|
|
|
|
|
### The version number of this plugin (taken from the main source file):
|
|
|
|
|
|
|
|
VERSION = $(shell grep 'const char \*VERSION *=' common.c | awk '{ print $$5 }' | sed -e 's/[";]//g')
|
2004-12-30 23:43:55 +01:00
|
|
|
|
|
|
|
### The directory environment:
|
|
|
|
|
2013-02-27 13:11:23 +01:00
|
|
|
# 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:
|
2004-12-30 23:43:55 +01:00
|
|
|
|
2013-02-27 13:11:23 +01:00
|
|
|
export CFLAGS = $(call PKGCFG,cflags)
|
|
|
|
export CXXFLAGS = $(call PKGCFG,cxxflags)
|
2004-12-30 23:43:55 +01:00
|
|
|
|
2013-02-27 13:11:23 +01:00
|
|
|
### The version number of VDR's plugin API:
|
2004-12-30 23:43:55 +01:00
|
|
|
|
2013-02-27 13:11:23 +01:00
|
|
|
APIVERSION = $(call PKGCFG,apiversion)
|
2004-12-30 23:43:55 +01:00
|
|
|
|
2013-02-27 13:11:23 +01:00
|
|
|
### Allow user defined options to overwrite defaults:
|
2004-12-30 23:43:55 +01:00
|
|
|
|
2013-02-27 13:11:23 +01:00
|
|
|
-include $(PLGCFG)
|
2004-12-30 23:43:55 +01:00
|
|
|
|
2010-12-02 09:57:17 +01:00
|
|
|
### export all vars for sub-makes, using absolute paths
|
|
|
|
LIBDIR := $(shell cd $(LIBDIR) >/dev/null 2>&1 && pwd)
|
2013-02-27 13:11:23 +01:00
|
|
|
LOCDIR := $(shell cd $(LOCDIR) >/dev/null 2>&1 && pwd)
|
2010-12-02 09:57:17 +01:00
|
|
|
export
|
|
|
|
unexport PLUGIN
|
2004-12-30 23:43:55 +01:00
|
|
|
|
2010-12-02 09:57:17 +01:00
|
|
|
### The name of the distribution archive:
|
2004-12-30 23:43:55 +01:00
|
|
|
|
2010-12-02 09:57:17 +01:00
|
|
|
ARCHIVE = $(PLUGIN)-$(VERSION)
|
|
|
|
PACKAGE = vdr-$(ARCHIVE)
|
2008-04-08 16:18:15 +02:00
|
|
|
|
2010-12-02 09:57:17 +01:00
|
|
|
### Includes and Defines (add further entries here):
|
2008-04-08 16:18:15 +02:00
|
|
|
|
2010-12-02 09:57:17 +01:00
|
|
|
INCLUDES += -I$(VDRDIR)/include -I..
|
2013-02-27 13:11:23 +01:00
|
|
|
export INCLUDES
|
2008-04-08 16:18:15 +02:00
|
|
|
|
2010-12-02 09:57:17 +01:00
|
|
|
DEFINES += -D_GNU_SOURCE
|
2008-04-08 16:18:15 +02:00
|
|
|
|
2010-12-02 09:57:17 +01:00
|
|
|
ifdef DEBUG
|
|
|
|
DEFINES += -DDEBUG
|
|
|
|
endif
|
|
|
|
ifdef STREAMDEV_DEBUG
|
|
|
|
DEFINES += -DDEBUG
|
|
|
|
endif
|
2008-04-08 16:18:15 +02:00
|
|
|
|
2010-12-02 09:57:17 +01:00
|
|
|
### The main target:
|
2008-04-08 16:18:15 +02:00
|
|
|
|
2013-02-28 08:23:23 +01:00
|
|
|
.PHONY: all client server install install-client install-server dist clean
|
2010-12-02 09:57:17 +01:00
|
|
|
all: client server
|
2008-04-08 16:18:15 +02:00
|
|
|
|
2004-12-30 23:43:55 +01:00
|
|
|
### Targets:
|
|
|
|
|
2010-12-02 09:57:17 +01:00
|
|
|
client:
|
|
|
|
$(MAKE) -C ./tools
|
2013-02-28 08:23:23 +01:00
|
|
|
$(MAKE) -C ./client
|
2004-12-30 23:43:55 +01:00
|
|
|
|
2010-12-02 09:57:17 +01:00
|
|
|
server:
|
|
|
|
$(MAKE) -C ./tools
|
|
|
|
$(MAKE) -C ./libdvbmpeg
|
|
|
|
$(MAKE) -C ./remux
|
2013-02-28 08:23:23 +01:00
|
|
|
$(MAKE) -C ./server
|
|
|
|
|
|
|
|
install-client: client
|
|
|
|
$(MAKE) -C ./client install
|
|
|
|
# installs to $(LIBDIR)/libvdr-streamdev-client.so.$(APIVERSION)
|
|
|
|
|
|
|
|
install-server: server
|
2013-02-27 13:11:23 +01:00
|
|
|
$(MAKE) -C ./server install
|
2010-12-02 09:57:17 +01:00
|
|
|
# installs to $(LIBDIR)/libvdr-streamdev-server.so.$(APIVERSION)
|
2004-12-30 23:43:55 +01:00
|
|
|
|
2013-02-28 08:23:23 +01:00
|
|
|
install: install-client install-server
|
|
|
|
|
2004-12-30 23:43:55 +01:00
|
|
|
dist: clean
|
|
|
|
@-rm -rf $(TMPDIR)/$(ARCHIVE)
|
|
|
|
@mkdir $(TMPDIR)/$(ARCHIVE)
|
|
|
|
@cp -a * $(TMPDIR)/$(ARCHIVE)
|
2013-02-27 13:11:23 +01:00
|
|
|
@tar czf $(PACKAGE).tgz -C $(TMPDIR) $(ARCHIVE)
|
2004-12-30 23:43:55 +01:00
|
|
|
@-rm -rf $(TMPDIR)/$(ARCHIVE)
|
|
|
|
@echo Distribution package created as $(PACKAGE).tgz
|
|
|
|
|
|
|
|
clean:
|
2010-12-02 09:57:17 +01:00
|
|
|
$(MAKE) -C ./tools clean
|
2008-03-12 10:36:27 +01:00
|
|
|
$(MAKE) -C ./libdvbmpeg clean
|
2010-12-02 09:57:17 +01:00
|
|
|
$(MAKE) -C ./remux clean
|
|
|
|
$(MAKE) -C ./client clean
|
|
|
|
$(MAKE) -C ./server clean
|