Makefile
branchtrunk
changeset 10 967afc97e51d
parent 8 b5bd55cfd28f
child 14 feccb11658b1
equal deleted inserted replaced
9:23e350c6b6d9 10:967afc97e51d
     1 #
     1 #
     2 # PremiereEpg plugin to VDR
     2 # PremiereEpg plugin to VDR
     3 #
     3 #
     4 # (C) 2005 Stefan Huelswitt <s.huelswitt@gmx.de>
     4 # (C) 2005-2006 Stefan Huelswitt <s.huelswitt@gmx.de>
     5 #
     5 #
     6 # This code is free software; you can redistribute it and/or
     6 # This code is free software; you can redistribute it and/or
     7 # modify it under the terms of the GNU General Public License
     7 # modify it under the terms of the GNU General Public License
     8 # as published by the Free Software Foundation; either version 2
     8 # as published by the Free Software Foundation; either version 2
     9 # of the License, or (at your option) any later version.
     9 # of the License, or (at your option) any later version.
    33 CXX      ?= g++
    33 CXX      ?= g++
    34 CXXFLAGS ?= -O2 -fPIC -Wall -Woverloaded-virtual
    34 CXXFLAGS ?= -O2 -fPIC -Wall -Woverloaded-virtual
    35 
    35 
    36 ### The directory environment:
    36 ### The directory environment:
    37 
    37 
    38 DVBDIR = ../../../../DVB
       
    39 VDRDIR = ../../..
    38 VDRDIR = ../../..
    40 LIBDIR = ../../lib
    39 LIBDIR = ../../lib
    41 TMPDIR = /tmp
    40 TMPDIR = /tmp
    42 
    41 
    43 ### Allow user defined options to overwrite defaults:
    42 ### Allow user defined options to overwrite defaults:
    44 
    43 
    45 -include $(VDRDIR)/Make.config
    44 -include $(VDRDIR)/Make.config
    46 
    45 
    47 ### The version number of VDR (taken from VDR's "config.h"):
    46 ### The version number of VDR (taken from VDR's "config.h"):
    48 
    47 
    49 VDRVERSION = $(shell grep 'define VDRVERSION ' $(VDRDIR)/config.h | awk '{ print $$3 }' | sed -e 's/"//g')
    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)
       
    52 endif
    50 
    53 
    51 ### The name of the distribution archive:
    54 ### The name of the distribution archive:
    52 
    55 
    53 ARCHIVE = $(PLUGIN)-$(VERSION)
    56 ARCHIVE = $(PLUGIN)-$(VERSION)
    54 PACKAGE = vdr-$(ARCHIVE)
    57 PACKAGE = vdr-$(ARCHIVE)
    55 
    58 
    56 ### Includes and Defines (add further entries here):
    59 ### Includes and Defines (add further entries here):
    57 
    60 
    58 INCLUDES += -I$(VDRDIR)/include -I$(DVBDIR)/include
    61 INCLUDES += -I$(VDRDIR)/include
    59 
    62 
    60 DEFINES += -D_GNU_SOURCE -DPLUGIN_NAME_I18N='"$(PLUGIN)"'
    63 DEFINES += -D_GNU_SOURCE -DPLUGIN_NAME_I18N='"$(PLUGIN)"'
    61 
    64 
    62 ### The object files (add further files here):
    65 ### The object files (add further files here):
    63 
    66 
    85 
    88 
    86 all: libvdr-$(PLUGIN).so
    89 all: libvdr-$(PLUGIN).so
    87 
    90 
    88 libvdr-$(PLUGIN).so: $(OBJS)
    91 libvdr-$(PLUGIN).so: $(OBJS)
    89 	$(CXX) $(CXXFLAGS) -shared $(OBJS) -o $@
    92 	$(CXX) $(CXXFLAGS) -shared $(OBJS) -o $@
    90 	@cp $@ $(LIBDIR)/$@.$(VDRVERSION)
    93 	@cp $@ $(LIBDIR)/$@.$(APIVERSION)
    91 
    94 
    92 dist: clean
    95 dist: clean
    93 	@-rm -rf $(TMPDIR)/$(ARCHIVE)
    96 	@-rm -rf $(TMPDIR)/$(ARCHIVE)
    94 	@mkdir $(TMPDIR)/$(ARCHIVE)
    97 	@mkdir $(TMPDIR)/$(ARCHIVE)
    95 	@cp -a * $(TMPDIR)/$(ARCHIVE)
    98 	@cp -a * $(TMPDIR)/$(ARCHIVE)