2 # Makefile for a Video Disk Recorder plugin
6 # The official name of this plugin.
7 # This name will be used in the '-P...' option of VDR to load the plugin.
8 # By default the main source file also carries this name.
12 ### The version number of this plugin (taken from the main source file):
14 VERSION = $(shell grep 'static const char \*VERSION *=' $(PLUGIN).c | awk '{ print $$6 }' | sed -e 's/[";]//g')
16 ### The C++ compiler and options:
19 CXXFLAGS ?= -O2 -fPIC -Wall -Woverloaded-virtual -Werror
21 ### The directory environment:
27 ### Allow user defined options to overwrite defaults:
29 -include $(VDRDIR)/Make.config
31 ### The version number of VDR (taken from VDR's "config.h"):
33 VDRVERSION = $(shell grep 'define VDRVERSION ' $(VDRDIR)/config.h | awk '{ print $$3 }' | sed -e 's/"//g')
34 APIVERSION = $(shell sed -ne '/define APIVERSION/s/^.*"\(.*\)".*$$/\1/p' $(VDRDIR)/config.h)
36 ### The name of the distribution archive:
38 ARCHIVE = $(PLUGIN)-$(VERSION)
39 PACKAGE = vdr-$(ARCHIVE)
41 ### Includes and Defines (add further entries here):
43 INCLUDES += -I$(VDRDIR)/include -I$(DVBDIR)/include
45 DEFINES += -D_GNU_SOURCE -DPLUGIN_NAME_I18N='"$(PLUGIN)"'
47 ### The object files (add further files here):
49 OBJS = $(PLUGIN).o dsock.o mvpserver.o udpreplier.o bootpd.o tftpd.o mvpclient.o tcp.o \
50 ringbuffer.o mvprelay.o \
51 recplayer.o config.o log.o thread.o mvpreceiver.o tftpclient.o
56 $(CXX) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) -o $@ $<
61 DEPFILE = .dependencies
63 @$(MAKEDEP) $(DEFINES) $(INCLUDES) $(OBJS:%.o=%.c) > $@
69 all: libvdr-$(PLUGIN).so
71 libvdr-$(PLUGIN).so: $(OBJS)
72 $(CXX) $(CXXFLAGS) -shared $(OBJS) -o $@
73 @cp $@ $(LIBDIR)/$@.$(APIVERSION)
76 @-rm -rf $(TMPDIR)/$(ARCHIVE)
77 @mkdir $(TMPDIR)/$(ARCHIVE)
78 @cp -a * $(TMPDIR)/$(ARCHIVE)
79 @tar czf $(PACKAGE).tgz -C $(TMPDIR) $(ARCHIVE)
80 @-rm -rf $(TMPDIR)/$(ARCHIVE)
81 @echo Distribution package created as $(PACKAGE).tgz
84 rm -f $(OBJS) $(DEPFILE) *.so *.tgz core* *~