diff options
author | Dimitar Petrovski <dimeptr@gmail.com> | 2013-01-03 10:15:17 +0100 |
---|---|---|
committer | Dimitar Petrovski <dimeptr@gmail.com> | 2013-01-03 10:15:17 +0100 |
commit | 692ebcf6a83df32c78a61faf64741b1f4efed233 (patch) | |
tree | f54baf65d731e3480664358e4420ed6e43262611 | |
parent | f3ecec54c88df783b099446b46ded1eb2ceccc4a (diff) | |
download | vdr-plugin-eepg-692ebcf6a83df32c78a61faf64741b1f4efed233.tar.gz vdr-plugin-eepg-692ebcf6a83df32c78a61faf64741b1f4efed233.tar.bz2 |
modified Makefile according to the new VDR version 1.7.35 style
-rw-r--r-- | Makefile | 88 | ||||
-rw-r--r-- | eepg.c | 2 | ||||
-rw-r--r-- | po/mk_MK.po | 6 |
3 files changed, 53 insertions, 43 deletions
@@ -26,53 +26,60 @@ PLUGIN = eepg ### 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: - -CXX ?= g++ -CXXFLAGS ?= -O2 -fPIC -Wall -Woverloaded-virtual +RELEASE := $(shell grep 'static const char \*VERSION *=' $(PLUGIN).c | awk '{ print $$6 }' | sed -e 's/[";]//g') +SUBREL := $(shell if test -d .git; then \ + echo -n "-git-"; (git rev-parse --short HEAD 2>/dev/null || echo -n "Unknown") | sed -e 's/ .*//'; \ + fi) +VERSION := $(RELEASE)$(SUBREL) +#VERSION = $(shell grep 'static const char \*VERSION *=' $(PLUGIN).c | awk '{ print $$6 }' | sed -e 's/[";]//g') ### The directory environment: -VDRDIR ?= ../../.. -LIBDIR ?= ../../lib +# 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 = $(DESTDIR)$(call PKGCFG,libdir) +LOCDIR = $(DESTDIR)$(call PKGCFG,locdir) +PLGCFG = $(call PKGCFG,plgcfg) +# TMPDIR ?= /tmp -### Allow user defined options to overwrite defaults: +### The compiler options: --include $(VDRDIR)/Make.config --include Make.config +export CFLAGS = $(call PKGCFG,cflags) +export CXXFLAGS = $(call PKGCFG,cxxflags) -### The version number of VDR's plugin API (taken from VDR's "config.h"): +### The version number of VDR's plugin API: -VDRVERSION = $(shell sed -ne '/define VDRVERSION/ s/^.*"\(.*\)".*$$/\1/p' $(VDRDIR)/config.h) -APIVERSION = $(shell sed -ne '/define APIVERSION/ s/^.*"\(.*\)".*$$/\1/p' $(VDRDIR)/config.h) -ifeq ($(strip $(APIVERSION)),) - APIVERSION = $(VDRVERSION) -endif +APIVERSION = $(call PKGCFG,apiversion) + +### Allow user defined options to overwrite defaults: + +-include $(PLGCFG) +-include Make.config ### 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: + +SOFILE = libvdr-$(PLUGIN).so -INCLUDES += -I$(VDRDIR)/include +### Includes and Defines (add further entries here): -DEFINES += -D_GNU_SOURCE -DPLUGIN_NAME_I18N='"$(PLUGIN)"' +#INCLUDES += -I$(VDRDIR)/include +INCLUDES += -ifdef DBG -CXXFLAGS += -g -endif +DEFINES += -DPLUGIN_NAME_I18N='"$(PLUGIN)"' ### The object files (add further files here): OBJS = $(PLUGIN).o dish.o epghandler.o setupeepg.o equivhandler.o util.o eit2.o -### Default Target -default: $(OBJS) +### The main target: + +all: $(SOFILE) i18n ### Implicit rules: @@ -91,36 +98,38 @@ $(DEPFILE): Makefile ### 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 $(LOCDIR)/, $(addsuffix /LC_MESSAGES/vdr-$(PLUGIN).mo, $(notdir $(foreach file, $(I18Npo), $(basename $(file)))))) I18Npot = $(PODIR)/$(PLUGIN).pot -### target All not default since it stops VDR -all: libvdr-$(PLUGIN).so i18n - %.mo: %.po msgfmt -c -o $@ $< $(I18Npot): $(wildcard *.c) - xgettext -C -cTRANSLATORS --no-wrap --no-location -k -ktr -ktrNOOP --package-name=vdr-$(PLUGIN) --package-version=$(VERSION) --msgid-bugs-address='<see README>' -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): $(LOCDIR)/%/LC_MESSAGES/vdr-$(PLUGIN).mo: $(PODIR)/%.mo + install -D -m644 $< $@ .PHONY: i18n -i18n: $(I18Nmsgs) $(I18Npot) +i18n: $(I18Nmo) $(I18Npot) + +install-i18n: $(I18Nmsgs) ### Targets: -libvdr-$(PLUGIN).so: $(OBJS) +$(SOFILE): $(OBJS) $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared $(OBJS) -o $@ - @cp --remove-destination $@ $(LIBDIR)/$@.$(APIVERSION) + +install-lib: $(SOFILE) + install -D $^ $(LIBDIR)/$^.$(APIVERSION) + +install: install-lib install-i18n dist: $(I18Npo) clean @-rm -rf $(TMPDIR)/$(ARCHIVE) @@ -131,4 +140,5 @@ dist: $(I18Npo) clean @echo Distribution package created as $(PACKAGE).tgz clean: - @-rm -f $(OBJS) $(DEPFILE) *.so *.tgz core* *~ $(PODIR)/*.mo $(PODIR)/*.pot + @-rm -f $(PODIR)/*.mo $(PODIR)/*.pot + @-rm -f $(OBJS) $(DEPFILE) *.so *.tgz core* *~ @@ -52,7 +52,7 @@ #include <stdarg.h> -#if APIVERSNUM < 10401 +#if defined(APIVERSNUM) && APIVERSNUM < 10401 #error You need at least VDR API version 1.4.1 for this plugin #endif #if APIVERSNUM < 10507 diff --git a/po/mk_MK.po b/po/mk_MK.po index 69936f2..6b2ef2b 100644 --- a/po/mk_MK.po +++ b/po/mk_MK.po @@ -1,5 +1,5 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2012 +# Macedonian translations for vdr-eepg package. +# Copyright (C) 2012 THE vdr-eepg'S COPYRIGHT HOLDER # This file is distributed under the same license as the VDR package. # Dimitar Petrovski <dimeptr@gmail.com>, 2012. # @@ -10,7 +10,7 @@ msgstr "" "POT-Creation-Date: 2012-11-20 23:13+0100\n" "PO-Revision-Date: 2012-10-29 13:44+0100\n" "Last-Translator: Dimitar Petrovski <dimeptr@gmail.com>\n" -"Language-Team: Macedonian <mk@li.org>\n" +"Language-Team: Macedonian\n" "Language: mk\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" |