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-wapd/files: wapd.mk
Date: Sat, 21 Jun 2014 22:08:38
Message-Id: 20140621220835.159C52004F@flycatcher.gentoo.org
1 hd_brummy 14/06/21 22:08:34
2
3 Added: wapd.mk
4 Log:
5 compile fix for obsoleted i18n issues, wrt bug 513414; new Makefile
6
7 (Portage version: 2.2.10/cvs/Linux x86_64, RepoMan options: --force, signed Manifest commit with key 34C2808A)
8
9 Revision Changes Path
10 1.1 media-plugins/vdr-wapd/files/wapd.mk
11
12 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-plugins/vdr-wapd/files/wapd.mk?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-plugins/vdr-wapd/files/wapd.mk?rev=1.1&content-type=text/plain
14
15 Index: wapd.mk
16 ===================================================================
17 #
18 # Makefile for a Video Disk Recorder plugin
19 #
20 # $Id: wapd.mk,v 1.1 2014/06/21 22:08:34 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 = wapd
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 INCLUDES +=
67
68 DEFINES += -DPLUGIN_NAME_I18N='"$(PLUGIN)"'
69
70 ### Enable this for debugging
71
72 # DEFINES += -DWAPD_DEBUG
73
74 ### Enable this to replace WML output with HTML
75
76 # DEFINES += -DWAPD_HTML
77
78 ### The object files (add further files here):
79
80 OBJS = $(PLUGIN).o server.o tools.o access.o
81
82 LIBS += -lcrypt
83
84 ### The main target:
85
86 all: $(SOFILE) wappasswd
87
88 ### Implicit rules:
89
90 %.o: %.c
91 $(CXX) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) -o $@ $<
92
93 ### Dependencies:
94
95 MAKEDEP = $(CXX) -MM -MG
96 DEPFILE = .dependencies
97 $(DEPFILE): Makefile
98 @$(MAKEDEP) $(CXXFLAGS) $(DEFINES) $(INCLUDES) $(OBJS:%.o=%.c) > $@
99
100 -include $(DEPFILE)
101
102 ### Targets:
103
104 $(SOFILE): $(OBJS)
105 $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared $(OBJS) -o $@ $(LIBS)
106
107 wappasswd: wappasswd.c
108 $(CXX) $(CXXFLAGS) $(LDFLAGS) -o wappasswd wappasswd.c $(LIBS)
109
110 install-lib: $(SOFILE)
111 install -D $^ $(DESTDIR)$(LIBDIR)/$^.$(APIVERSION)
112
113 install: install-lib
114 install-i18n
115
116 dist: $(I18Npo) clean
117 @-rm -rf $(TMPDIR)/$(ARCHIVE)
118 @mkdir $(TMPDIR)/$(ARCHIVE)
119 @cp -a * $(TMPDIR)/$(ARCHIVE)
120 @tar czf $(PACKAGE).tgz -C $(TMPDIR) $(ARCHIVE)
121 @-rm -rf $(TMPDIR)/$(ARCHIVE)
122 @echo Distribution package created as $(PACKAGE).tgz
123
124 clean:
125 @-rm -f $(PODIR)/*.mo $(PODIR)/*.pot
126 @-rm -f $(OBJS) $(DEPFILE) *.so *.tgz core* *~ wappasswd