diff options
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 47 |
1 files changed, 34 insertions, 13 deletions
@@ -16,7 +16,7 @@ VERSION = $(shell grep 'static const char \*VERSION *=' $(PLUGIN).c | awk '{ pri ### The C++ compiler and options: CXX ?= g++ -CXXFLAGS ?= -g -O2 -Wall -Woverloaded-virtual +CXXFLAGS ?= -fPIC -g -O2 -Wall -Woverloaded-virtual ### The directory environment: @@ -31,7 +31,7 @@ TMPDIR = /tmp ### The version number of VDR (taken from VDR's "config.h"): -VDRVERSION = $(shell grep 'define VDRVERSION ' $(VDRDIR)/config.h | awk '{ print $$3 }' | sed -e 's/"//g') +APIVERSION = $(shell sed -ne '/define APIVERSION/s/^.*"\(.*\)".*$$/\1/p' $(VDRDIR)/config.h) ### The name of the distribution archive: @@ -48,11 +48,14 @@ DEFINES += -DPLUGIN_NAME_I18N='"$(PLUGIN)"' ### The object files (add further files here): OBJS = $(PLUGIN).o ttxtsubsdisplayer.o ttxtsubsdisplay.o teletext.o siinfo.o \ - ttxtsubsfilter.o ttxtsubsrecorder.o ttxtsubsreceiver.o ttxtsubsi18n.o + ttxtsubsfilter.o ttxtsubsrecorder.o ttxtsubsreceiver.o ttxtsubsi18n.o \ + ttxtsubspagemenu.o ttxtsubschannelsettings.o SOURCEFILES = *.c *.h [A-Z]???* contrib ### Implicit rules: +.PHONY: all all-redirect +all-redirect: all %.o: %.c $(CXX) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) $< @@ -66,14 +69,39 @@ $(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='<author>' -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: libvdr-$(PLUGIN).so +all: libvdr-$(PLUGIN).so i18n @sh ./Checkpatch.sh libvdr-$(PLUGIN).so: $(OBJS) $(CXX) $(CXXFLAGS) -shared $(OBJS) -o $@ - @cp $@ $(LIBDIR)/$@.$(VDRVERSION) + @cp $@ $(LIBDIR)/$@.$(APIVERSION) dist: clean @-rm -rf $(TMPDIR)/$(ARCHIVE) @@ -95,15 +123,8 @@ bup: clean @echo done. clean: + @-rm -f $(PODIR)/*.mo $(PODIR)/*.pot @-rm -f $(OBJS) $(DEPFILE) *.so *.tgz core* *~ -#ci: patch ci: ci -u $(SOURCEFILES) - -patch: - co -l xVDR.patch.temp vdrttxtsubshooks.c vdrttxtsubshooks.h - (cd ../../../; diff -upr ./DIST/* .) | grep -v "Only in ." > xVDR.patch.temp - cp -p ../../../vdrttxtsubshooks.c . - cp -p ../../../vdrttxtsubshooks.h . - ci -u xVDR.patch.temp vdrttxtsubshooks.c vdrttxtsubshooks.h |
