summaryrefslogtreecommitdiff
path: root/PLUGINS/src/hello/Makefile
diff options
context:
space:
mode:
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 8deaeaa..e78b6e1 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* *~