vdr-plugin-streamdev/Makefile

107 lines
2.5 KiB
Makefile
Raw Normal View History

2010-12-02 08:53:01 +01:00
#
# Makefile for a Video Disk Recorder plugin
#
2010-12-02 09:51:02 +01:00
# $Id: Makefile,v 1.22 2010/07/19 13:49:24 schmirl Exp $
2010-12-02 08:53:01 +01:00
2010-12-02 09:48:23 +01:00
# The main source file name.
2010-12-02 08:53:01 +01:00
#
PLUGIN = streamdev
2010-12-02 09:48:23 +01:00
### The C/C++ compiler and options:
2010-12-02 08:53:01 +01:00
2010-12-02 09:48:23 +01:00
CC ?= gcc
CFLAGS ?= -g -O2 -Wall
2010-12-02 08:53:01 +01:00
CXX ?= g++
2010-12-02 09:48:23 +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')
2010-12-02 08:53:01 +01:00
### The directory environment:
VDRDIR = ../../..
LIBDIR = ../../lib
TMPDIR = /tmp
2010-12-02 09:48:23 +01:00
### The version number of VDR (taken from VDR's "config.h"):
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 }')
2010-12-02 08:53:01 +01:00
### Allow user defined options to overwrite defaults:
2010-12-02 09:48:23 +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)
DEFINES += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
CFLAGS += -fPIC
CXXFLAGS += -fPIC
else
CFLAGS += -fPIC
CXXFLAGS += -fPIC
endif
2010-12-02 08:53:01 +01:00
-include $(VDRDIR)/Make.config
2010-12-02 09:48:23 +01:00
### export all vars for sub-makes, using absolute paths
2010-12-02 08:53:01 +01:00
2010-12-02 09:48:23 +01:00
VDRDIR := $(abspath $(VDRDIR))
LIBDIR := $(abspath $(LIBDIR))
export
unexport PLUGIN
2010-12-02 08:53:01 +01:00
### The name of the distribution archive:
ARCHIVE = $(PLUGIN)-$(VERSION)
PACKAGE = vdr-$(ARCHIVE)
### Includes and Defines (add further entries here):
2010-12-02 09:48:23 +01:00
INCLUDES += -I$(VDRDIR)/include -I..
2010-12-02 08:53:01 +01:00
2010-12-02 09:48:23 +01:00
DEFINES += -D_GNU_SOURCE
2010-12-02 08:53:01 +01:00
ifdef DEBUG
2010-12-02 09:48:23 +01:00
DEFINES += -DDEBUG
2010-12-02 08:53:01 +01:00
endif
2010-12-02 09:48:23 +01:00
ifdef STREAMDEV_DEBUG
DEFINES += -DDEBUG
2010-12-02 08:53:01 +01:00
endif
2010-12-02 09:48:23 +01:00
### The main target:
2010-12-02 09:43:13 +01:00
2010-12-02 09:48:23 +01:00
.PHONY: all client server dist clean
all: client server
2010-12-02 09:43:13 +01:00
2010-12-02 08:53:01 +01:00
### Targets:
2010-12-02 09:48:23 +01:00
client:
$(MAKE) -C ./tools
$(MAKE) -C ./client
2010-12-02 09:49:09 +01:00
# installs to $(LIBDIR)/libvdr-streamdev-client.so.$(APIVERSION)
2010-12-02 08:53:01 +01:00
2010-12-02 09:48:23 +01:00
server:
$(MAKE) -C ./tools
$(MAKE) -C ./libdvbmpeg
$(MAKE) -C ./remux
$(MAKE) -C ./server
2010-12-02 09:49:09 +01:00
# installs to $(LIBDIR)/libvdr-streamdev-server.so.$(APIVERSION)
2010-12-02 08:53:01 +01:00
dist: clean
@-rm -rf $(TMPDIR)/$(ARCHIVE)
@mkdir $(TMPDIR)/$(ARCHIVE)
@cp -a * $(TMPDIR)/$(ARCHIVE)
2010-12-02 09:02:31 +01:00
@tar czf $(PACKAGE).tgz --exclude CVS -C $(TMPDIR) $(ARCHIVE)
2010-12-02 08:53:01 +01:00
@-rm -rf $(TMPDIR)/$(ARCHIVE)
@echo Distribution package created as $(PACKAGE).tgz
clean:
2010-12-02 09:48:23 +01:00
$(MAKE) -C ./tools clean
2010-12-02 09:02:31 +01:00
$(MAKE) -C ./libdvbmpeg clean
2010-12-02 09:48:23 +01:00
$(MAKE) -C ./remux clean
$(MAKE) -C ./client clean
$(MAKE) -C ./server clean