diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 58 |
1 files changed, 40 insertions, 18 deletions
@@ -1,14 +1,13 @@ -############################################################################### # -# uncomment if you use the pin-plugin and want to protect your recordings -#WITHPINPLUGIN=1 +# Makefile for a Video Disk Recorder plugin # -############################################################################### - +# $Id$ # 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 = extrecmenu @@ -19,7 +18,7 @@ VERSION = $(shell grep 'static const char \*VERSION *=' $(PLUGIN).c | awk '{ pri ### The C++ compiler and options: CXX ?= g++ -CXXFLAGS ?= -fPIC -g -O2 -Wall -Woverloaded-virtual +CXXFLAGS ?= -fPIC -g -O2 -Wall -Woverloaded-virtual -Wno-parentheses ### The directory environment: @@ -31,7 +30,7 @@ TMPDIR = /tmp -include $(VDRDIR)/Make.config -### The version number of VDR / VDR's plugin API (taken from VDR's "config.h"): +### The version number of VDR's plugin API (taken from VDR's "config.h"): APIVERSION = $(shell sed -ne '/define APIVERSION/s/^.*"\(.*\)".*$$/\1/p' $(VDRDIR)/config.h) @@ -46,21 +45,21 @@ INCLUDES += -I$(VDRDIR)/include DEFINES += -D_GNU_SOURCE -DPLUGIN_NAME_I18N='"$(PLUGIN)"' -ifdef WITHPINPLUGIN - DEFINES+=-DWITHPINPLUGIN -endif - ### The object files (add further files here): -OBJS = $(PLUGIN).o mymenurecordings.o myreplaycontrol.o i18n.o \ - mymenusetup.o mymenucommands.o patchfont.o tools.o mymenueditrecording.o +OBJS = $(PLUGIN).o mymenurecordings.o mymenueditrecording.o myreplaycontrol.o \ + mymenucommands.o mymenusetup.o tools.o i18n.o + +### The main target: + +all: libvdr-$(PLUGIN).so i18n ### Implicit rules: %.o: %.c $(CXX) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) $< -# Dependencies: +### Dependencies: MAKEDEP = $(CXX) -MM -MG DEPFILE = .dependencies @@ -69,13 +68,36 @@ $(DEPFILE): Makefile -include $(DEPFILE) -### Targets: +### Internationalization (I18N): + +PODIR = po +LOCALEDIR = $(VDRDIR)/locale +I18Npo = $(wildcard $(PODIR)/*.po) +I18Nmsgs = $(addprefix $(LOCALEDIR)/, $(addsuffix /LC_MESSAGES/vdr-$(PLUGIN).mo, $(notdir $(foreach file, $(I18Npo), $(basename $(file)))))) +I18Npot = $(PODIR)/$(PLUGIN).pot -all: libvdr-$(PLUGIN).so +%.mo: %.po + msgfmt -c -o $@ $< + +$(I18Npot): $(wildcard *.c) + xgettext -C -cTRANSLATORS --no-wrap --no-location -k -ktr -ktrNOOP --msgid-bugs-address='<see README>' -o $@ $^ + +%.po: $(I18Npot) + msgmerge -U --no-wrap --no-location --backup=none -q $@ $< + @touch $@ + +$(I18Nmsgs): $(LOCALEDIR)/%/LC_MESSAGES/vdr-$(PLUGIN).mo: $(PODIR)/%.mo + @mkdir -p $(dir $@) + cp $< $@ + +.PHONY: i18n +i18n: $(I18Nmsgs) $(I18Npot) + +### Targets: libvdr-$(PLUGIN).so: $(OBJS) $(CXX) $(CXXFLAGS) -shared $(OBJS) -o $@ - @cp $@ $(LIBDIR)/$@.$(APIVERSION) + @cp --remove-destination $@ $(LIBDIR)/$@.$(APIVERSION) dist: clean @-rm -rf $(TMPDIR)/$(ARCHIVE) @@ -86,4 +108,4 @@ dist: clean @echo Distribution package created as $(PACKAGE).tgz clean: - @-rm -f $(OBJS) $(DEPFILE) *.so *.tgz core* *~ + @-rm -f $(OBJS) $(DEPFILE) *.so *.tgz core* *~ $(PODIR)/*.mo $(PODIR)/*.pot |