2 # PremiereEpg plugin to VDR
4 # (C) 2005-2006 Stefan Huelswitt <s.huelswitt@gmx.de>
6 # This code is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU General Public License
8 # as published by the Free Software Foundation; either version 2
9 # of the License, or (at your option) any later version.
11 # This code is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 # Or, point your browser to http://www.gnu.org/copyleft/gpl.html
21 # The official name of this plugin.
22 # This name will be used in the '-P...' option of VDR to load the plugin.
23 # By default the main source file also carries this name.
27 ### The version number of this plugin (taken from the main source file):
29 VERSION = $(shell grep 'static const char \*VERSION *=' $(PLUGIN).c | awk '{ print $$6 }' | sed -e 's/[";]//g')
31 ### The C++ compiler and options:
34 CXXFLAGS ?= -O2 -fPIC -Wall -Woverloaded-virtual
36 ### The directory environment:
42 ### Allow user defined options to overwrite defaults:
44 -include $(VDRDIR)/Make.config
46 ### The version number of VDR (taken from VDR's "config.h"):
48 VDRVERSION = $(shell sed -ne '/define VDRVERSION/ s/^.*"\(.*\)".*$$/\1/p' $(VDRDIR)/config.h)
49 APIVERSION = $(shell sed -ne '/define APIVERSION/ s/^.*"\(.*\)".*$$/\1/p' $(VDRDIR)/config.h)
50 ifeq ($(strip $(APIVERSION)),)
51 APIVERSION = $(VDRVERSION)
54 ### The name of the distribution archive:
56 ARCHIVE = $(PLUGIN)-$(VERSION)
57 PACKAGE = vdr-$(ARCHIVE)
59 ### Includes and Defines (add further entries here):
61 INCLUDES += -I$(VDRDIR)/include
63 DEFINES += -D_GNU_SOURCE -DPLUGIN_NAME_I18N='"$(PLUGIN)"'
65 ### The object files (add further files here):
76 $(CXX) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) $<
80 MAKEDEP = $(CXX) -MM -MG
81 DEPFILE = .dependencies
83 @$(MAKEDEP) $(DEFINES) $(INCLUDES) $(OBJS:%.o=%.c) > $@
89 all: libvdr-$(PLUGIN).so
91 libvdr-$(PLUGIN).so: $(OBJS)
92 $(CXX) $(CXXFLAGS) -shared $(OBJS) -o $@
93 @cp $@ $(LIBDIR)/$@.$(APIVERSION)
96 @-rm -rf $(TMPDIR)/$(ARCHIVE)
97 @mkdir $(TMPDIR)/$(ARCHIVE)
98 @cp -a * $(TMPDIR)/$(ARCHIVE)
99 @tar czf $(PACKAGE).tar.gz -C $(TMPDIR) $(ARCHIVE)
100 @-rm -rf $(TMPDIR)/$(ARCHIVE)
101 @echo Distribution package created as $(PACKAGE).tar.gz
104 @-rm -f $(OBJS) $(DEPFILE) *.so *.tar.gz core* *~