diff options
-rw-r--r-- | Makefile | 126 | ||||
-rw-r--r-- | css/Makefile | 33 | ||||
-rw-r--r-- | debian/links | 8 | ||||
-rwxr-xr-x | debian/rules | 7 | ||||
-rw-r--r-- | httpd/Makefile | 19 | ||||
-rw-r--r-- | javascript/Makefile | 33 | ||||
-rw-r--r-- | pages/Makefile | 34 |
7 files changed, 75 insertions, 185 deletions
@@ -5,47 +5,36 @@ # The official name of this plugin. # This name will be used in the '-P...' option of VDR to load the plugin. # By default the main source file also carries this name. -# IPORTANT: the presence of this macro is important for the Make.config -# file. So it must be defined, even if it is not used here! -# PLUGIN = live ### The version number of this plugin (taken from the main source file): - VERSION = $(shell grep '\#define LIVEVERSION ' setup.h | awk '{ print $$3 }' | sed -e 's/[";]//g') -### The C++ compiler and options: - -CXX ?= g++ -ECPPC ?= ecppc - -### This variable is overriden in pages/Makefile because we don't want the -### extra warnings in the tntnet generated files. So if you change here -### something be sure to check pages/Makefile too. -CXXFLAGS ?= -fPIC -O2 -Wall -LDFLAGS ?= -fPIC -g - ### Check for libpcre c++ wrapper HAVE_LIBPCRECPP = $(shell pcre-config --libs-cpp) ### The directory environment: +# Use package data if installed...otherwise assume we're under the VDR source directory: +PKGCFG = $(if $(VDRDIR),$(shell pkg-config --variable=$(1) $(VDRDIR)/vdr.pc),$(shell pkg-config --variable=$(1) vdr || pkg-config --variable=$(1) ../../../vdr.pc)) +LIBDIR = $(call PKGCFG,libdir) +LOCDIR = $(call PKGCFG,locdir) +PLGCFG = $(call PKGCFG,plgcfg) +# +TMPDIR ?= /tmp -VDRDIR ?= ../../.. -LIBDIR ?= ../../lib -TMPDIR ?= /tmp +### The compiler options: +export CFLAGS = $(call PKGCFG,cflags) +export CXXFLAGS = $(call PKGCFG,cxxflags) -### Make sure that necessary options are included: +ECPPC ?= ecppc --include $(VDRDIR)/Make.global +### The version number of VDR's plugin API: +APIVERSION = $(call PKGCFG,apiversion) ### Allow user defined options to overwrite defaults: +-include $(PLGCFG) --include $(VDRDIR)/Make.config - -### The version number of VDR's plugin API (taken from VDR's "config.h"): - -APIVERSION = $(shell sed -ne '/define APIVERSION/s/^.*"\(.*\)".*$$/\1/p' $(VDRDIR)/config.h) -I18NTARG = $(shell if [ `echo $(APIVERSION) | tr [.] [0]` -ge "10507" ]; then echo "i18n"; fi) +### Determine tntnet and cxxtools versions: TNTVERSION = $(shell tntnet-config --version | sed -e's/\.//g' | sed -e's/pre.*//g' | awk '/^..$$/ { print $$1."000"} /^...$$/ { print $$1."00"} /^....$$/ { print $$1."0" } /^.....$$/ { print $$1 }') CXXTOOLVER = $(shell cxxtools-config --version | sed -e's/\.//g' | sed -e's/pre.*//g' | awk '/^..$$/ { print $$1."000"} /^...$$/ { print $$1."00"} /^....$$/ { print $$1."0" } /^.....$$/ { print $$1 }') TNTVERS7 = $(shell ver=$(TNTVERSION); if [ $$ver -ge "1606" ]; then echo "yes"; fi) @@ -61,14 +50,20 @@ ifneq ($(HAVE_LIBPCRECPP),) LIBS += $(HAVE_LIBPCRECPP) endif -### The name of the distribution archive: +### export all vars for sub-makes, using absolute paths +LIBDIR := $(shell cd $(LIBDIR) >/dev/null 2>&1 && pwd) +LOCDIR := $(shell cd $(LOCDIR) >/dev/null 2>&1 && pwd) +export +unexport PLUGIN +### The name of the distribution archive: ARCHIVE = $(PLUGIN)-$(VERSION) PACKAGE = vdr-$(ARCHIVE) -### Includes and Defines (add further entries here): +### The name of the shared object file: +SOFILE = libvdr-$(PLUGIN).so -INCLUDES += -I$(VDRDIR)/include +### Includes and Defines (add further entries here): ifneq ($(TNTVERS7),yes) INCLUDES += -Ihttpd LIBS += httpd/libhttpd.a @@ -84,7 +79,6 @@ endif VERSIONSUFFIX = gen_version_suffix.h ### The object files (add further files here): - PLUGINOBJS = $(PLUGIN).o thread.o tntconfig.o setup.o i18n.o timers.o \ tools.o recman.o tasks.o status.o epg_events.o epgsearch.o \ grab.o md5.o filecache.o livefeatures.o preload.o timerconflict.o \ @@ -92,40 +86,29 @@ PLUGINOBJS = $(PLUGIN).o thread.o tntconfig.o setup.o i18n.o timers.o \ WEBLIBS = pages/libpages.a css/libcss.a javascript/libjavascript.a -### Default rules: - -all: libvdr-$(PLUGIN).so $(I18NTARG) - -.PHONY: all dist clean subdirs $(SUBDIRS) PAGES +### The main target: +all: $(SOFILE) i18n ### Implicit rules: - %.o: %.cpp $(CXX) $(CXXFLAGS) -c $(DEFINES) $(PLUGINFEATURES) $(INCLUDES) $< -# Dependencies: - +### Dependencies: MAKEDEP = $(CXX) -MM -MG DEPFILE = .dependencies $(DEPFILE): Makefile - @$(MAKEDEP) $(DEFINES) $(PLUGINFEATURES) $(INCLUDES) $(PLUGINOBJS:%.o=%.cpp) > $@ + @$(MAKEDEP) $(CXXFLAGS) $(DEFINES) $(PLUGINFEATURES) $(INCLUDES) $(PLUGINOBJS:%.o=%.cpp) > $@ ifneq ($(MAKECMDGOALS),clean) -include $(DEPFILE) endif ### Internationalization (I18N): - -PODIR = po -LOCALEDIR = $(VDRDIR)/locale -I18Npo = $(wildcard $(PODIR)/*.po) -I18Nmo = $(addsuffix .mo, $(foreach file, $(I18Npo), $(basename $(file)))) -I18Ndirs = $(notdir $(foreach file, $(I18Npo), $(basename $(file)))) -I18Npot = $(PODIR)/$(PLUGIN).pot -I18Nvdrmo = vdr-$(PLUGIN).mo -ifeq ($(strip $(APIVERSION)),1.5.7) - I18Nvdrmo = $(PLUGIN).mo -endif +PODIR = po +I18Npo = $(wildcard $(PODIR)/*.po) +I18Nmo = $(addsuffix .mo, $(foreach file, $(I18Npo), $(basename $(file)))) +I18Nmsgs = $(addprefix $(DESTDIR)$(LOCDIR)/, $(addsuffix /LC_MESSAGES/vdr-$(PLUGIN).mo, $(notdir $(foreach file, $(I18Npo), $(basename $(file)))))) +I18Npot = $(PODIR)/$(PLUGIN).pot %.mo: %.po msgfmt -c -o $@ $< @@ -133,35 +116,38 @@ endif $(I18Npot): PAGES $(PLUGINOBJS:%.o=%.cpp) xgettext -C -cTRANSLATORS --no-wrap --no-location -k -ktr -ktrNOOP --omit-header -o $@ $(PLUGINOBJS:%.o=%.cpp) pages/*.cpp setup.h epg_events.h -$(I18Npo): $(I18Npot) - msgmerge -U --no-wrap --no-location --backup=none -q $@ $< - -i18n: $(I18Nmo) - @mkdir -p $(LOCALEDIR) - for i in $(I18Ndirs); do\ - mkdir -p $(LOCALEDIR)/$$i/LC_MESSAGES;\ - cp $(PODIR)/$$i.mo $(LOCALEDIR)/$$i/LC_MESSAGES/$(I18Nvdrmo);\ - done +%.po: $(I18Npot) + msgmerge -U --no-wrap --no-location --backup=none -q -N $@ $< + @touch $@ -generate-i18n: i18n-template.h $(I18Npot) $(I18Npo) buildutil/pot2i18n.pl - buildutil/pot2i18n.pl $(I18Npot) i18n-template.h > i18n-generated.h +$(I18Nmsgs): $(DESTDIR)$(LOCDIR)/%/LC_MESSAGES/vdr-$(PLUGIN).mo: $(PODIR)/%.mo + install -D -m644 $< $@ -### Targets: +.PHONY: i18n +i18n: $(I18Nmo) $(I18Npot) -subdirs: $(SUBDIRS) +install-i18n: $(I18Nmsgs) -$(SUBDIRS): - @$(MAKE) -C $@ $(MAKECMDGOALS) PLUGINFEATURES="$(PLUGINFEATURES)" +#generate-i18n: i18n-template.h $(I18Npot) $(I18Npo) buildutil/pot2i18n.pl +# buildutil/pot2i18n.pl $(I18Npot) i18n-template.h > i18n-generated.h +### Targets: PAGES: - @$(MAKE) -C pages PLUGINFEATURES="$(PLUGINFEATURES)" .dependencies + $(MAKE) -C pages PLUGINFEATURES="$(PLUGINFEATURES)" .dependencies $(VERSIONSUFFIX): FORCE ./buildutil/version-util $(VERSIONSUFFIX) || ./buildutil/version-util -F $(VERSIONSUFFIX) -libvdr-$(PLUGIN).so: $(VERSIONSUFFIX) $(SUBDIRS) $(PLUGINOBJS) - $(CXX) $(LDFLAGS) -shared -o $@ $(PLUGINOBJS) -Wl,--whole-archive $(WEBLIBS) -Wl,--no-whole-archive $(LIBS) - @cp --remove-destination $@ $(LIBDIR)/$@.$(APIVERSION) +$(SOFILE): $(VERSIONSUFFIX) $(SUBDIRS) $(PLUGINOBJS) + for SUBDIR in $(SUBDIRS); \ + do $(MAKE) -C $${SUBDIR} PLUGINFEATURES="$(PLUGINFEATURES)" all; \ + done + $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared $(PLUGINOBJS) -Wl,--whole-archive $(WEBLIBS) -Wl,--no-whole-archive $(LIBS) -o $@ + +install-lib: $(SOFILE) + install -D $^ $(DESTDIR)$(LIBDIR)/$^.$(APIVERSION) + +install: install-lib install-i18n ifneq ($(TNTVERS7),yes) @echo "" @@ -186,7 +172,7 @@ ifneq ($(TNTVERS7),yes) @echo "" endif -dist: clean +dist: $(I18Npo) clean @-rm -rf $(TMPDIR)/$(ARCHIVE) @mkdir $(TMPDIR)/$(ARCHIVE) @cp -a * $(TMPDIR)/$(ARCHIVE) diff --git a/css/Makefile b/css/Makefile index 0ce391c..4a5528f 100644 --- a/css/Makefile +++ b/css/Makefile @@ -1,48 +1,20 @@ -# The official name of this plugin. - +### The official name of this plugin. PLUGIN = live ### Additional options to silence TNTNET warnings TNTFLAGS ?= -Wno-overloaded-virtual -Wno-unused-function TNTVERSION ?= $(shell tntnet-config --version | sed -e's/\.//g' | sed -e's/pre.*//g' | awk '/^..$$/ { print $$1."000"} /^...$$/ { print $$1."00"} /^....$$/ { print $$1."0" } /^.....$$/ { print $$1 }') -### The C++ compiler and options: - -CXX ?= g++ -AR ?= ar -ECPPC ?= ecppc - -CXXFLAGS ?= -O2 -Woverloaded-virtual -Wall -fPIC -DEFINES ?= -DPLUGIN_NAME_I18N='"$(PLUGIN)"' -DTNTVERSION=$(TNTVERSION) - -### The directory environment: - -VDRDIR ?= ../../../.. - -### Make sure that necessary options are included: - --include $(VDRDIR)/Make.global - -### Allow user defined options to overwrite defaults: - --include $(VDRDIR)/Make.config - ### Includes and Defines (add further entries here): - INCLUDES += -I$(VDRDIR)/include -I.. ### The object files (add further files here): - OBJS = styles.o -### Default rules: - -.PHONY: all clean - +### The main target: all: libcss.a ### Implicit rules: - %.o: %.cpp $(CXX) $(CXXFLAGS) $(TNTFLAGS) -c $(DEFINES) $(PLUGINFEATURES) $(INCLUDES) $< @@ -50,7 +22,6 @@ all: libcss.a $(ECPPC) $(ECPPFLAGS) $(ECPPFLAGS_CSS) -b -m "text/css" $< ### Targets: - libcss.a: $(OBJS) $(AR) r $@ $^ diff --git a/debian/links b/debian/links index a09ac13..a01823d 100644 --- a/debian/links +++ b/debian/links @@ -1,4 +1,4 @@ -usr/share/vdr-plugin-live/css var/lib/vdr/plugins/live/css -usr/share/vdr-plugin-live/img var/lib/vdr/plugins/live/img -usr/share/vdr-plugin-live/js var/lib/vdr/plugins/live/js -usr/share/vdr-plugin-live/themes var/lib/vdr/plugins/live/themes +usr/share/vdr-plugin-live/css usr/share/vdr/plugins/live/css +usr/share/vdr-plugin-live/img usr/share/vdr/plugins/live/img +usr/share/vdr-plugin-live/js usr/share/vdr/plugins/live/js +usr/share/vdr-plugin-live/themes usr/share/vdr/plugins/live/themes diff --git a/debian/rules b/debian/rules index fc7104f..8cac789 100755 --- a/debian/rules +++ b/debian/rules @@ -1,4 +1,4 @@ -#! /bin/sh /usr/share/vdr-dev/make-special-vdr.sh +#!/usr/bin/make -f # Sample debian/rules that uses debhelper. # GNU copyright 1997 to 1999 by Joey Hess. @@ -23,7 +23,7 @@ patch-stamp: unpatch: endif -MAKE_OPTIONS = DVBDIR=/usr VDRDIR=/usr/include/vdr LIBDIR=. +MAKE_OPTIONS = DVBDIR=/usr LIBDIR=. LOCDIR=locale configure: configure-stamp configure-stamp: patch-stamp @@ -51,6 +51,7 @@ install: build dh_testroot dh_clean -k dh_installdirs + $(MAKE) install $(MAKE_OPTIONS) dh_install # Build architecture-independent files here. @@ -83,7 +84,7 @@ binary-arch: build install dh_installdeb # dh_perl dh_shlibdeps - sh /usr/share/vdr-dev/patchlevel.sh subst +# sh /usr/share/vdr-dev/patchlevel.sh subst sh /usr/share/vdr-dev/dependencies.sh dh_gencontrol dh_md5sums diff --git a/httpd/Makefile b/httpd/Makefile index a11d57c..d21eb2f 100644 --- a/httpd/Makefile +++ b/httpd/Makefile @@ -1,23 +1,14 @@ -CXX ?= g++ -AR ?= ar - -CXXFLAGS ?= -O2 -Woverloaded-virtual -Wall -fPIC - -CXXFLAGS += `tntnet-config --cxxflags` +### The official name of this plugin. +PLUGIN = live ### Includes and Defines (add further entries here): - INCLUDES += -I. ### The object files (add further files here): - OBJS = dispatcher.o job.o regex.o worker.o \ listener.o poller.o tntnet.o -### Default rules: - -.PHONY: all clean - +### The main target: all: libhttpd.a ### Implicit rules: @@ -25,8 +16,7 @@ all: libhttpd.a %.o: %.cpp $(CXX) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) -o $@ $< -# Dependencies: - +### Dependencies: MAKEDEP = $(CXX) -MM -MG DEPFILE = .dependencies $(DEPFILE): Makefile @@ -35,7 +25,6 @@ $(DEPFILE): Makefile -include $(DEPFILE) ### Targets: - libhttpd.a: $(OBJS) $(AR) r $@ $^ diff --git a/javascript/Makefile b/javascript/Makefile index 50f3b52..b2ed3c4 100644 --- a/javascript/Makefile +++ b/javascript/Makefile @@ -1,48 +1,20 @@ -# The official name of this plugin. - +### The official name of this plugin. PLUGIN = live ### Additional options to silence TNTNET warnings TNTFLAGS ?= -Wno-overloaded-virtual -Wno-unused-function TNTVERSION ?= $(shell tntnet-config --version | sed -e's/\.//g' | sed -e's/pre.*//g' | awk '/^..$$/ { print $$1."000"} /^...$$/ { print $$1."00"} /^....$$/ { print $$1."0" } /^.....$$/ { print $$1 }') -### The C++ compiler and options: - -CXX ?= g++ -AR ?= ar -ECPPC ?= ecppc - -CXXFLAGS ?= -O2 -Woverloaded-virtual -Wall -fPIC -DEFINES ?= -DPLUGIN_NAME_I18N='"$(PLUGIN)"' -DTNTVERSION=$(TNTVERSION) - -### The directory environment: - -VDRDIR ?= ../../../.. - -### Make sure that necessary options are included: - --include $(VDRDIR)/Make.global - -### Allow user defined options to overwrite defaults: - --include $(VDRDIR)/Make.config - ### Includes and Defines (add further entries here): - INCLUDES += -I$(VDRDIR)/include -I.. ### The object files (add further files here): - OBJS = treeview.o -### Default rules: - -.PHONY: all clean - +### The main target: all: libjavascript.a ### Implicit rules: - %.o: %.cpp $(CXX) $(CXXFLAGS) $(TNTFLAGS) -c $(DEFINES) $(PLUGINFEATURES) $(INCLUDES) $< @@ -50,7 +22,6 @@ all: libjavascript.a $(ECPPC) $(ECPPFLAGS) $(ECPPFLAGS_JS) -b -m "text/javascript" $< ### Targets: - libjavascript.a: $(OBJS) $(AR) r $@ $^ diff --git a/pages/Makefile b/pages/Makefile index 78a4a9c..520b208 100644 --- a/pages/Makefile +++ b/pages/Makefile @@ -1,5 +1,4 @@ -# The official name of this plugin. - +### The official name of this plugin. PLUGIN = live ### Additional options to silence TNTNET warnings @@ -7,33 +6,11 @@ TNTFLAGS ?= -Wno-overloaded-virtual -Wno-unused-variable TNTVERSION ?= $(shell tntnet-config --version | sed -e's/\.//g' | sed -e's/pre.*//g' | awk '/^..$$/ { print $$1."000"} /^...$$/ { print $$1."00"} /^....$$/ { print $$1."0" } /^.....$$/ { print $$1 }') CXXTOOLVER ?= $(shell cxxtools-config --version | sed -e's/\.//g' | sed -e's/pre.*//g' | awk '/^..$$/ { print $$1."000"} /^...$$/ { print $$1."00"} /^....$$/ { print $$1."0" } /^.....$$/ { print $$1 }') -### The C++ compiler and options: - -CXX ?= g++ -AR ?= ar -ECPPC ?= ecppc - -CXXFLAGS ?= -O2 -Woverloaded-virtual -Wall -fPIC -DEFINES ?= -DPLUGIN_NAME_I18N='"$(PLUGIN)"' -DTNTVERSION=$(TNTVERSION) -DCXXTOOLVER=$(CXXTOOLVER) - -### The directory environment: - -VDRDIR ?= ../../../.. - -### Make sure that necessary options are included: - --include $(VDRDIR)/Make.global - -### Allow user defined options to overwrite defaults: - --include $(VDRDIR)/Make.config ### Includes and Defines (add further entries here): - INCLUDES += -I$(VDRDIR)/include -I.. ### The object files (add further files here): - OBJS = menu.o recordings.o schedule.o multischedule.o screenshot.o \ timers.o whats_on.o switch_channel.o keypress.o remote.o \ channels_widget.o edit_timer.o error.o pageelems.o tooltip.o \ @@ -43,10 +20,7 @@ OBJS = menu.o recordings.o schedule.o multischedule.o screenshot.o \ rwd_recording.o setup.o content.o epginfo.o timerconflicts.o \ recstream.o users.o edit_user.o edit_recording.o -### Default rules: - -.PHONY: all clean - +### The main target: all: libpages.a ### Implicit rules: @@ -57,8 +31,7 @@ all: libpages.a %.cpp: %.ecpp $(ECPPC) $(ECPPFLAGS) $(ECPPFLAGS_CPP) $< -# Dependencies: - +### Dependencies: MAKEDEP = $(CXX) -MM -MG DEPFILE = .dependencies $(DEPFILE): Makefile $(OBJS:%.o=%.cpp) $(OBJS:%.o=%.ecpp) @@ -69,7 +42,6 @@ ifneq ($(MAKECMDGOALS),clean) endif ### Targets: - libpages.a: $(OBJS) $(AR) r $@ $^ |