]> git.vomp.tv Git - vompserver.git/blob - Makefile
Removal of remuxer
[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 mvpclient.o tcp.o \
50                    ringbuffer.o \
51                    recplayer.o config.o log.o thread.o mvpreceiver.o tftpclient.o
52
53 ### Implicit rules:
54
55 %.o: %.c
56         $(CXX) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) -o $@ $<
57
58 # Dependencies:
59
60 MAKEDEP = g++ -MM -MG
61 DEPFILE = .dependencies
62 $(DEPFILE): Makefile
63         @$(MAKEDEP) $(DEFINES) $(INCLUDES) $(OBJS:%.o=%.c) > $@
64
65 -include $(DEPFILE)
66
67 ### Targets:
68
69 all: libvdr-$(PLUGIN).so
70
71 libvdr-$(PLUGIN).so: $(OBJS)
72         $(CXX) $(CXXFLAGS) -shared $(OBJS) -o $@
73         @cp $@ $(LIBDIR)/$@.$(APIVERSION)
74
75 dist: clean
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
82
83 clean:
84         rm -f $(OBJS) $(DEPFILE) *.so *.tgz core* *~