Skip to content

Commit 0819872

Browse files
author
Frank Schmirler
committed
Adapted Makefiles to VDR 1.7.36+ (thanks to macmenot). Old makefiles have
been renamed to Makefile-1.7.33 (fixes #1199)
1 parent 10db11a commit 0819872

File tree

9 files changed

+360
-82
lines changed

9 files changed

+360
-82
lines changed

CONTRIBUTORS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,3 +211,6 @@ Uwe
211211

212212
Chris Tallon
213213
for his kind permission to use VOMP's recplayer for replaying recordings
214+
215+
macmenot
216+
for adapting Makefiles to VDR 1.7.36+

HISTORY

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
VDR Plugin 'streamdev' Revision History
22
---------------------------------------
33

4+
- Adapted Makefiles to VDR 1.7.36+ (thanks to macmenot). Old makefiles have
5+
been renamed to Makefile-1.7.33.
46
- API changes of VDR 1.7.38 (thanks to mal@vdr-developer)
57
- Added simple recordings menu in HTTP server
68
- Restructured menuHTTP classes

Makefile

Lines changed: 25 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,44 @@
11
#
22
# Makefile for a Video Disk Recorder plugin
33
#
4-
# $Id: Makefile,v 1.23 2010/08/02 10:36:59 schmirl Exp $
4+
# $Id: $
55

6-
# The main source file name.
7-
#
8-
PLUGIN = streamdev
9-
10-
### The C/C++ compiler and options:
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.
119

12-
CC ?= gcc
13-
CFLAGS ?= -g -O2 -Wall
14-
15-
CXX ?= g++
16-
CXXFLAGS ?= -g -O2 -Wall -Woverloaded-virtual -Wno-parentheses
10+
PLUGIN = streamdev
1711

1812
### The version number of this plugin (taken from the main source file):
1913

2014
VERSION = $(shell grep 'const char \*VERSION *=' common.c | awk '{ print $$5 }' | sed -e 's/[";]//g')
2115

2216
### The directory environment:
2317

24-
VDRDIR = ../../..
25-
LIBDIR = ../../lib
26-
TMPDIR = /tmp
18+
# Use package data if installed...otherwise assume we're under the VDR source directory:
19+
PKGCFG = $(if $(VDRDIR),$(shell pkg-config --variable=$(1) $(VDRDIR)/vdr.pc),$(shell pkg-config --variable=$(1) vdr || pkg-config --variable=$(1) ../../../vdr.pc))
20+
LIBDIR = $(call PKGCFG,libdir)
21+
LOCDIR = $(call PKGCFG,locdir)
22+
PLGCFG = $(call PKGCFG,plgcfg)
23+
#
24+
TMPDIR ?= /tmp
25+
26+
### The compiler options:
2727

28-
### The version number of VDR (taken from VDR's "config.h"):
28+
export CFLAGS = $(call PKGCFG,cflags)
29+
export CXXFLAGS = $(call PKGCFG,cxxflags)
2930

30-
APIVERSION = $(shell grep 'define APIVERSION ' $(VDRDIR)/config.h | awk '{ print $$3 }' | sed -e 's/"//g')
31-
APIVERSNUM = $(shell grep 'define APIVERSNUM ' $(VDRDIR)/config.h | awk '{ print $$3 }' | sed -e 's/"//g')
32-
TSPLAYVERSNUM = $(shell grep 'define TSPLAY_PATCH_VERSION ' $(VDRDIR)/device.h | awk '{ print $$3 }')
31+
### The version number of VDR's plugin API:
3332

34-
### Allow user defined options to overwrite defaults:
33+
APIVERSION = $(call PKGCFG,apiversion)
3534

36-
ifeq ($(shell test $(APIVERSNUM) -ge 10713; echo $$?),0)
37-
include $(VDRDIR)/Make.global
38-
else
39-
ifeq ($(shell test $(APIVERSNUM) -ge 10704 -o -n "$(TSPLAYVERSNUM)" ; echo $$?),0)
40-
DEFINES += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
41-
CFLAGS += -fPIC
42-
CXXFLAGS += -fPIC
43-
else
44-
CFLAGS += -fPIC
45-
CXXFLAGS += -fPIC
46-
endif
47-
endif
35+
### Allow user defined options to overwrite defaults:
4836

49-
-include $(VDRDIR)/Make.config
37+
-include $(PLGCFG)
5038

5139
### export all vars for sub-makes, using absolute paths
52-
53-
VDRDIR := $(shell cd $(VDRDIR) >/dev/null 2>&1 && pwd)
5440
LIBDIR := $(shell cd $(LIBDIR) >/dev/null 2>&1 && pwd)
41+
LOCDIR := $(shell cd $(LOCDIR) >/dev/null 2>&1 && pwd)
5542
export
5643
unexport PLUGIN
5744

@@ -63,6 +50,7 @@ PACKAGE = vdr-$(ARCHIVE)
6350
### Includes and Defines (add further entries here):
6451

6552
INCLUDES += -I$(VDRDIR)/include -I..
53+
export INCLUDES
6654

6755
DEFINES += -D_GNU_SOURCE
6856

@@ -82,21 +70,21 @@ all: client server
8270

8371
client:
8472
$(MAKE) -C ./tools
85-
$(MAKE) -C ./client
73+
$(MAKE) -C ./client install
8674
# installs to $(LIBDIR)/libvdr-streamdev-client.so.$(APIVERSION)
8775

8876
server:
8977
$(MAKE) -C ./tools
9078
$(MAKE) -C ./libdvbmpeg
9179
$(MAKE) -C ./remux
92-
$(MAKE) -C ./server
80+
$(MAKE) -C ./server install
9381
# installs to $(LIBDIR)/libvdr-streamdev-server.so.$(APIVERSION)
9482

9583
dist: clean
9684
@-rm -rf $(TMPDIR)/$(ARCHIVE)
9785
@mkdir $(TMPDIR)/$(ARCHIVE)
9886
@cp -a * $(TMPDIR)/$(ARCHIVE)
99-
@tar czf $(PACKAGE).tgz --exclude CVS -C $(TMPDIR) $(ARCHIVE)
87+
@tar czf $(PACKAGE).tgz -C $(TMPDIR) $(ARCHIVE)
10088
@-rm -rf $(TMPDIR)/$(ARCHIVE)
10189
@echo Distribution package created as $(PACKAGE).tgz
10290

Makefile-1.7.33

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
#
2+
# Makefile for a Video Disk Recorder plugin
3+
#
4+
# $Id: Makefile,v 1.23 2010/08/02 10:36:59 schmirl Exp $
5+
6+
# The main source file name.
7+
#
8+
PLUGIN = streamdev
9+
10+
### The C/C++ compiler and options:
11+
12+
CC ?= gcc
13+
CFLAGS ?= -g -O2 -Wall
14+
15+
CXX ?= g++
16+
CXXFLAGS ?= -g -O2 -Wall -Woverloaded-virtual -Wno-parentheses
17+
18+
### The version number of this plugin (taken from the main source file):
19+
20+
VERSION = $(shell grep 'const char \*VERSION *=' common.c | awk '{ print $$5 }' | sed -e 's/[";]//g')
21+
22+
### The directory environment:
23+
24+
VDRDIR = ../../..
25+
LIBDIR = ../../lib
26+
TMPDIR = /tmp
27+
28+
### The version number of VDR (taken from VDR's "config.h"):
29+
30+
APIVERSION = $(shell grep 'define APIVERSION ' $(VDRDIR)/config.h | awk '{ print $$3 }' | sed -e 's/"//g')
31+
APIVERSNUM = $(shell grep 'define APIVERSNUM ' $(VDRDIR)/config.h | awk '{ print $$3 }' | sed -e 's/"//g')
32+
TSPLAYVERSNUM = $(shell grep 'define TSPLAY_PATCH_VERSION ' $(VDRDIR)/device.h | awk '{ print $$3 }')
33+
34+
### Allow user defined options to overwrite defaults:
35+
36+
ifeq ($(shell test $(APIVERSNUM) -ge 10713; echo $$?),0)
37+
include $(VDRDIR)/Make.global
38+
else
39+
ifeq ($(shell test $(APIVERSNUM) -ge 10704 -o -n "$(TSPLAYVERSNUM)" ; echo $$?),0)
40+
DEFINES += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
41+
CFLAGS += -fPIC
42+
CXXFLAGS += -fPIC
43+
else
44+
CFLAGS += -fPIC
45+
CXXFLAGS += -fPIC
46+
endif
47+
endif
48+
49+
-include $(VDRDIR)/Make.config
50+
51+
### export all vars for sub-makes, using absolute paths
52+
53+
VDRDIR := $(shell cd $(VDRDIR) >/dev/null 2>&1 && pwd)
54+
LIBDIR := $(shell cd $(LIBDIR) >/dev/null 2>&1 && pwd)
55+
export
56+
unexport PLUGIN
57+
58+
### The name of the distribution archive:
59+
60+
ARCHIVE = $(PLUGIN)-$(VERSION)
61+
PACKAGE = vdr-$(ARCHIVE)
62+
63+
### Includes and Defines (add further entries here):
64+
65+
INCLUDES += -I$(VDRDIR)/include -I..
66+
67+
DEFINES += -D_GNU_SOURCE
68+
69+
ifdef DEBUG
70+
DEFINES += -DDEBUG
71+
endif
72+
ifdef STREAMDEV_DEBUG
73+
DEFINES += -DDEBUG
74+
endif
75+
76+
### The main target:
77+
78+
.PHONY: all client server dist clean
79+
all: client server
80+
81+
### Targets:
82+
83+
client:
84+
$(MAKE) -C ./tools
85+
$(MAKE) -C ./client
86+
# installs to $(LIBDIR)/libvdr-streamdev-client.so.$(APIVERSION)
87+
88+
server:
89+
$(MAKE) -C ./tools
90+
$(MAKE) -C ./libdvbmpeg
91+
$(MAKE) -C ./remux
92+
$(MAKE) -C ./server
93+
# installs to $(LIBDIR)/libvdr-streamdev-server.so.$(APIVERSION)
94+
95+
dist: clean
96+
@-rm -rf $(TMPDIR)/$(ARCHIVE)
97+
@mkdir $(TMPDIR)/$(ARCHIVE)
98+
@cp -a * $(TMPDIR)/$(ARCHIVE)
99+
@tar czf $(PACKAGE).tgz --exclude CVS -C $(TMPDIR) $(ARCHIVE)
100+
@-rm -rf $(TMPDIR)/$(ARCHIVE)
101+
@echo Distribution package created as $(PACKAGE).tgz
102+
103+
clean:
104+
$(MAKE) -C ./tools clean
105+
$(MAKE) -C ./libdvbmpeg clean
106+
$(MAKE) -C ./remux clean
107+
$(MAKE) -C ./client clean
108+
$(MAKE) -C ./server clean

README

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,11 @@ the streamdev-0.5.x releases for older versions.
107107
2.2 Compiling:
108108
--------------
109109

110+
The Makefiles are for VDR 1.7.36 and above. For VDR 1.7.33 and below, please
111+
replace the Makefiles in the main directory and in the client/ and server/
112+
subdirectories with the corresponding Makefile-1.7.33 files. With VDR 1.7.34 and
113+
1.7.35 YMMV ;)
114+
110115
cd vdr-1.X.X/PLUGINS/src
111116
tar xvfz vdr-streamdev-0.5.0.tgz
112117
ln -s streamdev-0.5.0 streamdev

