summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorMartin Prochnow <nordlicht@martins-kabuff.de>2008-03-22 16:45:02 +0100
committerAndreas Mair <andreas@vdr-developer.org>2008-03-22 16:45:02 +0100
commit23f4f2114e7d48bb4bbe5e50aa6ddce0f1c21bd2 (patch)
tree65ec19823baa6f900495290b9d0e8497f12115ee /Makefile
parent3b617b561f901e8f7a5f8991bc1d51e1ee800142 (diff)
downloadvdr-plugin-extrecmenu-23f4f2114e7d48bb4bbe5e50aa6ddce0f1c21bd2.tar.gz
vdr-plugin-extrecmenu-23f4f2114e7d48bb4bbe5e50aa6ddce0f1c21bd2.tar.bz2
Version 1.2-test1v1.2-test1
- added italian translation; thanks to Diego - added support for GraphTFT-plugin; thanks to Jörg Wendel for the patch - added support for true type fonts and UTF-8; thanks to Andreas Mair for the true type font and the patch - removed patch font routine because it is useless now - added true type font containing the needed icons - changed i18n support to gettext
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile58
1 files changed, 40 insertions, 18 deletions
diff --git a/Makefile b/Makefile
index cf2413a..8a25a19 100644
--- a/Makefile
+++ b/Makefile
@@ -1,14 +1,13 @@
-###############################################################################
#
-# uncomment if you use the pin-plugin and want to protect your recordings
-#WITHPINPLUGIN=1
+# Makefile for a Video Disk Recorder plugin
#
-###############################################################################
-
+# $Id$
# 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.
+# IMPORTANT: the presence of this macro is important for the Make.config
+# file. So it must be defined, even if it is not used here!
#
PLUGIN = extrecmenu
@@ -19,7 +18,7 @@ VERSION = $(shell grep 'static const char \*VERSION *=' $(PLUGIN).c | awk '{ pri
### The C++ compiler and options:
CXX ?= g++
-CXXFLAGS ?= -fPIC -g -O2 -Wall -Woverloaded-virtual
+CXXFLAGS ?= -fPIC -g -O2 -Wall -Woverloaded-virtual -Wno-parentheses
### The directory environment:
@@ -31,7 +30,7 @@ TMPDIR = /tmp
-include $(VDRDIR)/Make.config
-### The version number of VDR / VDR's plugin API (taken from VDR's "config.h"):
+### The version number of VDR's plugin API (taken from VDR's "config.h"):
APIVERSION = $(shell sed -ne '/define APIVERSION/s/^.*"\(.*\)".*$$/\1/p' $(VDRDIR)/config.h)
@@ -46,21 +45,21 @@ INCLUDES += -I$(VDRDIR)/include
DEFINES += -D_GNU_SOURCE -DPLUGIN_NAME_I18N='"$(PLUGIN)"'
-ifdef WITHPINPLUGIN
- DEFINES+=-DWITHPINPLUGIN
-endif
-
### The object files (add further files here):
-OBJS = $(PLUGIN).o mymenurecordings.o myreplaycontrol.o i18n.o \
- mymenusetup.o mymenucommands.o patchfont.o tools.o mymenueditrecording.o
+OBJS = $(PLUGIN).o mymenurecordings.o mymenueditrecording.o myreplaycontrol.o \
+ mymenucommands.o mymenusetup.o tools.o i18n.o
+
+### The main target:
+
+all: libvdr-$(PLUGIN).so i18n
### Implicit rules:
%.o: %.c
$(CXX) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) $<
-# Dependencies:
+### Dependencies:
MAKEDEP = $(CXX) -MM -MG
DEPFILE = .dependencies
@@ -69,13 +68,36 @@ $(DEPFILE): Makefile
-include $(DEPFILE)
-### Targets:
+### 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))))))
+I18Npot = $(PODIR)/$(PLUGIN).pot
-all: libvdr-$(PLUGIN).so
+%.mo: %.po
+ msgfmt -c -o $@ $<
+
+$(I18Npot): $(wildcard *.c)
+ xgettext -C -cTRANSLATORS --no-wrap --no-location -k -ktr -ktrNOOP --msgid-bugs-address='<see README>' -o $@ $^
+
+%.po: $(I18Npot)
+ msgmerge -U --no-wrap --no-location --backup=none -q $@ $<
+ @touch $@
+
+$(I18Nmsgs): $(LOCALEDIR)/%/LC_MESSAGES/vdr-$(PLUGIN).mo: $(PODIR)/%.mo
+ @mkdir -p $(dir $@)
+ cp $< $@
+
+.PHONY: i18n
+i18n: $(I18Nmsgs) $(I18Npot)
+
+### Targets:
libvdr-$(PLUGIN).so: $(OBJS)
$(CXX) $(CXXFLAGS) -shared $(OBJS) -o $@
- @cp $@ $(LIBDIR)/$@.$(APIVERSION)
+ @cp --remove-destination $@ $(LIBDIR)/$@.$(APIVERSION)
dist: clean
@-rm -rf $(TMPDIR)/$(ARCHIVE)
@@ -86,4 +108,4 @@ dist: clean
@echo Distribution package created as $(PACKAGE).tgz
clean:
- @-rm -f $(OBJS) $(DEPFILE) *.so *.tgz core* *~
+ @-rm -f $(OBJS) $(DEPFILE) *.so *.tgz core* *~ $(PODIR)/*.mo $(PODIR)/*.pot