diff options
| author | andreas 'randy' weinberger <vdr@smue.org> | 2010-02-28 12:13:17 +0100 |
|---|---|---|
| committer | andreas 'randy' weinberger <vdr@smue.org> | 2010-02-28 12:13:17 +0100 |
| commit | 4efb6e5dca657a4d04d2e995df762054df227a6e (patch) | |
| tree | 11b64601d6bce46c293c0be0aa617befce90ca3c /Makefile | |
| parent | e73252dc58ecd5a27c6d8af94028f311f23687ab (diff) | |
| download | vdr-plugin-graphlcd-4efb6e5dca657a4d04d2e995df762054df227a6e.tar.gz vdr-plugin-graphlcd-4efb6e5dca657a4d04d2e995df762054df227a6e.tar.bz2 | |
added UTF8 support (vdr-graphlcd-0.1.5-utf8_i18n.diff)
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 55 |
1 files changed, 46 insertions, 9 deletions
@@ -9,6 +9,9 @@ # PLUGIN = graphlcd +# define this if you built graphlcd-base with freetype: +HAVE_FREETYPE2 = 1 + ### The version number of this plugin (taken from the main source file): VERSION = $(shell grep 'static const char \*VERSION *=' plugin.c | awk '{ print $$6 }' | sed -e 's/[";]//g') @@ -20,12 +23,11 @@ CXXFLAGS ?= -g -Wall -Woverloaded-virtual ### The directory environment: -DVBDIR = ../../../../DVB VDRDIR = ../../.. LIBDIR = ../../lib TMPDIR = /tmp -export INSTALLPREFIX = /usr/local +export INSTALLPREFIX = /usr export INSTALLDOCDIR = $(INSTALLPREFIX)/share/doc ### Allow user defined options to overwrite defaults: @@ -49,16 +51,27 @@ PACKAGE = vdr-$(ARCHIVE) ### Includes and Defines (add further entries here): -INCLUDES += -I$(VDRDIR)/include -I$(DVBDIR)/include -I$(INSTALLPREFIX)/include +INCLUDES += -I$(VDRDIR)/include -I$(INSTALLPREFIX)/include -DEFINES += -DPLUGIN_NAME_I18N='"$(PLUGIN)"' -DEFINES += -D_GNU_SOURCE +DEFINES += -D_GNU_SOURCE -DPLUGIN_NAME_I18N='"$(PLUGIN)"' +ifdef HAVE_FREETYPE2 + INCLUDES += -I$(INSTALLPREFIX)/include/freetype2 + DEFINES += -DHAVE_FREETYPE2 +endif ### The object files (add further files here): -OBJS = display.o i18n.o layout.o logo.o logolist.o menu.o plugin.o setup.o state.o strfct.o widgets.o +OBJS = display.o layout.o logo.o logolist.o menu.o plugin.o setup.o state.o strfct.o widgets.o + +### The main target: +TARGETS = libvdr-$(PLUGIN).so +ifneq ($(shell grep -l 'Phrases' $(VDRDIR)/i18n.c),$(VDRDIR)/i18n.c) +TARGETS += i18n +endif + +all: $(TARGETS) ### Implicit rules: @@ -76,12 +89,35 @@ $(DEPFILE): Makefile -include $(DEPFILE) -### Targets: +### Internationalization (I18N): -all: libvdr-$(PLUGIN).so -.PHONY: all +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 --no-location -k -ktr -ktrNOOP --msgid-bugs-address='<nobody@domain.com>' -o $@ $^ + +$(I18Npo): $(I18Npot) + msgmerge -U --no-wrap --no-location --backup=none -q $@ $< + @touch $@ + +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: + libvdr-$(PLUGIN).so: $(OBJS) $(CXX) $(CXXFLAGS) -L$(INSTALLPREFIX)/lib -shared $(OBJS) -lglcddrivers -lglcdgraphics -lstdc++ -o $@ @cp $@ $(LIBDIR)/$@.$(APIVERSION) @@ -95,6 +131,7 @@ dist: clean @echo Distribution package created as $(PACKAGE).tgz clean: + @-rm -f $(PODIR)/*.mo $(PODIR)/*.pot @-rm -f *.o $(DEPFILE) *.so *.tgz core* *~ install: all |
