Makefile
branchtrunk
changeset 0 a75b9f441157
child 2 3562cacb3b0b
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/Makefile	Sat Dec 29 11:17:32 2007 +0100
     1.3 @@ -0,0 +1,97 @@
     1.4 +#
     1.5 +# PremiereEpg plugin to VDR
     1.6 +#
     1.7 +# (C) 2005 Stefan Huelswitt <s.huelswitt@gmx.de>
     1.8 +#
     1.9 +# This code is free software; you can redistribute it and/or
    1.10 +# modify it under the terms of the GNU General Public License
    1.11 +# as published by the Free Software Foundation; either version 2
    1.12 +# of the License, or (at your option) any later version.
    1.13 +#
    1.14 +# This code is distributed in the hope that it will be useful,
    1.15 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
    1.16 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    1.17 +# GNU General Public License for more details.
    1.18 +#
    1.19 +# You should have received a copy of the GNU General Public License
    1.20 +# along with this program; if not, write to the Free Software
    1.21 +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
    1.22 +# Or, point your browser to http://www.gnu.org/copyleft/gpl.html
    1.23 +
    1.24 +# The official name of this plugin.
    1.25 +# This name will be used in the '-P...' option of VDR to load the plugin.
    1.26 +# By default the main source file also carries this name.
    1.27 +#
    1.28 +PLUGIN = premiereepg
    1.29 +
    1.30 +### The version number of this plugin (taken from the main source file):
    1.31 +
    1.32 +VERSION = $(shell grep 'static const char \*VERSION *=' $(PLUGIN).c | awk '{ print $$6 }' | sed -e 's/[";]//g')
    1.33 +
    1.34 +### The C++ compiler and options:
    1.35 +
    1.36 +CXX      ?= g++
    1.37 +CXXFLAGS ?= -O2 -Wall -Woverloaded-virtual
    1.38 +
    1.39 +### The directory environment:
    1.40 +
    1.41 +DVBDIR = ../../../../DVB
    1.42 +VDRDIR = ../../..
    1.43 +LIBDIR = ../../lib
    1.44 +TMPDIR = /tmp
    1.45 +
    1.46 +### Allow user defined options to overwrite defaults:
    1.47 +
    1.48 +-include $(VDRDIR)/Make.config
    1.49 +
    1.50 +### The version number of VDR (taken from VDR's "config.h"):
    1.51 +
    1.52 +VDRVERSION = $(shell grep 'define VDRVERSION ' $(VDRDIR)/config.h | awk '{ print $$3 }' | sed -e 's/"//g')
    1.53 +
    1.54 +### The name of the distribution archive:
    1.55 +
    1.56 +ARCHIVE = $(PLUGIN)-$(VERSION)
    1.57 +PACKAGE = vdr-$(ARCHIVE)
    1.58 +
    1.59 +### Includes and Defines (add further entries here):
    1.60 +
    1.61 +INCLUDES += -I$(VDRDIR)/include -I$(DVBDIR)/include
    1.62 +
    1.63 +DEFINES += -D_GNU_SOURCE -DPLUGIN_NAME_I18N='"$(PLUGIN)"'
    1.64 +
    1.65 +### The object files (add further files here):
    1.66 +
    1.67 +OBJS = $(PLUGIN).o
    1.68 +
    1.69 +### Implicit rules:
    1.70 +
    1.71 +%.o: %.c
    1.72 +	$(CXX) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) $<
    1.73 +
    1.74 +# Dependencies:
    1.75 +
    1.76 +MAKEDEP = $(CXX) -MM -MG
    1.77 +DEPFILE = .dependencies
    1.78 +$(DEPFILE): Makefile
    1.79 +	@$(MAKEDEP) $(DEFINES) $(INCLUDES) $(OBJS:%.o=%.c) > $@
    1.80 +
    1.81 +-include $(DEPFILE)
    1.82 +
    1.83 +### Targets:
    1.84 +
    1.85 +all: libvdr-$(PLUGIN).so
    1.86 +
    1.87 +libvdr-$(PLUGIN).so: $(OBJS)
    1.88 +	$(CXX) $(CXXFLAGS) -shared $(OBJS) -o $@
    1.89 +	@cp $@ $(LIBDIR)/$@.$(VDRVERSION)
    1.90 +
    1.91 +dist: clean
    1.92 +	@-rm -rf $(TMPDIR)/$(ARCHIVE)
    1.93 +	@mkdir $(TMPDIR)/$(ARCHIVE)
    1.94 +	@cp -a * $(TMPDIR)/$(ARCHIVE)
    1.95 +	@tar czf $(PACKAGE).tgz -C $(TMPDIR) $(ARCHIVE)
    1.96 +	@-rm -rf $(TMPDIR)/$(ARCHIVE)
    1.97 +	@echo Distribution package created as $(PACKAGE).tgz
    1.98 +
    1.99 +clean:
   1.100 +	@-rm -f $(OBJS) $(DEPFILE) *.so *.tgz core* *~