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-vompserver/files: vompserver.mk
Date: Sun, 31 Mar 2013 16:28:11
Message-Id: 20130331162808.1BBA52171E@flycatcher.gentoo.org
1 hd_brummy 13/03/31 16:28:08
2
3 Added: vompserver.mk
4 Log:
5 bump, taken from vdr-devel overlay
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-vompserver/files/vompserver.mk
11
12 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-plugins/vdr-vompserver/files/vompserver.mk?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-plugins/vdr-vompserver/files/vompserver.mk?rev=1.1&content-type=text/plain
14
15 Index: vompserver.mk
16 ===================================================================
17 #
18 # Makefile for a Video Disk Recorder plugin
19 #
20 # $Id: vompserver.mk,v 1.1 2013/03/31 16:28:07 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 = vompserver
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 DEFINES += -DVOMPSERVER
71
72 ### The object files (add further files here):
73
74 OBJS = $(PLUGIN).o
75
76 OBJS += dsock.o mvpserver.o udpreplier.o bootpd.o tftpd.o i18n.o vompclient.o tcp.o \
77 ringbuffer.o mvprelay.o vompclientrrproc.o \
78 config.o log.o thread.o tftpclient.o \
79 media.o responsepacket.o \
80 mediafile.o mediaplayer.o servermediafile.o serialize.o medialauncher.o
81
82 OBJS2 = recplayer.o mvpreceiver.o
83
84 ### The main target:
85
86 all: allbase $(SOFILE)
87 #i18n
88 standalone: standalonebase vompserver-standalone
89
90 ### Implicit rules:
91
92 %.o: %.c
93 $(CXX) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) -o $@ $<
94
95 ### Dependencies:
96
97 MAKEDEP = $(CXX) -MM -MG
98 DEPFILE = .dependencies
99 $(DEPFILE): Makefile
100 @$(MAKEDEP) $(CXXFLAGS) $(DEFINES) $(INCLUDES) $(OBJS:%.o=%.c) > $@
101
102 -include $(DEPFILE)
103
104 ### Internationalization (I18N):
105
106 PODIR = po
107 I18Npo = $(wildcard $(PODIR)/*.po)
108 I18Nmo = $(addsuffix .mo, $(foreach file, $(I18Npo), $(basename $(file))))
109 I18Nmsgs = $(addprefix $(DESTDIR)$(LOCDIR)/, $(addsuffix /LC_MESSAGES/vdr-$(PLUGIN).mo, $(notdir $(foreach file, $(I18Npo), $(basename $(file))))))
110 I18Npot = $(PODIR)/$(PLUGIN).pot
111
112 %.mo: %.po
113 msgfmt -c -o $@ $<
114
115 $(I18Npot): $(wildcard *.c)
116 xgettext -C -cTRANSLATORS --no-wrap --no-location -k -ktr -ktrNOOP --package-name=vdr-$(PLUGIN) --package-version=$(VERSION) --msgid-bugs-address='<see README>' -o $@ `ls $^`
117
118 %.po: $(I18Npot)
119 msgmerge -U --no-wrap --no-location --backup=none -q -N $@ $<
120 @touch $@
121
122 $(I18Nmsgs): $(DESTDIR)$(LOCDIR)/%/LC_MESSAGES/vdr-$(PLUGIN).mo: $(PODIR)/%.mo
123 install -D -m644 $< $@
124
125 .PHONY: i18n
126 i18n: $(I18Nmo) $(I18Npot)
127
128 install-i18n: $(I18Nmsgs)
129
130 ### Targets:
131
132 objectsstandalone: $(OBJS)
133 objects: $(OBJS) $(OBJS2)
134
135 allbase:
136 ( if [ -f .standalone ] ; then ( rm -f .standalone; make clean ; make objects ) ; else exit 0 ;fi )
137 standalonebase:
138 ( if [ ! -f .standalone ] ; then ( make clean; echo "DEFINES+=-DVOMPSTANDALONE" > .standalone; echo "DEFINES+=-D_FILE_OFFSET_BITS=64" >> .standalone; make objectsstandalone ) ; else exit 0 ;fi )
139
140 $(SOFILE): objects
141 $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared $(OBJS) $(OBJS2) -o $@
142 @if [ -n "$(DOOLDINSTALL)" ]; then \
143 cp $@ $(LIBDIR)/$@.$(APIVERSION) ; \
144 echo "done manual copy"; \
145 fi
146
147 vompserver-standalone: objectsstandalone
148 $(CXX) $(CXXFLAGS) $(OBJS) -lpthread -o $@
149 chmod u+x $@
150
151 install-lib: $(SOFILE)
152 install -D $^ $(DESTDIR)$(LIBDIR)/$^.$(APIVERSION)
153
154 install: install-lib install-i18n
155
156 dist: $(I18Npo) clean
157 @-rm -rf $(TMPDIR)/$(ARCHIVE)
158 @mkdir $(TMPDIR)/$(ARCHIVE)
159 @cp -a * $(TMPDIR)/$(ARCHIVE)
160 @tar czf $(PACKAGE).tgz -C $(TMPDIR) $(ARCHIVE)
161 @-rm -rf $(TMPDIR)/$(ARCHIVE)
162 @echo Distribution package created as $(PACKAGE).tgz
163
164 clean:
165 @-rm -f $(PODIR)/*.mo $(PODIR)/*.pot
166 @-rm -f $(OBJS) $(DEPFILE) *.so *.tgz core* *~