diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 30 |
1 files changed, 28 insertions, 2 deletions
@@ -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/*~ |