From 0f7a4af1683abfe892cb6d05536818a964d8cfe6 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sat, 11 Aug 2007 12:39:06 +0200 Subject: Switched I18N to gettext --- Makefile | 36 ++++++++++++++++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 7aa75f31..a5f9201f 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ # See the main source file 'vdr.c' for copyright information and # how to reach the author. # -# $Id: Makefile 1.101 2007/06/16 10:48:59 kls Exp $ +# $Id: Makefile 1.102 2007/08/11 12:26:12 kls Exp $ .DELETE_ON_ERROR: @@ -17,6 +17,7 @@ CXXFLAGS ?= -g -O2 -Wall -Woverloaded-virtual LSIDIR = ./libsi MANDIR = /usr/local/man BINDIR = /usr/local/bin +LOCDIR = /usr/share/vdr/locale LIBS = -ljpeg -lpthread -ldl -lcap -lfreetype -lfontconfig INCLUDES = -I/usr/include/freetype2 @@ -58,6 +59,7 @@ DEFINES += -D_GNU_SOURCE DEFINES += -DVIDEODIR=\"$(VIDEODIR)\" DEFINES += -DPLUGINDIR=\"$(PLUGINLIBDIR)\" +DEFINES += -DLOCDIR=\"$(LOCDIR)\" # The version numbers of VDR and the plugin API (taken from VDR's "config.h"): @@ -69,7 +71,7 @@ ifdef VFAT DEFINES += -DVFAT endif -all: vdr +all: vdr i18n # Implicit rules: @@ -95,6 +97,35 @@ vdr: $(OBJS) $(SILIB) $(SILIB): $(MAKE) -C $(LSIDIR) all +# Internationalization (I18N): + +PODIR = po +LOCALEDIR = locale +I18Npo = $(wildcard $(PODIR)/*.po) +I18Nmo = $(addsuffix .mo, $(foreach file, $(I18Npo), $(basename $(file)))) +I18Ndirs = $(notdir $(foreach file, $(I18Npo), $(basename $(file)))) +I18Npot = $(PODIR)/vdr.pot + +%.mo: %.po + msgfmt -c -o $@ $< + +$(I18Npot): $(wildcard *.c) + xgettext -C -cTRANSLATORS --no-wrap -F -k -ktr -ktrNOOP --msgid-bugs-address='' -o $@ $(wildcard *.c) + +$(I18Npo): $(I18Npot) + msgmerge -U --no-wrap -F --backup=none -q $@ $< + +i18n: $(I18Nmo) + @mkdir -p $(LOCALEDIR) + for i in $(I18Ndirs); do\ + mkdir -p $(LOCALEDIR)/$$i/LC_MESSAGES;\ + cp $(PODIR)/$$i.mo $(LOCALEDIR)/$$i/LC_MESSAGES/vdr.mo;\ + done + +install-i18n: + @mkdir -p $(LOCDIR) + @(cd $(LOCALEDIR); cp -r --parents * $(LOCDIR)) + # The 'include' directory (for plugins): include-dir: @@ -169,6 +200,7 @@ srcdoc: clean: $(MAKE) -C $(LSIDIR) clean -rm -f $(OBJS) $(DEPFILE) vdr core* *~ + -rm -rf $(LOCALEDIR) $(PODIR)/*.mo $(PODIR)/*.pot -rm -rf include -rm -rf srcdoc CLEAN: clean -- cgit v1.2.3