From 1acc20266e58a9b881ac60adfe5a284db445acb6 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Wed, 15 Aug 2007 13:49:27 +0200 Subject: Added DESTDIR and PREFIX handling to the Makefile --- CONTRIBUTORS | 1 + HISTORY | 2 ++ Makefile | 38 +++++++++++++++++++++----------------- 3 files changed, 24 insertions(+), 17 deletions(-) diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 2211870f..8de5bf60 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -2088,6 +2088,7 @@ Matthias Schwarzott for improving i18n-to-gettext.pl for suggesting to move the "all" target in plugin Makefiles before the "Implicit rules", so that a plain "make" will compile everything + for adding DESTDIR and PREFIX handling to the Makefile Martin Ostermann for fixing processing the PDCDescriptor in 'libsi' on big endian systems diff --git a/HISTORY b/HISTORY index f60c0a37..279d5843 100644 --- a/HISTORY +++ b/HISTORY @@ -5356,3 +5356,5 @@ Video Disk Recorder Revision History so that a plain "make" will compile everything (suggested by Matthias Schwarzott). The "newplugin" script has been changed accordingly. Plugin authors may want to change their Makefiles, too. +- Added DESTDIR and PREFIX handling to the Makefile (thanks to Matthias + Schwarzott). diff --git a/Makefile b/Makefile index 8cf78aa4..a46aaef5 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ # See the main source file 'vdr.c' for copyright information and # how to reach the author. # -# $Id: Makefile 1.103 2007/08/12 20:36:34 kls Exp $ +# $Id: Makefile 1.104 2007/08/15 13:47:16 kls Exp $ .DELETE_ON_ERROR: @@ -15,9 +15,11 @@ CXX ?= g++ CXXFLAGS ?= -g -O2 -Wall -Woverloaded-virtual LSIDIR = ./libsi -MANDIR = /usr/local/man -BINDIR = /usr/local/bin -LOCDIR = /usr/share/vdr/locale +DESTDIR ?= +PREFIX ?= /usr/local +MANDIR = $(PREFIX)/share/man +BINDIR = $(PREFIX)/bin +LOCDIR = $(PREFIX)/share/vdr/locale LIBS = -ljpeg -lpthread -ldl -lcap -lfreetype -lfontconfig INCLUDES = -I/usr/include/freetype2 @@ -25,6 +27,7 @@ PLUGINDIR= ./PLUGINS PLUGINLIBDIR= $(PLUGINDIR)/lib VIDEODIR = /video +CONFDIR ?= $(VIDEODIR) DOXYGEN = /usr/bin/doxygen DOXYFILE = Doxyfile @@ -123,8 +126,8 @@ i18n: $(I18Nmo) done install-i18n: - @mkdir -p $(LOCDIR) - @(cd $(LOCALEDIR); cp -r --parents * $(LOCDIR)) + @mkdir -p $(DESTDIR)$(LOCDIR) + @(cd $(LOCALEDIR); cp -r --parents * $(DESTDIR)$(LOCDIR)) # The 'include' directory (for plugins): @@ -162,30 +165,31 @@ install: install-bin install-conf install-doc install-plugins install-i18n # VDR binary: install-bin: vdr - @mkdir -p $(BINDIR) - @cp --remove-destination vdr runvdr $(BINDIR) + @mkdir -p $(DESTDIR)$(BINDIR) + @cp --remove-destination vdr runvdr svdrpsend.pl $(DESTDIR)$(BINDIR) # Configuration files: install-conf: - @if [ ! -d $(VIDEODIR) ]; then\ - mkdir -p $(VIDEODIR);\ - cp *.conf $(VIDEODIR);\ + @mkdir -p $(DESTDIR)$(VIDEODIR) + @if [ ! -d $(DESTDIR)$(CONFDIR) ]; then\ + mkdir -p $(DESTDIR)$(CONFDIR);\ + cp *.conf $(DESTDIR)$(CONFDIR);\ fi # Documentation: install-doc: - @mkdir -p $(MANDIR)/man1 - @mkdir -p $(MANDIR)/man5 - @gzip -c vdr.1 > $(MANDIR)/man1/vdr.1.gz - @gzip -c vdr.5 > $(MANDIR)/man5/vdr.5.gz + @mkdir -p $(DESTDIR)$(MANDIR)/man1 + @mkdir -p $(DESTDIR)$(MANDIR)/man5 + @gzip -c vdr.1 > $(DESTDIR)$(MANDIR)/man1/vdr.1.gz + @gzip -c vdr.5 > $(DESTDIR)$(MANDIR)/man5/vdr.5.gz # Plugins: install-plugins: plugins - @mkdir -p $(PLUGINLIBDIR) - @cp --remove-destination $(PLUGINDIR)/lib/lib*-*.so.$(APIVERSION) $(PLUGINLIBDIR) + @mkdir -p $(DESTDIR)$(PLUGINLIBDIR) + @cp --remove-destination $(PLUGINDIR)/lib/lib*-*.so.$(APIVERSION) $(DESTDIR)$(PLUGINLIBDIR) # Source documentation: -- cgit v1.2.3