Project

General

Profile

Feature #2547 » markad-makefile.patch

horchi, 01/29/2018 07:28 PM

View differences:

Makefile
#
# Makefile for a Video Disk Recorder plugin + program
#
# dont remove the next line, its needed for the VDR Makefile
# dont remove the next two lines, its needed for the VDR Makefile
# $(LIBDIR)/$@.$(APIVERSION)
# PKGCFG
DIRS = command plugin
......
install:
for i in $(DIRS); do $(MAKE) -C $$i install; done
dist:
dist:
@-rm -rf $(TMPDIR)/$(ARCHIVE)
@mkdir $(TMPDIR)/$(ARCHIVE)
@mkdir $(TMPDIR)/$(ARCHIVE)/plugin
......
@cp -a plugin/*.cpp plugin/*.h plugin/Makefile $(TMPDIR)/$(ARCHIVE)/plugin
@cp -a plugin/dist/* $(TMPDIR)/$(ARCHIVE)/plugin/dist
@cp -a plugin/po/*.po $(TMPDIR)/$(ARCHIVE)/plugin/po
@cp -a command/*.cpp command/*.h command/*.1 command/Makefile $(TMPDIR)/$(ARCHIVE)/command
@cp -a command/*.cpp command/*.h command/*.1 command/Makefile $(TMPDIR)/$(ARCHIVE)/command
@cp -u command/logos/*.pgm $(TMPDIR)/$(ARCHIVE)/command/logos
@cp -a command/po/*.po $(TMPDIR)/$(ARCHIVE)/command/po
@cp -a *.dist *.h COPYING HISTORY README INSTALL Makefile $(TMPDIR)/$(ARCHIVE)
plugin/Makefile
$(shell GITVERSION=`git rev-parse --short HEAD 2> /dev/null`; if [ "$$GITVERSION" ]; then sed "s/\";/ ($$GITVERSION)\";/" ../version.dist > ../version.h; else cp ../version.dist ../version.h; fi)
VERSION = $(shell grep 'static const char \*VERSION *=' ../version.h | awk '{ print $$6 }' | sed -e 's/[";]//g')
### The C++ compiler and options:
CXX ?= g++
CXXFLAGS ?= -fPIC -g -O2 -Wall -Wextra -Woverloaded-virtual -Wno-parentheses
### The directory environment:
VDRDIR ?= ../../../..
LIBDIR ?= ../../../lib
# 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 = $(call PKGCFG,libdir)
LOCDIR = $(call PKGCFG,locdir)
PLGCFG = $(call PKGCFG,plgcfg)
#
TMPDIR ?= /tmp
### Make sure that necessary options are included:
### The compiler options:
-include $(VDRDIR)/Make.global
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
APIVERSION = $(call PKGCFG,apiversion)
### The version number of VDR's plugin API (taken from VDR's "config.h"):
### Allow user defined options to overwrite defaults:
APIVERSION = $(shell sed -ne '/define APIVERSION/s/^.*"\(.*\)".*$$/\1/p' $(VDRDIR)/config.h)
-include $(PLGCFG)
### 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 += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
DEFINES += -DPLUGIN_NAME_I18N='"$(PLUGIN)"' -D__EXCL_PLUGINS='""$(EXCLUDEPLUGINS)""'
DEFINES += -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
### The object files (add further files here):
OBJS = $(PLUGIN).o status.o menu.o setup.o
OBJS = $(PLUGIN).o status.o menu.o setup.o
### The main target:
all: libvdr-$(PLUGIN).so i18n
all: $(SOFILE) i18n
### Implicit rules:
%.o: %.cpp
$(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=%.cpp) > $@
@$(MAKEDEP) $(CXXFLAGS) $(DEFINES) $(INCLUDES) $(OBJS:%.o=%.cpp) > $@
-include $(DEPFILE)
### 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))))))
I18Nmo = $(addsuffix .mo, $(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
msgfmt -c -o $@ $<
$(I18Npot): $(wildcard *.cpp *.h)
xgettext -C -cTRANSLATORS --no-wrap --no-location -k -ktr -ktrNOOP --msgid-bugs-address='<see README>' -o $@ $^
$(I18Npot): $(wildcard *.cpp)
xgettext -C -cTRANSLATORS --no-wrap --no-location -k -ktr -ktrNOOP --package-name=vdr-$(PLUGIN) --package-version=$(VERSION) --msgid-bugs-address='<see README>' -o $@ `ls $^`
%.po: $(I18Npot)
msgmerge -U --no-wrap --no-location --backup=none -q $@ $<
msgmerge -U --no-wrap --no-location --backup=none -q -N $@ $<
@touch $@
$(I18Nmsgs): $(LOCALEDIR)/%/LC_MESSAGES/vdr-$(PLUGIN).mo: $(PODIR)/%.mo
@mkdir -p $(dir $@)
cp $< $@
$(I18Nmsgs): $(DESTDIR)$(LOCDIR)/%/LC_MESSAGES/vdr-$(PLUGIN).mo: $(PODIR)/%.mo
install -D -m644 $< $@
.PHONY: i18n
i18n: $(I18Nmsgs) $(I18Npot)
i18n: $(I18Nmo) $(I18Npot)
### Targets:
install: all
cp --remove-destination libvdr-$(PLUGIN).so $(LIBDIR)/libvdr-$(PLUGIN).so.$(APIVERSION)
$(SOFILE): $(OBJS)
$(CXX) $(CXXFLAGS) $(LDFLAGS) -shared $(OBJS) -o $@
libvdr-$(PLUGIN).so: $(OBJS)
$(CXX) $(CXXFLAGS) -shared $(OBJS) $(LIBS) -o $@
cp --remove-destination libvdr-$(PLUGIN).so $(LIBDIR)/libvdr-$(PLUGIN).so.$(APIVERSION)
install: $(SOFILE)
install -D $^ $(DESTDIR)$(LIBDIR)/$^.$(APIVERSION)
clean:
@-rm -f $(OBJS) $(DEPFILE) *.so *.so.* *.tgz core* *~ $(PODIR)/*.mo $(PODIR)/*.pot
plugin/po/sk_SK.po
msgstr ""
"Project-Id-Version: markad\n"
"Report-Msgid-Bugs-To: <see README>\n"
"POT-Creation-Date: 2013-04-01 12:17+0200\n"
"POT-Creation-Date: 2018-01-29 19:23+0100\n"
"PO-Revision-Date: 2011-03-01 20:26+0100\n"
"Last-Translator: milan hrala <hrala.milan@gmail.com>\n"
"Language-Team: milan hrala <grala.milan@gmail.com>\n"
"Language: \n"
"Language: sk\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
......
msgid "back"
msgstr "späť"
msgid "Mark advertisements"
msgstr "Značkovač reklamy"
#~ msgid "Mark advertisements"
#~ msgstr "Značkovač reklamy"
    (1-1/1)