summaryrefslogtreecommitdiff
path: root/PLUGINS/src/hello/Makefile
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2007-08-11 12:39:06 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2007-08-11 12:39:06 +0200
commit0f7a4af1683abfe892cb6d05536818a964d8cfe6 (patch)
tree13bb325aa8f5b390db1227c7875b0e406a43efec /PLUGINS/src/hello/Makefile
parent5b8fe34a0e8398a901eebe42c9385622d9bd7a22 (diff)
downloadvdr-0f7a4af1683abfe892cb6d05536818a964d8cfe6.tar.gz
vdr-0f7a4af1683abfe892cb6d05536818a964d8cfe6.tar.bz2
Switched I18N to gettext
Diffstat (limited to 'PLUGINS/src/hello/Makefile')
-rw-r--r--PLUGINS/src/hello/Makefile38
1 files changed, 33 insertions, 5 deletions
diff --git a/PLUGINS/src/hello/Makefile b/PLUGINS/src/hello/Makefile
index 8deaeaa8..e78b6e1a 100644
--- a/PLUGINS/src/hello/Makefile
+++ b/PLUGINS/src/hello/Makefile
@@ -1,11 +1,13 @@
#
# Makefile for a Video Disk Recorder plugin
#
-# $Id: Makefile 1.15 2006/09/09 12:38:35 kls Exp $
+# $Id: Makefile 1.16 2007/08/11 10:18:16 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.
+# 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 = hello
@@ -45,25 +47,50 @@ DEFINES += -D_GNU_SOURCE -DPLUGIN_NAME_I18N='"$(PLUGIN)"'
### The object files (add further files here):
-OBJS = $(PLUGIN).o i18n.o
+OBJS = $(PLUGIN).o
### Implicit rules:
%.o: %.c
$(CXX) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) $<
-# Dependencies:
+### Dependencies:
-MAKEDEP = g++ -MM -MG
+MAKEDEP = $(CXX) -MM -MG
DEPFILE = .dependencies
$(DEPFILE): Makefile
@$(MAKEDEP) $(DEFINES) $(INCLUDES) $(OBJS:%.o=%.c) > $@
-include $(DEPFILE)
+### Internationalization (I18N):
+
+PODIR = po
+LOCALEDIR = $(VDRDIR)/locale
+I18Npo = $(wildcard $(PODIR)/*.po)
+I18Nmo = $(addsuffix .mo, $(foreach file, $(I18Npo), $(basename $(file))))
+I18Ndirs = $(notdir $(foreach file, $(I18Npo), $(basename $(file))))
+I18Npot = $(PODIR)/$(PLUGIN).pot
+
+%.mo: %.po
+ msgfmt -c -o $@ $<
+
+$(I18Npot): $(wildcard *.c)
+ xgettext -C -cTRANSLATORS --no-wrap -F -k -ktr -ktrNOOP --msgid-bugs-address='<vdr-bugs@cadsoft.de>' -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/$(PLUGIN).mo;\
+ done
+
### Targets:
-all: libvdr-$(PLUGIN).so
+all: libvdr-$(PLUGIN).so i18n
libvdr-$(PLUGIN).so: $(OBJS)
$(CXX) $(CXXFLAGS) -shared $(OBJS) -o $@
@@ -78,4 +105,5 @@ dist: clean
@echo Distribution package created as $(PACKAGE).tgz
clean:
+ @-rm -f $(PODIR)/*.mo $(PODIR)/*.pot
@-rm -f $(OBJS) $(DEPFILE) *.so *.tgz core* *~