~ubuntu-branches/ubuntu/quantal/vdr-plugin-xine/quantal

« back to all changes in this revision

Viewing changes to Makefile

  • Committer: Bazaar Package Importer
  • Author(s): Thomas Schmidt
  • Date: 2008-04-06 21:34:14 UTC
  • Revision ID: james.westby@ubuntu.com-20080406213414-54lbe5pj1cbbquon
Tags: upstream-0.8.2
ImportĀ upstreamĀ versionĀ 0.8.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
# 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!
 
11
#
 
12
PLUGIN = xine
 
13
 
 
14
### The version number of this plugin (taken from the main source file):
 
15
 
 
16
VERSION = $(shell grep 'static const char \*VERSION *=' $(PLUGIN).c | awk '{ print $$6 }' | sed -e 's/[";]//g')
 
17
 
 
18
### The C++ compiler and options:
 
19
 
 
20
CXX      ?= g++
 
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
 
25
 
 
26
### The directory environment:
 
27
 
 
28
VDRDIR = ../../..
 
29
LIBDIR = ../../lib
 
30
TMPDIR = /tmp
 
31
 
 
32
### Allow user defined options to overwrite defaults:
 
33
 
 
34
-include $(VDRDIR)/Make.config
 
35
 
 
36
INCLUDES += `pkg-config --cflags libxine` 
 
37
 
 
38
# where to create fifos (xine expects them at /tmp/vdr-xine)
 
39
VDR_XINE_FIFO_DIR ?= /tmp/vdr-xine
 
40
 
 
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
 
46
 
 
47
# enable to fully support yaepg plugin
 
48
#VDR_XINE_SET_VIDEO_WINDOW = 1
 
49
 
 
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
 
55
 
 
56
### The version number of VDR's plugin API (taken from VDR's "config.h"):
 
57
 
 
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)
 
59
 
 
60
### The name of the distribution archive:
 
61
 
 
62
ARCHIVE = $(PLUGIN)-$(VERSION)
 
63
PACKAGE = vdr-$(ARCHIVE)
 
64
 
 
65
### Includes and Defines (add further entries here):
 
66
 
 
67
INCLUDES += -I$(VDRDIR)/include
 
68
 
 
69
DEFINES += -D_GNU_SOURCE -DPLUGIN_NAME_I18N='"$(PLUGIN)"'
 
70
 
 
71
DEFINES += -DFIFO_DIR=\"$(VDR_XINE_FIFO_DIR)\"
 
72
 
 
73
DEFINES += -DVERIFY_BITMAP_DIRTY=$(VDR_XINE_VERIFY_BITMAP_DIRTY)
 
74
 
 
75
ifdef VDR_XINE_SET_VIDEO_WINDOW
 
76
DEFINES += -DSET_VIDEO_WINDOW
 
77
endif
 
78
 
 
79
ifdef VDR_XINE_Y4MSCALER
 
80
DEFINES += -DY4MSCALER=\"$(VDR_XINE_Y4MSCALER)\"
 
81
endif
 
82
 
 
83
ifdef VDR_XINE_Y4MTOPPM
 
84
DEFINES += -DY4MTOPPM=\"$(VDR_XINE_Y4MTOPPM)\"
 
85
endif
 
86
 
 
87
ifdef VDR_XINE_PNMCUT
 
88
DEFINES += -DPNMCUT=\"$(VDR_XINE_PNMCUT)\"
 
89
endif
 
90
 
 
91
ifdef VDR_XINE_PNMTOJPEG
 
92
DEFINES += -DPNMTOJPEG=\"$(VDR_XINE_PNMTOJPEG)\"
 
93
endif
 
94
 
 
95
### The object files (add further files here):
 
96
 
 
97
OBJS = $(PLUGIN).o xineDevice.o xineLib.o xineOsd.o xineSettings.o xineSetupPage.o xineRemote.o xineExternal.o
 
98
 
 
99
### The main target:
 
100
 
 
101
all: libvdr-$(PLUGIN).so i18n xineplayer
 
102
 
 
103
### Implicit rules:
 
104
 
 
105
%.o: %.c Makefile
 
106
        $(CXX) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) $<
 
107
 
 
108
### Dependencies:
 
109
 
 
110
MAKEDEP = $(CXX) -MM -MG
 
111
DEPFILE = .dependencies
 
112
$(DEPFILE): Makefile
 
113
        @$(MAKEDEP) $(DEFINES) $(INCLUDES) $(OBJS:%.o=%.c) xineplayer.c > $@
 
114
 
 
115
-include $(DEPFILE)
 
116
 
 
117
### Internationalization (I18N):
 
118
 
 
119
PODIR     = po
 
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
 
125
 
 
126
%.mo: %.po
 
127
        msgfmt -c -o $@ $<
 
128
 
 
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)
 
131
 
 
132
$(I18Npo): $(I18Npot)
 
133
        msgmerge -U --no-wrap --no-location --backup=none -q $@ $<
 
134
 
 
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;\
 
140
            done
 
141
 
 
142
### Targets:
 
143
 
 
144
libvdr-$(PLUGIN).so: $(OBJS) Makefile
 
145
        $(CXX) $(CXXFLAGS) -shared $(OBJS) -o $@
 
146
        @cp --remove-destination $@ $(LIBDIR)/$@.$(APIVERSION)
 
147
 
 
148
xineplayer: xineplayer.o Makefile
 
149
        $(CXX) $(CXXFLAGS) xineplayer.o -o $@
 
150
 
 
151
dist: clean
 
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
 
158
 
 
159
clean:
 
160
        @-rm -f $(OBJS) $(DEPFILE) *.so *.tgz core* *~ $(PODIR)/*.mo $(PODIR)/*.pot xineplayer xineplayer.o