diff options
| author | Daniel Meyerholt <dxm523@googlemail.com> | 2014-06-21 22:09:48 +0200 |
|---|---|---|
| committer | Daniel Meyerholt <dxm523@googlemail.com> | 2014-06-21 22:09:48 +0200 |
| commit | cb5f328e5ba3398b048c282700fbabaab2e7a9ea (patch) | |
| tree | 84a1748677d7de56b27c8678daa8551d8af7ee30 /Makefile | |
| parent | 2aadf76f83316738a3026fc0d1ade63ccbce7c2a (diff) | |
| download | vdr-plugin-vdrrip-cb5f328e5ba3398b048c282700fbabaab2e7a9ea.tar.gz vdr-plugin-vdrrip-cb5f328e5ba3398b048c282700fbabaab2e7a9ea.tar.bz2 | |
* Use Makefile from vdr examples
* fix up some translations
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 94 |
1 files changed, 47 insertions, 47 deletions
@@ -1,115 +1,115 @@ # # Makefile for a Video Disk Recorder plugin # -# $Id$ +# $Id: Makefile 3.1 2014/01/01 13:29:54 kls Exp $ # 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. -# -PLUGIN = vdrrip -### uncomment this line, if you want to encode DVD's -#VDRRIP_DVD=1 +PLUGIN = vdrrip ### The version number of this plugin (taken from the main source file): VERSION = $(shell grep 'static const char \*VERSION *=' $(PLUGIN).c | awk '{ print $$6 }' | sed -e 's/[";]//g') -### The C++ compiler and options: +### The directory environment: -CXX ?= g++ -CXXFLAGS ?= -fPIC -O2 -Wall -Woverloaded-virtual +# 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) +# +TMPDIR ?= /tmp -### The directory environment: +### The compiler options: -DVBDIR = ../../../../DVB -VDRDIR = ../../.. -LIBDIR = ../../lib -TMPDIR = /tmp +export CFLAGS = $(call PKGCFG,cflags) +export CXXFLAGS = $(call PKGCFG,cxxflags) -fPIC -### Allow user defined options to overwrite defaults: +### The version number of VDR's plugin API: --include $(VDRDIR)/Make.config +APIVERSION = $(call PKGCFG,apiversion) -### The version number of VDR (taken from VDR's "config.h"): +### Allow user defined options to overwrite defaults: -APIVERSION = $(shell grep 'define APIVERSION ' $(VDRDIR)/config.h | awk '{ print $$3 }' | sed -e 's/"//g') +-include $(PLGCFG) ### The name of the distribution archive: ARCHIVE = $(PLUGIN)-$(VERSION) PACKAGE = vdr-$(ARCHIVE) -### Includes and Defines (add further entries here): +### The name of the shared object file: -INCLUDES += -I$(VDRDIR)/include -I$(DVBDIR)/include +SOFILE = libvdr-$(PLUGIN).so + +### Includes and Defines (add further entries here): -DEFINES += -D_GNU_SOURCE -DPLUGIN_NAME_I18N='"$(PLUGIN)"' -D__STDC_LIMIT_MACROS +INCLUDES += -NEW_IFO_READ := $(wildcard /usr/include/dvdread/ifo_read.h) -ifneq ($(strip $(NEW_IFO_READ)),) - DEFINES += -DNEW_IFO_READ -endif +DEFINES += -DPLUGIN_NAME_I18N='"$(PLUGIN)"' ### The object files (add further files here): -OBJS = $(PLUGIN).o \ - menu-vdrrip.o movie.o templates.o codecs.o queue.o vdrriprecordings.o a-tools.o +OBJS = $(PLUGIN).o -ifdef VDRRIP_DVD - DEFINES += -DVDRRIP_DVD - LIBS += -ldvdnav -endif +### The main target: + +all: $(SOFILE) i18n ### Implicit rules: %.o: %.c - $(CXX) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) $< + $(CXX) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) -o $@ $< -# Dependencies: +### Dependencies: -MAKEDEP = g++ -MM -MG +MAKEDEP = $(CXX) -MM -MG DEPFILE = .dependencies $(DEPFILE): Makefile - @$(MAKEDEP) $(DEFINES) $(INCLUDES) $(OBJS:%.o=%.c) > $@ + @$(MAKEDEP) $(CXXFLAGS) $(DEFINES) $(INCLUDES) $(OBJS:%.o=%.c) > $@ -include $(DEPFILE) ### Internationalization (I18N): PODIR = po -LOCALEDIR = $(VDRDIR)/locale I18Npo = $(wildcard $(PODIR)/*.po) -I18Nmsgs = $(addprefix $(LOCALEDIR)/, $(addsuffix /LC_MESSAGES/vdr-$(PLUGIN).mo, $(notdir $(foreach file, $(I18Npo), $(basename $(file)))))) +I18Nmo = $(addsuffix .mo, $(foreach file, $(I18Npo), $(basename $(file)))) +I18Nmsgs = $(addprefix $(DESTDIR)$(LOCDIR)/, $(addsuffix /LC_MESSAGES/vdr-$(PLUGIN).mo, $(notdir $(foreach file, $(I18Npo), $(basename $(file)))))) I18Npot = $(PODIR)/$(PLUGIN).pot %.mo: %.po msgfmt -c -o $@ $< $(I18Npot): $(wildcard *.c) - xgettext -C -cTRANSLATORS --no-wrap --no-location -k -ktr -ktrNOOP --msgid-bugs-address='<tobias.grimm@e-tobi.net>' -o $@ $^ + xgettext -C -cTRANSLATORS --no-wrap --no-location -k -ktr -ktrNOOP --package-name=vdr-$(PLUGIN) --package-version=$(VERSION) --msgid-bugs-address='<see README>' -o $@ `ls $^` %.po: $(I18Npot) - msgmerge -U --no-wrap --no-location --backup=none -q $@ $< + msgmerge -U --no-wrap --no-location --backup=none -q -N $@ $< @touch $@ -$(I18Nmsgs): $(LOCALEDIR)/%/LC_MESSAGES/vdr-$(PLUGIN).mo: $(PODIR)/%.mo - @mkdir -p $(dir $@) - cp $< $@ +$(I18Nmsgs): $(DESTDIR)$(LOCDIR)/%/LC_MESSAGES/vdr-$(PLUGIN).mo: $(PODIR)/%.mo + install -D -m644 $< $@ .PHONY: i18n -i18n: $(I18Nmsgs) +i18n: $(I18Nmo) $(I18Npot) + +install-i18n: $(I18Nmsgs) ### Targets: -all: libvdr-$(PLUGIN).so i18n +$(SOFILE): $(OBJS) + $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared $(OBJS) -o $@ + +install-lib: $(SOFILE) + install -D $^ $(DESTDIR)$(LIBDIR)/$^.$(APIVERSION) -libvdr-$(PLUGIN).so: $(OBJS) - $(CXX) $(CXXFLAGS) -shared $(OBJS) $(LIBS) -o $@ - @cp $@ $(LIBDIR)/$@.$(APIVERSION) +install: install-lib install-i18n -dist: clean +dist: $(I18Npo) clean @-rm -rf $(TMPDIR)/$(ARCHIVE) @mkdir $(TMPDIR)/$(ARCHIVE) @cp -a * $(TMPDIR)/$(ARCHIVE) |
