vdr-plugin-streamdev/Makefile

97 lines
2.3 KiB
Makefile
Raw Normal View History

2004-12-30 23:43:55 +01:00
#
# Makefile for a Video Disk Recorder plugin
#
# $Id: $
2004-12-30 23:43:55 +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
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:
# 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
export CFLAGS = $(call PKGCFG,cflags)
export CXXFLAGS = $(call PKGCFG,cxxflags)
2004-12-30 23:43:55 +01:00
### The version number of VDR's plugin API:
2004-12-30 23:43:55 +01:00
APIVERSION = $(call PKGCFG,apiversion)
2004-12-30 23:43:55 +01:00
### Allow user defined options to overwrite defaults:
2004-12-30 23:43:55 +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)
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)
2010-12-02 09:57:17 +01:00
### Includes and Defines (add further entries here):
2010-12-02 09:57:17 +01:00
INCLUDES += -I$(VDRDIR)/include -I..
export INCLUDES
2010-12-02 09:57:17 +01:00
DEFINES += -D_GNU_SOURCE
2010-12-02 09:57:17 +01:00
ifdef DEBUG
DEFINES += -DDEBUG
endif
ifdef STREAMDEV_DEBUG
DEFINES += -DDEBUG
endif
2010-12-02 09:57:17 +01:00
### The main target:
2010-12-02 09:57:17 +01:00
.PHONY: all client server dist clean
all: client server
2004-12-30 23:43:55 +01:00
### Targets:
2010-12-02 09:57:17 +01:00
client:
$(MAKE) -C ./tools
$(MAKE) -C ./client install
2010-12-02 09:57:17 +01:00
# installs to $(LIBDIR)/libvdr-streamdev-client.so.$(APIVERSION)
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
$(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
dist: clean
@-rm -rf $(TMPDIR)/$(ARCHIVE)
@mkdir $(TMPDIR)/$(ARCHIVE)
@cp -a * $(TMPDIR)/$(ARCHIVE)
@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
$(MAKE) -C ./libdvbmpeg clean
2010-12-02 09:57:17 +01:00
$(MAKE) -C ./remux clean
$(MAKE) -C ./client clean
$(MAKE) -C ./server clean