client/Makefile

Lines changed: 25 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
#
22
# Makefile for a Video Disk Recorder plugin
33
#
4-
# $Id: Makefile,v 1.2 2010/07/19 13:49:25 schmirl Exp $
4+
# $Id: $
55

66
# The official name of this plugin.
77
# This name will be used in the '-P...' option of VDR to load the plugin.
88
# By default the main source file also carries this name.
9-
#
9+
1010
PLUGIN = streamdev-client
1111

12+
### The name of the shared object file:
13+
14+
SOFILE = libvdr-$(PLUGIN).so
15+
1216
### Includes and Defines (add further entries here):
1317

1418
DEFINES += -DPLUGIN_NAME_I18N='"$(PLUGIN)"'
@@ -22,8 +26,7 @@ CLIENTOBJS = $(PLUGIN).o \
2226

2327
### The main target:
2428

25-
.PHONY: all i18n dist clean
26-
all: libvdr-$(PLUGIN).so i18n
29+
all: $(SOFILE) i18n
2730

2831
### Implicit rules:
2932

@@ -34,51 +37,47 @@ all: libvdr-$(PLUGIN).so i18n
3437

3538
MAKEDEP = $(CXX) -MM -MG
3639
DEPFILE = .dependencies
37-
3840
$(DEPFILE): Makefile
39-
@$(MAKEDEP) $(DEFINES) $(INCLUDES) $(CLIENTOBJS:%.o=%.c) $(COMMONOBJS:%.o=%.c) > $@
41+
@$(MAKEDEP) $(CXXFLAGS) $(DEFINES) $(INCLUDES) $(CLIENTOBJS:%.o=%.c) $(COMMONOBJS:%.o=%.c) > $@
4042

