|
1 # |
|
2 # PremiereEpg plugin to VDR |
|
3 # |
|
4 # (C) 2005 Stefan Huelswitt <s.huelswitt@gmx.de> |
|
5 # |
|
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. |
|
10 # |
|
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. |
|
15 # |
|
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 |
|
20 |
|
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. |
|
24 # |
|
25 PLUGIN = premiereepg |
|
26 |
|
27 ### The version number of this plugin (taken from the main source file): |
|
28 |
|
29 VERSION = $(shell grep 'static const char \*VERSION *=' $(PLUGIN).c | awk '{ print $$6 }' | sed -e 's/[";]//g') |
|
30 |
|
31 ### The C++ compiler and options: |
|
32 |
|
33 CXX ?= g++ |
|
34 CXXFLAGS ?= -O2 -Wall -Woverloaded-virtual |
|
35 |
|
36 ### The directory environment: |
|
37 |
|
38 DVBDIR = ../../../../DVB |
|
39 VDRDIR = ../../.. |
|
40 LIBDIR = ../../lib |
|
41 TMPDIR = /tmp |
|
42 |
|
43 ### Allow user defined options to overwrite defaults: |
|
44 |
|
45 -include $(VDRDIR)/Make.config |
|
46 |
|
47 ### The version number of VDR (taken from VDR's "config.h"): |
|
48 |
|
49 VDRVERSION = $(shell grep 'define VDRVERSION ' $(VDRDIR)/config.h | awk '{ print $$3 }' | sed -e 's/"//g') |
|
50 |
|
51 ### The name of the distribution archive: |
|
52 |
|
53 ARCHIVE = $(PLUGIN)-$(VERSION) |
|
54 PACKAGE = vdr-$(ARCHIVE) |
|
55 |
|
56 ### Includes and Defines (add further entries here): |
|
57 |
|
58 INCLUDES += -I$(VDRDIR)/include -I$(DVBDIR)/include |
|
59 |
|
60 DEFINES += -D_GNU_SOURCE -DPLUGIN_NAME_I18N='"$(PLUGIN)"' |
|
61 |
|
62 ### The object files (add further files here): |
|
63 |
|
64 OBJS = $(PLUGIN).o |
|
65 |
|
66 ### Implicit rules: |
|
67 |
|
68 %.o: %.c |
|
69 $(CXX) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) $< |
|
70 |
|
71 # Dependencies: |
|
72 |
|
73 MAKEDEP = $(CXX) -MM -MG |
|
74 DEPFILE = .dependencies |
|
75 $(DEPFILE): Makefile |
|
76 @$(MAKEDEP) $(DEFINES) $(INCLUDES) $(OBJS:%.o=%.c) > $@ |
|
77 |
|
78 -include $(DEPFILE) |
|
79 |
|
80 ### Targets: |
|
81 |
|
82 all: libvdr-$(PLUGIN).so |
|
83 |
|
84 libvdr-$(PLUGIN).so: $(OBJS) |
|
85 $(CXX) $(CXXFLAGS) -shared $(OBJS) -o $@ |
|
86 @cp $@ $(LIBDIR)/$@.$(VDRVERSION) |
|
87 |
|
88 dist: clean |
|
89 @-rm -rf $(TMPDIR)/$(ARCHIVE) |
|
90 @mkdir $(TMPDIR)/$(ARCHIVE) |
|
91 @cp -a * $(TMPDIR)/$(ARCHIVE) |
|
92 @tar czf $(PACKAGE).tgz -C $(TMPDIR) $(ARCHIVE) |
|
93 @-rm -rf $(TMPDIR)/$(ARCHIVE) |
|
94 @echo Distribution package created as $(PACKAGE).tgz |
|
95 |
|
96 clean: |
|
97 @-rm -f $(OBJS) $(DEPFILE) *.so *.tgz core* *~ |