# # Signal plugin to VDR # # This code is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This code is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # Or, point your browser to http://www.gnu.org/copyleft/gpl.html # The official name of this plugin. # This name will be used in the '-P...' option of VDR to load the plugin. # By default the main source file also carries this name. # PLUGIN = signal ### The version number of this plugin (taken from the main source file): VERSION = $(shell grep 'static const char \*VERSION *=' $(PLUGIN).c | awk '{ print $$6 }' | sed -e 's/[";]//g') ### The C++ compiler and options: CXX ?= g++ CXXFLAGS ?= -O2 -Wall -Woverloaded-virtual ### The directory environment: DVBDIR = ../../../../DVB VDRDIR = ../../.. LIBDIR = ../../lib TMPDIR = /tmp ### Allow user defined options to overwrite defaults: -include $(VDRDIR)/Make.config ### Includes and Defines INCLUDES += -I$(VDRDIR)/include -I$(DVBDIR)/include DEFINES += -DPLUGIN_NAME_I18N='"$(PLUGIN)"' -D_GNU_SOURCE ### The version number of VDR (taken from VDR's "config.h"): VDRVERSION = $(shell grep 'define VDRVERSION ' $(VDRDIR)/config.h | awk '{ print $$3 }' | sed -e 's/"//g') ### The name of the distribution archive: ARCHIVE = $(PLUGIN)-$(VERSION) PACKAGE = vdr-$(ARCHIVE) ### The object files (add further files here): OBJS = $(PLUGIN).o ### Implicit rules: %.o: %.c $(CXX) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) $< # Dependencies: MAKEDEP = g++ -MM -MG DEPFILE = .dependencies $(DEPFILE): Makefile @$(MAKEDEP) $(DEFINES) $(INCLUDES) $(OBJS:%.o=%.c) > $@ -include $(DEPFILE) ### Targets: all: $(SUBDIRS) libvdr-$(PLUGIN).so .PHONY: all $(SUBDIRS) $(SUBDIRS): @$(MAKE) -C $@ all libvdr-$(PLUGIN).so: $(OBJS) $(SUBLIBS) $(CXX) $(CXXFLAGS) -shared $(OBJS) $(SUBLIBS) $(SHAREDLIBS) -o $@ @cp $@ $(LIBDIR)/$@.$(VDRVERSION) dist: clean @-rm -rf $(TMPDIR)/$(ARCHIVE) @mkdir $(TMPDIR)/$(ARCHIVE) @cp -a * $(TMPDIR)/$(ARCHIVE) @tar czf $(PACKAGE).tar.gz -C $(TMPDIR) $(ARCHIVE) @-rm -rf $(TMPDIR)/$(ARCHIVE) @echo Distribution package created as $(PACKAGE).tar.gz clean: @for dir in $(ALLDIRS); do $(MAKE) -C $$dir clean; done; @-rm -f $(OBJS) $(DEPFILE) *.so *.tar.gz core* *~