4143
-include $(DEPFILE)
4244

4345
### Internationalization (I18N):
4446

4547
PODIR = po
46-
LOCALEDIR = $(VDRDIR)/locale
4748
I18Npo = $(wildcard $(PODIR)/*.po)
48-
I18Nmsgs = $(addprefix $(LOCALEDIR)/, $(addsuffix /LC_MESSAGES/vdr-$(PLUGIN).mo, $(notdir $(foreach file, $(I18Npo), $(basename $(file))))))
49+
I18Nmo = $(addsuffix .mo, $(foreach file, $(I18Npo), $(basename $(file))))
50+
I18Nmsgs = $(addprefix $(DESTDIR)$(LOCDIR)/, $(addsuffix /LC_MESSAGES/vdr-$(PLUGIN).mo, $(notdir $(foreach file, $(I18Npo), $(basename $(file))))))
4951
I18Npot = $(PODIR)/$(PLUGIN).pot
5052

5153
%.mo: %.po
5254
msgfmt -c -o $@ $<
5355

5456
$(I18Npot): $(CLIENTOBJS:%.o=%.c)
55-
xgettext -C -cTRANSLATORS --no-wrap --no-location -k -ktr -ktrNOOP --msgid-bugs-address='<http://www.vdr-developer.org/mantisbt/>' -o $@ $^
57+
xgettext -C -cTRANSLATORS --no-wrap --no-location -k -ktr -ktrNOOP --package-name=vdr-$(PLUGIN) --package-version=$(VERSION) --msgid-bugs-address='<[email protected]>' -o $@ `ls $^`
5658

5759
%.po: $(I18Npot)
58-
msgmerge -U --no-wrap --no-location --backup=none -q $@ $<
60+
msgmerge -U --no-wrap --no-location --backup=none -q -N $@ $<
5961
@touch $@
6062

61-
$(I18Nmsgs): $(LOCALEDIR)/%/LC_MESSAGES/vdr-$(PLUGIN).mo: $(PODIR)/%.mo
62-
@mkdir -p $(dir $@)
63-
cp $< $@
63+
$(I18Nmsgs): $(DESTDIR)$(LOCDIR)/%/LC_MESSAGES/vdr-$(PLUGIN).mo: $(PODIR)/%.mo
64+
install -D -m644 $< $@
65+
66+
.PHONY: i18n
67+
i18n: $(I18Nmo) $(I18Npot)
6468

65-
i18n: $(I18Nmsgs)
69+
install-i18n: $(I18Nmsgs)
6670

6771
### Targets:
6872

69-
libvdr-$(PLUGIN).so: $(CLIENTOBJS) $(COMMONOBJS) ../tools/sockettools.a
73+
$(SOFILE): $(CLIENTOBJS) $(COMMONOBJS) ../tools/sockettools.a
74+
$(CXX) $(CXXFLAGS) $(LDFLAGS) -shared $^ -o $@
7075

71-
%.so:
72-
$(CXX) $(CXXFLAGS) -shared $^ -o $@
73-
@cp --remove-destination $@ $(LIBDIR)/$@.$(APIVERSION)
76+
install-lib: $(SOFILE)
77+
install -D $^ $(DESTDIR)$(LIBDIR)/$^.$(APIVERSION)
7478

75-
dist: clean
76-
@-rm -rf $(TMPDIR)/$(ARCHIVE)
77-
@mkdir $(TMPDIR)/$(ARCHIVE)
78-
@cp -a * $(TMPDIR)/$(ARCHIVE)
79-
@tar czf $(PACKAGE).tgz --exclude CVS -C $(TMPDIR) $(ARCHIVE)
80-
@-rm -rf $(TMPDIR)/$(ARCHIVE)
81-
@echo Distribution package created as $(PACKAGE).tgz
79+
install: install-lib install-i18n
8280

8381
clean:
84-
@-rm -f $(COMMONOBJS) $(CLIENTOBJS) $(DEPFILE) $(PODIR)/*.mo $(PODIR)/*.pot *.so *.tgz core* *~
82+
@-rm -f $(PODIR)/*.mo $(PODIR)/*.pot
83+
@-rm -f $(COMMONOBJS) $(CLIENTOBJS) $(DEPFILE) *.so *.tgz core* *~

0 commit comments

Comments
 (0)