From 27f9ad3da60c42a1b982929986d9f20eae9d0049 Mon Sep 17 00:00:00 2001 From: Dimitar Petrovski Date: Thu, 3 Jan 2013 10:08:14 +0100 Subject: modified Makefile according to the new VDR version 1.7.35 style --- Makefile | 112 ++++++++++++++++++++++++++++++++------------------------------- 1 file changed, 57 insertions(+), 55 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 49e8770..78911e9 100644 --- a/Makefile +++ b/Makefile @@ -28,58 +28,57 @@ PLUGIN = eepg VERSION = $(shell grep 'static const char \*VERSION *=' $(PLUGIN).c | awk '{ print $$6 }' | sed -e 's/[";]//g') -### The C++ compiler and options: +### The directory environment: -CXX ?= g++ -CXXFLAGS ?= -O2 -fPIC -Wall -Woverloaded-virtual +# Use package data if installed...otherwise assume we're under the VDR source directory: +PKGCFG = $(if $(VDRDIR),$(shell pkg-config --variable=$(1) $(VDRDIR)/vdr.pc),$(shell pkg-config --variable=$(1) vdr || pkg-config --variable=$(1) ../../../vdr.pc)) +LIBDIR = $(DESTDIR)$(call PKGCFG,libdir) +LOCDIR = $(DESTDIR)$(call PKGCFG,locdir) +PLGCFG = $(call PKGCFG,plgcfg) +# +TMPDIR ?= /tmp -### The directory environment: +### The compiler options: -VDRDIR = ../../.. -LIBDIR = ../../lib -TMPDIR = /tmp +export CFLAGS = $(call PKGCFG,cflags) +export CXXFLAGS = $(call PKGCFG,cxxflags) -### Allow user defined options to overwrite defaults: +### The version number of VDR's plugin API: --include $(VDRDIR)/Make.config --include Make.config +APIVERSION = $(call PKGCFG,apiversion) -### The version number of VDR (taken from VDR's "config.h"): +### Allow user defined options to overwrite defaults: -VDRVERSION = $(shell sed -ne '/define VDRVERSION/ s/^.*"\(.*\)".*$$/\1/p' $(VDRDIR)/config.h) -APIVERSION = $(shell sed -ne '/define APIVERSION/ s/^.*"\(.*\)".*$$/\1/p' $(VDRDIR)/config.h) -ifeq ($(strip $(APIVERSION)),) - APIVERSION = $(VDRVERSION) -endif +-include $(PLGCFG) +-include Make.config ### The name of the distribution archive: ARCHIVE = $(PLUGIN)-$(VERSION) PACKAGE = vdr-$(ARCHIVE) +### The name of the shared object file: + +SOFILE = libvdr-$(PLUGIN).so + ### Includes and Defines (add further entries here): INCLUDES += -I$(VDRDIR)/include -DEFINES += -D_GNU_SOURCE -DPLUGIN_NAME_I18N='"$(PLUGIN)"' +DEFINES += -DPLUGIN_NAME_I18N='"$(PLUGIN)"' ### The object files (add further files here): OBJS = $(PLUGIN).o dish.o epghandler.o setupeepg.o equivhandler.o util.o eit2.o -ifdef DBG -CXXFLAGS += -g -endif +### The main target: -### Internationalization (I18N): +all: $(SOFILE) i18n -PODIR = po -I18Npot = $(PODIR)/$(PLUGIN).pot -I18Nmsgs = $(addprefix $(LOCALEDIR)/,$(addsuffix /LC_MESSAGES/vdr-$(PLUGIN).mo,$(notdir $(foreach file, $(wildcard $(PODIR)/*.po), $(basename $(file)))))) -LOCALEDIR = $(VDRDIR)/locale +### Implicit rules: -### Default Target -default: $(OBJS) +%.o: %.c + $(CXX) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) $< ### Dependencies: @@ -90,47 +89,50 @@ $(DEPFILE): Makefile -include $(DEPFILE) -### Targets: - -TARGETS = libvdr-$(PLUGIN).so -ifneq ($(shell grep -l 'Phrases' $(VDRDIR)/i18n.c),$(VDRDIR)/i18n.c) -TARGETS += i18n -endif - -all: $(TARGETS) -.PHONY: i18n +### Internationalization (I18N): -%.o: %.c - $(CXX) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) $< +PODIR = po +I18Npo = $(wildcard $(PODIR)/*.po) +I18Nmo = $(addsuffix .mo, $(foreach file, $(I18Npo), $(basename $(file)))) +I18Nmsgs = $(addprefix $(LOCDIR)/, $(addsuffix /LC_MESSAGES/vdr-$(PLUGIN).mo, $(notdir $(foreach file, $(I18Npo), $(basename $(file)))))) +I18Npot = $(PODIR)/$(PLUGIN).pot -libvdr-$(PLUGIN).so: $(OBJS) - $(CXX) $(CXXFLAGS) -shared $(OBJS) -o $@ - @cp $@ $(LIBDIR)/$@.$(APIVERSION) +%.mo: %.po + msgfmt -c -o $@ $< -$(I18Npot): $(shell grep -rl '\(tr\|trNOOP\)(\".*\")' *.c $(SYSDIR)) - xgettext -C -cTRANSLATORS --no-wrap -F -k -ktr -ktrNOOP -o $@ $^ +$(I18Npot): $(wildcard *.c) + xgettext -C -cTRANSLATORS --no-wrap --no-location -k -ktr -ktrNOOP --package-name=vdr-$(PLUGIN) --package-version=$(VERSION) --msgid-bugs-address='' -o $@ `ls $^` %.po: $(I18Npot) - msgmerge -U --no-wrap -F --backup=none -q $@ $< + msgmerge -U --no-wrap --no-location --backup=none -q -N $@ $< @touch $@ -%.mo: %.po - msgfmt -c -o $@ $< +$(I18Nmsgs): $(LOCDIR)/%/LC_MESSAGES/vdr-$(PLUGIN).mo: $(PODIR)/%.mo + install -D -m644 $< $@ + +.PHONY: i18n +i18n: $(I18Nmo) $(I18Npot) + +install-i18n: $(I18Nmsgs) + +### Targets: + +$(SOFILE): $(OBJS) + $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared $(OBJS) -o $@ -$(I18Nmsgs): $(LOCALEDIR)/%/LC_MESSAGES/vdr-$(PLUGIN).mo: $(PODIR)/%.mo - @mkdir -p $(dir $@) - cp $< $@ +install-lib: $(SOFILE) + install -D $^ $(LIBDIR)/$^.$(APIVERSION) -i18n: $(I18Nmsgs) +install: install-lib install-i18n -dist: clean +dist: $(I18Npo) clean @-rm -rf $(TMPDIR)/$(ARCHIVE) @mkdir $(TMPDIR)/$(ARCHIVE) @cp -a * $(TMPDIR)/$(ARCHIVE) - @tar czf $(PACKAGE).tar.gz -C $(TMPDIR) $(ARCHIVE) + @tar czf $(PACKAGE).tgz -C $(TMPDIR) $(ARCHIVE) @-rm -rf $(TMPDIR)/$(ARCHIVE) - @echo Distribution package created as $(PACKAGE).tar.gz + @echo Distribution package created as $(PACKAGE).tgz clean: - @-rm -f $(OBJS) $(DEPFILE) *.so *.tar.gz core* *~ -# @-rm -f $(PODIR)/*.mo $(PODIR)/*.pot + @-rm -f $(PODIR)/*.mo $(PODIR)/*.pot + @-rm -f $(OBJS) $(DEPFILE) *.so *.tgz core* *~ -- cgit v1.2.3 From 33a1abb417fd2107408fb16b7151f142a338d91f Mon Sep 17 00:00:00 2001 From: Dimitar Petrovski Date: Sun, 27 Jan 2013 17:07:43 +0100 Subject: fix makefile since there is no po in master --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 78911e9..3348ece 100644 --- a/Makefile +++ b/Makefile @@ -73,7 +73,7 @@ OBJS = $(PLUGIN).o dish.o epghandler.o setupeepg.o equivhandler.o util.o eit2.o ### The main target: -all: $(SOFILE) i18n +all: $(SOFILE) ### Implicit rules: -- cgit v1.2.3 From 55dbd5a167d7fccd2ca8a67de8ce24543a5a8d3b Mon Sep 17 00:00:00 2001 From: Dimitar Petrovski Date: Thu, 31 Jan 2013 08:40:42 +0100 Subject: Makefile again adapted to vdr-1.7.36. Closes #1234 --- Makefile | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 3348ece..637463f 100644 --- a/Makefile +++ b/Makefile @@ -32,8 +32,8 @@ VERSION = $(shell grep 'static const char \*VERSION *=' $(PLUGIN).c | awk '{ pri # Use package data if installed...otherwise assume we're under the VDR source directory: PKGCFG = $(if $(VDRDIR),$(shell pkg-config --variable=$(1) $(VDRDIR)/vdr.pc),$(shell pkg-config --variable=$(1) vdr || pkg-config --variable=$(1) ../../../vdr.pc)) -LIBDIR = $(DESTDIR)$(call PKGCFG,libdir) -LOCDIR = $(DESTDIR)$(call PKGCFG,locdir) +LIBDIR = $(call PKGCFG,libdir) +LOCDIR = $(call PKGCFG,locdir) PLGCFG = $(call PKGCFG,plgcfg) # TMPDIR ?= /tmp @@ -78,14 +78,14 @@ all: $(SOFILE) ### Implicit rules: %.o: %.c - $(CXX) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) $< + $(CXX) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) -o $@ $< ### Dependencies: MAKEDEP = $(CXX) -MM -MG DEPFILE = .dependencies $(DEPFILE): Makefile - @$(MAKEDEP) $(DEFINES) $(INCLUDES) $(OBJS:%.o=%.c) > $@ + @$(MAKEDEP) $(CXXFLAGS) $(DEFINES) $(INCLUDES) $(OBJS:%.o=%.c) > $@ -include $(DEPFILE) @@ -94,7 +94,7 @@ $(DEPFILE): Makefile PODIR = po I18Npo = $(wildcard $(PODIR)/*.po) I18Nmo = $(addsuffix .mo, $(foreach file, $(I18Npo), $(basename $(file)))) -I18Nmsgs = $(addprefix $(LOCDIR)/, $(addsuffix /LC_MESSAGES/vdr-$(PLUGIN).mo, $(notdir $(foreach file, $(I18Npo), $(basename $(file)))))) +I18Nmsgs = $(addprefix $(DESTDIR)$(LOCDIR)/, $(addsuffix /LC_MESSAGES/vdr-$(PLUGIN).mo, $(notdir $(foreach file, $(I18Npo), $(basename $(file)))))) I18Npot = $(PODIR)/$(PLUGIN).pot %.mo: %.po @@ -107,7 +107,7 @@ $(I18Npot): $(wildcard *.c) msgmerge -U --no-wrap --no-location --backup=none -q -N $@ $< @touch $@ -$(I18Nmsgs): $(LOCDIR)/%/LC_MESSAGES/vdr-$(PLUGIN).mo: $(PODIR)/%.mo +$(I18Nmsgs): $(DESTDIR)$(LOCDIR)/%/LC_MESSAGES/vdr-$(PLUGIN).mo: $(PODIR)/%.mo install -D -m644 $< $@ .PHONY: i18n @@ -121,7 +121,7 @@ $(SOFILE): $(OBJS) $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared $(OBJS) -o $@ install-lib: $(SOFILE) - install -D $^ $(LIBDIR)/$^.$(APIVERSION) + install -D $^ $(DESTDIR)$(LIBDIR)/$^.$(APIVERSION) install: install-lib install-i18n -- cgit v1.2.3 From 69b47ba4bf0195fd6820beb2cf4f7c7ea31f4011 Mon Sep 17 00:00:00 2001 From: Dimitar Petrovski Date: Tue, 7 Jan 2014 19:13:51 +0100 Subject: Updated PKGCFG variable --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 637463f..c7b93d0 100644 --- a/Makefile +++ b/Makefile @@ -31,7 +31,7 @@ VERSION = $(shell grep 'static const char \*VERSION *=' $(PLUGIN).c | awk '{ pri ### The directory environment: # Use package data if installed...otherwise assume we're under the VDR source directory: -PKGCFG = $(if $(VDRDIR),$(shell pkg-config --variable=$(1) $(VDRDIR)/vdr.pc),$(shell pkg-config --variable=$(1) vdr || pkg-config --variable=$(1) ../../../vdr.pc)) +PKGCFG = $(if $(VDRDIR),$(shell pkg-config --variable=$(1) $(VDRDIR)/vdr.pc),$(shell PKG_CONFIG_PATH="$$PKG_CONFIG_PATH:../../.." pkg-config --variable=$(1) vdr)) LIBDIR = $(call PKGCFG,libdir) LOCDIR = $(call PKGCFG,locdir) PLGCFG = $(call PKGCFG,plgcfg) -- cgit v1.2.3