summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorMartin Dummer <martin.dummer@gmx.net>2012-07-02 18:40:41 +0200
committerMartin Dummer <martin.dummer@gmx.net>2012-07-02 18:40:41 +0200
commit4b5f7f7b52c1d65dddfd4b7395c1ea5e5b394a88 (patch)
treecd79536b0e2016d1399cff4a7936c722963f5213 /Makefile
parentd0371f3e73e53f6b5383c4d3b66c71f4383263e5 (diff)
downloadvdr-plugin-playlist-master.tar.gz
vdr-plugin-playlist-master.tar.bz2
convert i18n handling to gettextHEADmaster
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile30
1 files changed, 28 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index d07a54b..30bdd1b 100644
--- a/Makefile
+++ b/Makefile
@@ -70,7 +70,7 @@ endif
### The object files (add further files here):
-OBJS = $(PLUGIN).o dataplaylist.o menucontrol.o menuplaylist.o menuplaylists.o menusetup.o i18n.o vdrtools.o
+OBJS = $(PLUGIN).o dataplaylist.o menucontrol.o menuplaylist.o menuplaylists.o menusetup.o vdrtools.o
ifeq ($(shell test $(VDRVERSNUM) -lt 10307 ; echo $$?),0)
OBJS += menuitemtext.o
@@ -90,9 +90,34 @@ $(DEPFILE): Makefile
-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))))))
+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='<martin.dummer@gmx.net>' -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)
+
### Targets:
-all: libvdr-$(PLUGIN).so
+all: libvdr-$(PLUGIN).so i18n
libvdr-$(PLUGIN).so: $(OBJS)
$(CXX) $(CXXFLAGS) -shared $(OBJS) -o $@
@@ -107,4 +132,5 @@ dist: clean
@echo Distribution package created as $(PACKAGE).tgz
clean:
+ @-rm -f $(PODIR)/*.mo $(PODIR)/*.pot
@-rm -f $(OBJS) $(DEPFILE) *.so *.tgz core* *~