summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorAndreas Brachold <vdr07@deltab.de>2007-08-22 09:27:33 +0000
committerAndreas Brachold <vdr07@deltab.de>2007-08-22 09:27:33 +0000
commitf9472b1e58f206defb77c5caf55fcef1618829ba (patch)
tree5fd9c7a567549d61c67a9bc065cb6a1e2dbc578b /Makefile
parent599ab946697b1dd053c467619e04456ccb71789b (diff)
downloadvdr-plugin-image-f9472b1e58f206defb77c5caf55fcef1618829ba.tar.gz
vdr-plugin-image-f9472b1e58f206defb77c5caf55fcef1618829ba.tar.bz2
- begin developer series 0.3.x
- Use now gettext for i18n texts, introduced with vdr-1.5.8 (Required)
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile30
1 files changed, 28 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 1963e1e..b5b247f 100644
--- a/Makefile
+++ b/Makefile
@@ -121,7 +121,7 @@ endif
### The object files (add further files here):
-OBJS = ${PLUGIN}.o i18n.o data.o menu.o data-image.o menu-image.o \
+OBJS = ${PLUGIN}.o data.o menu.o data-image.o menu-image.o \
setup-image.o player-image.o control-image.o commands.o menu-commands.o \
list.o
@@ -148,9 +148,34 @@ $(DEPFILE): Makefile
-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='<anbr@user.berlios.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/vdr-$(PLUGIN).mo;\
+ done
+
### Targets:
-all: subdirs libvdr-$(PLUGIN).so
+all: subdirs libvdr-$(PLUGIN).so i18n
libvdr-$(PLUGIN).so: $(OBJS)
$(CXX) $(CXXFLAGS) -shared -export-dynamic $(OBJS) $(LIBS) -o $@
@@ -189,4 +214,5 @@ subdirs-clean:
done
clean: subdirs-clean
+ @-rm -f $(PODIR)/*.mo $(PODIR)/*.pot
@-rm -f $(OBJS) $(DEPFILE) *.so *.tar.gz core* *~ contrib/*~ examples/*~ scripts/*~