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.
9
# IMPORTANT: the presence of this macro is important for the Make.config
10
# file. So it must be defined, even if it is not used here!
14
### The version number of this plugin (taken from the main source file):
16
VERSION = $(shell grep 'static const char \*VERSION *=' $(PLUGIN).c | awk '{ print $$6 }' | sed -e 's/[";]//g')
18
### The C++ compiler and options:
21
#CXX = /soft/gcc-4.1-20060113/bin/g++ -I/soft/include -L/soft/lib
22
CXXFLAGS ?= -fPIC -g -O2 -Wall -Woverloaded-virtual
23
#CXXFLAGS ?= -fPIC -g3 -O0 -Wall -Woverloaded-virtual
24
#CXXFLAGS ?= -fPIC -g3 -O0 -Wall -Woverloaded-virtual -Wformat=2 -Wextra
26
### The directory environment:
32
### Allow user defined options to overwrite defaults:
34
-include $(VDRDIR)/Make.config
36
INCLUDES += `pkg-config --cflags libxine`
38
# where to create fifos (xine expects them at /tmp/vdr-xine)
39
VDR_XINE_FIFO_DIR ?= /tmp/vdr-xine
41
# can be used to detect inefficient OSD drawing
42
# 0 - do not verify whether the dirty area of a bitmap is really dirty
43
# 1 - verify that bitmap is really dirty and print a message on console when it is not
44
# 2 - additionally fail with a core dump
45
VDR_XINE_VERIFY_BITMAP_DIRTY ?= 0
47
# enable to fully support yaepg plugin
48
#VDR_XINE_SET_VIDEO_WINDOW = 1
50
# where are these utilities for image grabbing? (default: anywhere on your PATH)
51
#VDR_XINE_Y4MSCALER = /usr/bin/y4mscaler
52
#VDR_XINE_Y4MTOPPM = /usr/bin/y4mtoppm
53
#VDR_XINE_PNMCUT = /usr/bin/pnmcut
54
#VDR_XINE_PNMTOJPEG = /usr/bin/pnmtojpeg
56
### The version number of VDR's plugin API (taken from VDR's "config.h"):
58
APIVERSION = $(shell (sed -ne '/define APIVERSION/s/^.*"\(.*\)".*$$/\1/p' $(VDRDIR)/config.h ; sed -ne '/define VDRVERSION/s/^.*"\(.*\)".*$$/\1/p' $(VDRDIR)/config.h) | sed -ne 1p)
60
### The name of the distribution archive:
62
ARCHIVE = $(PLUGIN)-$(VERSION)
63
PACKAGE = vdr-$(ARCHIVE)
65
### Includes and Defines (add further entries here):
67
INCLUDES += -I$(VDRDIR)/include
69
DEFINES += -D_GNU_SOURCE -DPLUGIN_NAME_I18N='"$(PLUGIN)"'
71
DEFINES += -DFIFO_DIR=\"$(VDR_XINE_FIFO_DIR)\"
73
DEFINES += -DVERIFY_BITMAP_DIRTY=$(VDR_XINE_VERIFY_BITMAP_DIRTY)
75
ifdef VDR_XINE_SET_VIDEO_WINDOW
76
DEFINES += -DSET_VIDEO_WINDOW
79
ifdef VDR_XINE_Y4MSCALER
80
DEFINES += -DY4MSCALER=\"$(VDR_XINE_Y4MSCALER)\"
83
ifdef VDR_XINE_Y4MTOPPM
84
DEFINES += -DY4MTOPPM=\"$(VDR_XINE_Y4MTOPPM)\"
88
DEFINES += -DPNMCUT=\"$(VDR_XINE_PNMCUT)\"
91
ifdef VDR_XINE_PNMTOJPEG
92
DEFINES += -DPNMTOJPEG=\"$(VDR_XINE_PNMTOJPEG)\"
95
### The object files (add further files here):
97
OBJS = $(PLUGIN).o xineDevice.o xineLib.o xineOsd.o xineSettings.o xineSetupPage.o xineRemote.o xineExternal.o
101
all: libvdr-$(PLUGIN).so i18n xineplayer
106
$(CXX) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) $<
110
MAKEDEP = $(CXX) -MM -MG
111
DEPFILE = .dependencies
113
@$(MAKEDEP) $(DEFINES) $(INCLUDES) $(OBJS:%.o=%.c) xineplayer.c > $@
117
### Internationalization (I18N):
120
LOCALEDIR = $(VDRDIR)/locale
121
I18Npo = $(wildcard $(PODIR)/*.po)
122
I18Nmo = $(addsuffix .mo, $(foreach file, $(I18Npo), $(basename $(file))))
123
I18Ndirs = $(notdir $(foreach file, $(I18Npo), $(basename $(file))))
124
I18Npot = $(PODIR)/$(PLUGIN).pot
129
$(I18Npot): $(wildcard *.c)
130
xgettext -C -cTRANSLATORS --no-wrap --no-location -k -ktr -ktrNOOP --msgid-bugs-address='Reinhard Nissl <rnissl@gmx.de>' -o $@ $(wildcard *.c)
132
$(I18Npo): $(I18Npot)
133
msgmerge -U --no-wrap --no-location --backup=none -q $@ $<
135
i18n: $(I18Npot) $(I18Nmo)
136
@mkdir -p $(LOCALEDIR)
137
for i in $(I18Ndirs); do\
138
mkdir -p $(LOCALEDIR)/$$i/LC_MESSAGES;\
139
cp $(PODIR)/$$i.mo $(LOCALEDIR)/$$i/LC_MESSAGES/vdr-$(PLUGIN).mo;\
144
libvdr-$(PLUGIN).so: $(OBJS) Makefile
145
$(CXX) $(CXXFLAGS) -shared $(OBJS) -o $@
146
@cp --remove-destination $@ $(LIBDIR)/$@.$(APIVERSION)
148
xineplayer: xineplayer.o Makefile
149
$(CXX) $(CXXFLAGS) xineplayer.o -o $@
152
@-rm -rf $(TMPDIR)/$(ARCHIVE)
153
@mkdir $(TMPDIR)/$(ARCHIVE)
154
@cp -a * $(TMPDIR)/$(ARCHIVE)
155
@tar czf $(PACKAGE).tgz -C $(TMPDIR) $(ARCHIVE)
156
@-rm -rf $(TMPDIR)/$(ARCHIVE)
157
@echo Distribution package created as $(PACKAGE).tgz
160
@-rm -f $(OBJS) $(DEPFILE) *.so *.tgz core* *~ $(PODIR)/*.mo $(PODIR)/*.pot xineplayer xineplayer.o