1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78
|
#
# Makefile for a Video Disk Recorder plugin + program
#
# don't remove the next line, its needed for the VDR Makefile
# $(LIBDIR)/$@.$(APIVERSION)
### The version number of this plugin (taken from the main source file):
PKG_CONFIG ?= pkg-config
VERSION = $(shell grep 'static const char \*VERSION *=' version.h | awk '{ print $$6 }' | sed -e 's/[";]//g')
GITTAG = $(shell git describe --always 2>/dev/null)
$(shell GITVERSION=`git rev-parse --short HEAD 2> /dev/null`; if [ "$$GITVERSION" ]; then sed "s/\";/ ($$GITVERSION)\";/" version.dist > version.h; else cp version.dist version.h; fi)
### 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_PATH="$$PKG_CONFIG_PATH:../../.." $(PKG_CONFIG) --variable=$(1) vdr))
LIBDIR = $(call PKGCFG,libdir)
LOCDIR = $(call PKGCFG,locdir)
PLGCFG = $(call PKGCFG,plgcfg)
CFGDIR = $(call PKGCFG,configdir)
#
TMPDIR ?= /tmp
DIRS = command plugin
### The compiler options:
export CFLAGS = $(call PKGCFG,cflags)
export CXXFLAGS = $(call PKGCFG,cxxflags)
ARCHIVE = markad-$(VERSION)
PACKAGE = vdr-$(ARCHIVE)
### The version number of VDR's plugin API:
APIVERSION = $(call PKGCFG,apiversion)
### Allow user defined options to overwrite defaults:
-include $(PLGCFG)
all:
@for i in $(DIRS); do \
$(MAKE) -C $$i; \
if [ $$? -ne 0 ]; then \
echo "make failed on directory $$i"; \
exit 1; \
fi; \
done
install:
for i in $(DIRS); do $(MAKE) -C $$i install; done
dist:
@-rm -rf $(TMPDIR)/$(ARCHIVE)
@mkdir $(TMPDIR)/$(ARCHIVE)
@mkdir $(TMPDIR)/$(ARCHIVE)/plugin
@mkdir $(TMPDIR)/$(ARCHIVE)/plugin/po
@mkdir $(TMPDIR)/$(ARCHIVE)/plugin/dist
@mkdir $(TMPDIR)/$(ARCHIVE)/command
@mkdir $(TMPDIR)/$(ARCHIVE)/command/po
@mkdir $(TMPDIR)/$(ARCHIVE)/command/logos
@cp -a plugin/*.cpp plugin/*.h plugin/Makefile $(TMPDIR)/$(ARCHIVE)/plugin
@cp -a plugin/dist/* $(TMPDIR)/$(ARCHIVE)/plugin/dist
@cp -a plugin/po/*.po $(TMPDIR)/$(ARCHIVE)/plugin/po
@cp -a command/*.cpp command/*.h command/*.1 command/Makefile $(TMPDIR)/$(ARCHIVE)/command
@cp -u command/logos/*.pgm $(TMPDIR)/$(ARCHIVE)/command/logos
@cp -a command/po/*.po $(TMPDIR)/$(ARCHIVE)/command/po
@cp -a *.dist *.h COPYING HISTORY README INSTALL Makefile $(TMPDIR)/$(ARCHIVE)
@tar czf $(PACKAGE).tgz -C $(TMPDIR) $(ARCHIVE)
@-rm -rf $(TMPDIR)/$(ARCHIVE)
@echo Distribution package created as $(PACKAGE).tgz
clean:
for i in $(DIRS); do make -C $$i clean; done
@-rm -f version.h $(PACKAGE).tgz
cppcheck:
cppcheck --enable=all --check-level=exhaustive --inline-suppr --suppress=missingIncludeSystem --suppress=unusedFunction:plugin/markad.cpp --suppress=unusedFunction:plugin/markad.h --suppress=unusedFunction:plugin/status.cpp -DLIBAVCODEC_VERSION_INT=3940198 -DDEBUGMEM=1 --error-exitcode=1 . > /dev/null
|