1 |
hd_brummy 13/06/30 10:30:01 |
2 |
|
3 |
Added: music.mk |
4 |
Log: |
5 |
bump, wrt bug 474888 |
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-music/files/music.mk |
11 |
|
12 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-plugins/vdr-music/files/music.mk?rev=1.1&view=markup |
13 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-plugins/vdr-music/files/music.mk?rev=1.1&content-type=text/plain |
14 |
|
15 |
Index: music.mk |
16 |
=================================================================== |
17 |
# |
18 |
# Makefile for a Video Disk Recorder plugin |
19 |
# |
20 |
# $Id: music.mk,v 1.1 2013/06/30 10:30:01 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 |
PLUGIN = music |
27 |
|
28 |
### The version number of this plugin (taken from the main source file): |
29 |
|
30 |
VERSION = $(shell grep 'static const char \*VERSION *=' $(PLUGIN).c | awk '{ print $$6 }' | sed -e 's/[";]//g') |
31 |
|
32 |
### The directory environment: |
33 |
|
34 |
# Use package data if installed...otherwise assume we're under the VDR source directory: |
35 |
PKGCFG = $(if $(VDRDIR),$(shell pkg-config --variable=$(1) $(VDRDIR)/vdr.pc),$(shell pkg-config --variable=$(1) vdr || pkg-config --variable=$(1) ../../../vdr.pc)) |
36 |
LIBDIR = $(call PKGCFG,libdir) |
37 |
LOCDIR = $(call PKGCFG,locdir) |
38 |
PLGCFG = $(call PKGCFG,plgcfg) |
39 |
# |
40 |
TMPDIR ?= /tmp |
41 |
|
42 |
### The compiler options: |
43 |
|
44 |
export CFLAGS = $(call PKGCFG,cflags) |
45 |
export CXXFLAGS = $(call PKGCFG,cxxflags) |
46 |
|
47 |
### The version number of VDR's plugin API: |
48 |
|
49 |
APIVERSION = $(call PKGCFG,apiversion) |
50 |
|
51 |
### Allow user defined options to overwrite defaults: |
52 |
|
53 |
-include $(PLGCFG) |
54 |
|
55 |
### The name of the distribution archive: |
56 |
|
57 |
ARCHIVE = $(PLUGIN)-$(VERSION) |
58 |
PACKAGE = vdr-$(ARCHIVE) |
59 |
|
60 |
### The name of the shared object file: |
61 |
|
62 |
SOFILE = libvdr-$(PLUGIN).so |
63 |
|
64 |
### Includes and Defines (add further entries here): |
65 |
|
66 |
# (Default) DO NOT UNCOMMENT IT IN DEVELOPER-VERSIONS |
67 |
HAVE_IMAGEMAGICK=1 |
68 |
# Uncomment the following line, if you don't have libsndfile installed |
69 |
#WITHOUT_LIBSNDFILE=1 |
70 |
|
71 |
# Uncomment the following line, if you don't have libvorbisfile installed |
72 |
#WITHOUT_LIBVORBISFILE=1 |
73 |
|
74 |
#BROKEN_PCM=1 |
75 |
# Uncomment if you want debug output on stdout |
76 |
##DEBUG=1 |
77 |
|
78 |
# internal use |
79 |
# BUGHUNT |
80 |
#BUGHUNT=1 |
81 |
|
82 |
# internal use |
83 |
# DEBUG_COVER |
84 |
#DEBUG_COVER=1 |
85 |
|
86 |
###INCLUDES += |
87 |
|
88 |
###DEFINES += -DPLUGIN_NAME_I18N='"$(PLUGIN)"' |
89 |
INCLUDES += -I$(VDRINCDIR) |
90 |
|
91 |
DEFINES += -D_GNU_SOURCE -DPLUGIN_NAME_I18N='"$(PLUGIN)"' |
92 |
|
93 |
ifdef BROKEN_PCM |
94 |
DEFINES += -DBROKEN_PCM |
95 |
endif |
96 |
|
97 |
ifeq ($(shell test -f $(VDRDIR)/fontsym.h ; echo $$?),0) |
98 |
DEFINES += -DHAVE_BEAUTYPATCH |
99 |
endif |
100 |
|
101 |
ifdef DBG |
102 |
CXXFLAGS += -g |
103 |
endif |
104 |
|
105 |
ifdef DEBUG |
106 |
DEFINES += -DDEBUG |
107 |
else |
108 |
DEFINES += -DNO_DEBUG |
109 |
endif |
110 |
|
111 |
ifdef BUGHUNT |
112 |
DEFINES += -DBUGHUNT |
113 |
endif |
114 |
|
115 |
ifdef DEBUG_COVER |
116 |
DEFINES += -DDEBUG_COVER |
117 |
endif |
118 |
|
119 |
### The object files (add further files here): |
120 |
|
121 |
OBJS = $(PLUGIN).o config.o vars.o bitmap.o \ |
122 |
commands.o options.o lyrics.o funct.o cover.o skin.o visual.o tracklist.o \ |
123 |
search.o mp3id3.o mp3id3tag.o rating.o menubrowse.o mp3control.o \ |
124 |
icons.o data.o menu.o \ |
125 |
data-mp3.o setup-mp3.o player-mp3.o stream.o network.o \ |
126 |
decoder.o decoder-mp3.o decoder-mp3-stream.o decoder-snd.o \ |
127 |
decoder-ogg.o |
128 |
|
129 |
LIBS += -lasound -lmad -lid3tag |
130 |
|
131 |
ifdef HAVE_IMAGEMAGICK |
132 |
INCLUDES += $(shell pkg-config --cflags MagickCore) |
133 |
LIBS += $(shell pkg-config --libs Magick++) |
134 |
DEFINES += -DHAVE_IMAGEMAGICK |
135 |
else |
136 |
INCLUDES += -I$(IMLIB)/src |
137 |
LIBS += $(shell imlib2-config --libs) |
138 |
DEFINES += -DHAVE_IMLIB2 |
139 |
endif |
140 |
|
141 |
ifndef WITHOUT_LIBSNDFILE |
142 |
LIBS += -lsndfile |
143 |
DEFINES += -DHAVE_SNDFILE |
144 |
endif |
145 |
|
146 |
ifndef WITHOUT_LIBVORBISFILE |
147 |
LIBS += -lvorbisfile -lvorbis |
148 |
DEFINES += -DHAVE_VORBISFILE |
149 |
endif |
150 |
|
151 |
### The main target: |
152 |
|
153 |
all: $(SOFILE) i18n |
154 |
|
155 |
### Implicit rules: |
156 |
|
157 |
%.o: %.c |
158 |
$(CXX) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) -o $@ $< |
159 |
|
160 |
### Dependencies: |
161 |
|
162 |
MAKEDEP = $(CXX) -MM -MG |
163 |
DEPFILE = .dependencies |
164 |
$(DEPFILE): Makefile |
165 |
@$(MAKEDEP) $(CXXFLAGS) $(DEFINES) $(INCLUDES) $(OBJS:%.o=%.c) > $@ |
166 |
|
167 |
-include $(DEPFILE) |
168 |
|
169 |
### Internationalization (I18N): |
170 |
|
171 |
PODIR = po |
172 |
I18Npo = $(wildcard $(PODIR)/*.po) |
173 |
I18Nmo = $(addsuffix .mo, $(foreach file, $(I18Npo), $(basename $(file)))) |
174 |
I18Nmsgs = $(addprefix $(DESTDIR)$(LOCDIR)/, $(addsuffix /LC_MESSAGES/vdr-$(PLUGIN).mo, $(notdir $(foreach file, $(I18Npo), $(basename $(file)))))) |
175 |
I18Npot = $(PODIR)/$(PLUGIN).pot |
176 |
|
177 |
%.mo: %.po |
178 |
msgfmt -c -o $@ $< |
179 |
|
180 |
$(I18Npot): $(wildcard *.c) |
181 |
xgettext -C -cTRANSLATORS --no-wrap --no-location -k -ktr -ktrNOOP --package-name=vdr-$(PLUGIN) --package-version=$(VERSION) --msgid-bugs-address='<see README>' -o $@ `ls $^` |
182 |
|
183 |
%.po: $(I18Npot) |
184 |
msgmerge -U --no-wrap --no-location --backup=none -q -N $@ $< |
185 |
@touch $@ |
186 |
|
187 |
$(I18Nmsgs): $(DESTDIR)$(LOCDIR)/%/LC_MESSAGES/vdr-$(PLUGIN).mo: $(PODIR)/%.mo |
188 |
install -D -m644 $< $@ |
189 |
|
190 |
.PHONY: i18n |
191 |
i18n: $(I18Nmo) $(I18Npot) |
192 |
|
193 |
install-i18n: $(I18Nmsgs) |
194 |
|
195 |
### Targets: |
196 |
|
197 |
$(SOFILE): $(OBJS) |
198 |
$(CXX) $(CXXFLAGS) $(LDFLAGS) -shared $(OBJS) -o $@ |
199 |
|
200 |
install-lib: $(SOFILE) |
201 |
install -D $^ $(DESTDIR)$(LIBDIR)/$^.$(APIVERSION) |
202 |
|
203 |
install: install-lib install-i18n |
204 |
|
205 |
dist: $(I18Npo) clean |
206 |
@-rm -rf $(TMPDIR)/$(ARCHIVE) |
207 |
@mkdir $(TMPDIR)/$(ARCHIVE) |
208 |
@cp -a * $(TMPDIR)/$(ARCHIVE) |
209 |
@tar czf $(PACKAGE).tgz -C $(TMPDIR) $(ARCHIVE) |
210 |
@-rm -rf $(TMPDIR)/$(ARCHIVE) |
211 |
@echo Distribution package created as $(PACKAGE).tgz |
212 |
|
213 |
clean: |
214 |
@-rm -f $(PODIR)/*.mo $(PODIR)/*.pot |
215 |
@-rm -f $(OBJS) $(DEPFILE) *.so *.tgz core* *~ |