vdr-plugin-streamdev/Makefile

109 lines
2.6 KiB
Makefile
Raw Normal View History

2004-12-30 23:43:55 +01:00
#
# Makefile for a Video Disk Recorder plugin
#
2010-12-02 09:57:17 +01:00
# $Id: Makefile,v 1.23 2010/08/02 10:36:59 schmirl Exp $
2004-12-30 23:43:55 +01:00
2010-12-02 09:57:17 +01:00
# The main source file name.
2004-12-30 23:43:55 +01:00
#
PLUGIN = streamdev
2010-12-02 09:57:17 +01:00
### The C/C++ compiler and options:
2004-12-30 23:43:55 +01:00
2010-12-02 09:57:17 +01:00
CC ?= gcc
CFLAGS ?= -g -O2 -Wall
2004-12-30 23:43:55 +01:00
CXX ?= g++
2010-12-02 09:57:17 +01:00
CXXFLAGS ?= -g -O2 -Wall -Woverloaded-virtual -Wno-parentheses
### 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:
VDRDIR = ../../..
LIBDIR = ../../lib
TMPDIR = /tmp
### The version number of VDR (taken from VDR's "config.h"):
2006-07-05 22:35:24 +02:00
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 }')
2004-12-30 23:43:55 +01:00
2010-12-02 09:57:17 +01:00
### Allow user defined options to overwrite defaults:
2004-12-30 23:43:55 +01:00
2010-12-02 09:57:17 +01:00
ifeq ($(shell test $(APIVERSNUM) -ge 10713; echo $$?),0)
include $(VDRDIR)/Make.global
else
ifeq ($(shell test $(APIVERSNUM) -ge 10704 -o -n "$(TSPLAYVERSNUM)" ; echo $$?),0)
2010-12-02 09:57:17 +01:00
DEFINES += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
CFLAGS += -fPIC
CXXFLAGS += -fPIC
else
CFLAGS += -fPIC
CXXFLAGS += -fPIC
endif
2004-12-30 23:43:55 +01:00
endif
2010-12-02 09:57:17 +01:00
-include $(VDRDIR)/Make.config
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
2004-12-30 23:43:55 +01:00
2010-12-02 09:57:17 +01:00
VDRDIR := $(shell cd $(VDRDIR) >/dev/null 2>&1 && pwd)
LIBDIR := $(shell cd $(LIBDIR) >/dev/null 2>&1 && pwd)
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..
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
# 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
# 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)
2008-03-31 12:34:26 +02:00
@tar czf $(PACKAGE).tgz --exclude CVS -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