Gentoo Archives: gentoo-commits

From: "Joerg Bornkessel (hd_brummy)" <hd_brummy@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in media-plugins/vdr-permashift/files: permashift.mk
Date: Sun, 31 Mar 2013 13:07:03
Message-Id: 20130331130659.517F720081@flycatcher.gentoo.org
1 hd_brummy 13/03/31 13:06:59
2
3 Added: permashift.mk
4 Log:
5 bump
6
7 (Portage version: 2.1.11.50/cvs/Linux i686, signed Manifest commit with key 34C2808A)
8
9 Revision Changes Path
10 1.1 media-plugins/vdr-permashift/files/permashift.mk
11
12 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-plugins/vdr-permashift/files/permashift.mk?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-plugins/vdr-permashift/files/permashift.mk?rev=1.1&content-type=text/plain
14
15 Index: permashift.mk
16 ===================================================================
17 #
18 # Makefile for a Video Disk Recorder plugin
19 #
20 # $Id: permashift.mk,v 1.1 2013/03/31 13:06:59 hd_brummy Exp $
21
22 # The official name of this plugin.
23 # This name will be used in the '-P...' option of VDR to load the plugin.
24 # By default the main source file also carries this name.
25
26 # add the name of the plugin, next edit the OBJS line,
27 PLUGIN = permashift
28
29 ### The version number of this plugin (taken from the main source file):
30
31 VERSION = $(shell grep 'static const char \*VERSION *=' $(PLUGIN).c | awk '{ print $$6 }' | sed -e 's/[";]//g')
32
33 ### The directory environment:
34
35 # Use package data if installed...otherwise assume we're under the VDR source directory:
36 PKGCFG = $(if $(VDRDIR),$(shell pkg-config --variable=$(1) $(VDRDIR)/vdr.pc),$(shell pkg-config --variable=$(1) vdr || pkg-config --variable=$(1) ../../../vdr.pc))
37 LIBDIR = $(call PKGCFG,libdir)
38 LOCDIR = $(call PKGCFG,locdir)
39 PLGCFG = $(call PKGCFG,plgcfg)
40 #
41 TMPDIR ?= /tmp
42
43 ### The compiler options:
44
45 export CFLAGS = $(call PKGCFG,cflags)
46 export CXXFLAGS = $(call PKGCFG,cxxflags)
47
48 ### The version number of VDR's plugin API:
49
50 APIVERSION = $(call PKGCFG,apiversion)
51
52 ### Allow user defined options to overwrite defaults:
53
54 -include $(PLGCFG)
55
56 ### The name of the distribution archive:
57
58 ARCHIVE = $(PLUGIN)-$(VERSION)
59 PACKAGE = vdr-$(ARCHIVE)
60
61 ### The name of the shared object file:
62
63 SOFILE = libvdr-$(PLUGIN).so
64
65 ### Includes and Defines (add further entries here):
66
67 INCLUDES +=
68
69 DEFINES += -DPLUGIN_NAME_I18N='"$(PLUGIN)"'
70
71 ### The object files (add further files here):
72
73 OBJS = $(PLUGIN).o
74
75 ### The main target:
76
77 all: $(SOFILE)
78 # i18n
79
80 ### Implicit rules:
81
82 %.o: %.c
83 $(CXX) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) -o $@ $<
84
85 ### Dependencies:
86
87 MAKEDEP = $(CXX) -MM -MG
88 DEPFILE = .dependencies
89 $(DEPFILE): Makefile
90 @$(MAKEDEP) $(CXXFLAGS) $(DEFINES) $(INCLUDES) $(OBJS:%.o=%.c) > $@
91
92 -include $(DEPFILE)
93
94 ### Internationalization (I18N):
95
96 PODIR = po
97 I18Npo = $(wildcard $(PODIR)/*.po)
98 I18Nmo = $(addsuffix .mo, $(foreach file, $(I18Npo), $(basename $(file))))
99 I18Nmsgs = $(addprefix $(DESTDIR)$(LOCDIR)/, $(addsuffix /LC_MESSAGES/vdr-$(PLUGIN).mo, $(notdir $(foreach file, $(I18Npo), $(basename $(file))))))
100 I18Npot = $(PODIR)/$(PLUGIN).pot
101
102 %.mo: %.po
103 msgfmt -c -o $@ $<
104
105 $(I18Npot): $(wildcard *.c)
106 xgettext -C -cTRANSLATORS --no-wrap --no-location -k -ktr -ktrNOOP --package-name=vdr-$(PLUGIN) --package-version=$(VERSION) --msgid-bugs-address='<see README>' -o $@ `ls $^`
107
108 %.po: $(I18Npot)
109 msgmerge -U --no-wrap --no-location --backup=none -q -N $@ $<#
110 @touch $@
111
112 $(I18Nmsgs): $(DESTDIR)$(LOCDIR)/%/LC_MESSAGES/vdr-$(PLUGIN).mo: $(PODIR)/%.mo
113 install -D -m644 $< $@
114
115 .PHONY: i18n
116 i18n: $(I18Nmo) $(I18Npot)
117
118 install-i18n: $(I18Nmsgs)
119
120 ### Targets:
121
122 $(SOFILE): $(OBJS)
123 $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared $(OBJS) -o $@
124
125 install-lib: $(SOFILE)
126 install -D $^ $(DESTDIR)$(LIBDIR)/$^.$(APIVERSION)
127
128 install: install-lib
129 # install-i18n
130
131 dist: $(I18Npo) clean
132 @-rm -rf $(TMPDIR)/$(ARCHIVE)
133 @mkdir $(TMPDIR)/$(ARCHIVE)
134 @cp -a * $(TMPDIR)/$(ARCHIVE)
135 @tar czf $(PACKAGE).tgz -C $(TMPDIR) $(ARCHIVE)
136 @-rm -rf $(TMPDIR)/$(ARCHIVE)
137 @echo Distribution package created as $(PACKAGE).tgz
138
139 clean:
140 @-rm -f $(PODIR)/*.mo $(PODIR)/*.pot
141 @-rm -f $(OBJS) $(DEPFILE) *.so *.tgz core* *~