]> git.vomp.tv Git - vompserver.git/blob - Makefile
FSF address change
[vompserver.git] / Makefile
1 #
2 # Makefile for a Video Disk Recorder plugin
3 #
4 # $Id$
5
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.
9 #
10 PLUGIN = vompserver
11
12 ### The version number of this plugin (taken from the main source file):
13
14 VERSION = $(shell grep 'static const char \*VERSION *=' $(PLUGIN).c | awk '{ print $$6 }' | sed -e 's/[";]//g')
15
16 ### The C++ compiler and options:
17
18 CXX      ?= g++
19 CXXFLAGS ?= -O2 -fPIC -Wall -Woverloaded-virtual -Werror
20
21 ### The directory environment:
22
23 VDRDIR = ../../..
24 LIBDIR = ../../lib
25 TMPDIR = /tmp
26
27 ### Allow user defined options to overwrite defaults:
28
29 -include $(VDRDIR)/Make.config
30
31 ### The version number of VDR (taken from VDR's "config.h"):
32
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)
35
36 ### The name of the distribution archive:
37
38 ARCHIVE = $(PLUGIN)-$(VERSION)
39 PACKAGE = vdr-$(ARCHIVE)
40
41 ### Includes and Defines (add further entries here):
42
43 INCLUDES += -I$(VDRDIR)/include -I$(DVBDIR)/include
44
45 DEFINES += -D_GNU_SOURCE -DPLUGIN_NAME_I18N='"$(PLUGIN)"'
46
47 ### The object files (add further files here):
48
49 OBJS = $(PLUGIN).o dsock.o mvpserver.o udpreplier.o bootpd.o tftpd.o i18n.o mvpclient.o tcp.o \
50                    ringbuffer.o mvprelay.o \
51                    recplayer.o config.o log.o thread.o mvpreceiver.o tftpclient.o \
52                    media.o responsepacket.o
53
54 ### Implicit rules:
55
56 %.o: %.c
57         $(CXX) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) -o $@ $<
58
59 # Dependencies:
60
61 MAKEDEP = g++ -MM -MG
62 DEPFILE = .dependencies
63 $(DEPFILE): Makefile
64         @$(MAKEDEP) $(DEFINES) $(INCLUDES) $(OBJS:%.o=%.c) > $@
65
66 -include $(DEPFILE)
67
68 ### Targets:
69
70 all: libvdr-$(PLUGIN).so
71
72 libvdr-$(PLUGIN).so: $(OBJS)
73         $(CXX) $(CXXFLAGS) -shared $(OBJS) -o $@
74         @cp $@ $(LIBDIR)/$@.$(APIVERSION)
75
76 dist: clean
77         @-rm -rf $(TMPDIR)/$(ARCHIVE)
78         @mkdir $(TMPDIR)/$(ARCHIVE)
79         @cp -a * $(TMPDIR)/$(ARCHIVE)
80         @tar czf $(PACKAGE).tgz -C $(TMPDIR) $(ARCHIVE)
81         @-rm -rf $(TMPDIR)/$(ARCHIVE)
82         @echo Distribution package created as $(PACKAGE).tgz
83
84 clean:
85         rm -f $(OBJS) $(DEPFILE) *.so *.tgz core* *~