summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorworo <woro@e10066b5-e1e2-0310-b819-94efdf66514b>2008-02-12 09:49:39 +0000
committerworo <woro@e10066b5-e1e2-0310-b819-94efdf66514b>2008-02-12 09:49:39 +0000
commitdb94d2939c104c9203178df1ba67b18eeaf43bd8 (patch)
tree249666ae1dd78041c105544df52f9106972b6052 /Makefile
parente6f6f469a43e72bed319c3d88f4c1420509532fb (diff)
downloadvdr-plugin-muggle-db94d2939c104c9203178df1ba67b18eeaf43bd8.tar.gz
vdr-plugin-muggle-db94d2939c104c9203178df1ba67b18eeaf43bd8.tar.bz2
use po files for internationalisation, starting with
translations in german and french git-svn-id: https://vdr-muggle.svn.sourceforge.net/svnroot/vdr-muggle/trunk/muggle-plugin@1025 e10066b5-e1e2-0310-b819-94efdf66514b
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile33
1 files changed, 31 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 7363469..7a92f98 100644
--- a/Makefile
+++ b/Makefile
@@ -84,7 +84,7 @@ DEFINES += -DMUSICDIR='"$(MUSICDIR)"'
### The object files (add further files here):
-OBJS = $(PLUGIN).o i18n.o mg_valmap.o mg_thread_sync.o \
+OBJS = $(PLUGIN).o mg_valmap.o mg_thread_sync.o \
mg_item.o mg_item_gd.o mg_listitem.o mg_selection.o mg_sel_gd.o vdr_actions.o vdr_menu.o mg_tools.o \
vdr_decoder_mp3.o vdr_stream.o vdr_decoder.o vdr_player.o \
vdr_setup.o mg_setup.o mg_incremental_search.o mg_image_provider.o
@@ -143,7 +143,7 @@ OBJS += $(DB_OBJ)
### Targets:
-all: libvdr-$(PLUGIN).so mugglei
+all: libvdr-$(PLUGIN).so mugglei i18n
# Dependencies:
@@ -161,9 +161,38 @@ $(DEPFILE): Makefile
$(DB_OBJ): CXXFLAGS += $(DB_CFLAGS)
+### Dependencies:
mg_tables.h: scripts/gentables scripts/genres.txt scripts/iso_639.xml scripts/musictypes.txt scripts/sources.txt
scripts/gentables > $@
+### 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='<vdr-bugs@cadsoft.de>' -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) $(PLAYLIBS) $(SQLLIBS) -o $@
@cp --remove-destination $@ $(LIBDIR)/$@.$(APIVERSION)