>>>>> On Tue, 03 Jan 2012, Bastien wrote: >>> It would be wonderful if you could provide a patch (and a usage >>> note). >> >> Included below.
> Please add more explanations in such patches -- Jambunathan's > explanations are a model of clarity and detailfulness. Sorry. Please find an updated patch below. Cheers, Ulrich >From 9af8ea97022e23231395046bcfbf5f1e71ac5f59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ulrich=20M=C3=BCller?= <u...@gentoo.org> Date: Mon, 2 Jan 2012 22:00:38 +0100 Subject: [PATCH] Support DESTDIR in Makefile. >From the GNU coding standards: `DESTDIR' is a variable prepended to each installed target file. [...] This provides for "staged installs", where the installed files are not placed directly into their expected location but are instead copied into a temporary location (`DESTDIR'). However, installed files maintain their relative directory structure and any embedded file names will not be modified. --- Makefile | 22 ++++++++++++++-------- 1 files changed, 14 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 642b21f..4f06c4e 100644 --- a/Makefile +++ b/Makefile @@ -27,6 +27,9 @@ datadir = $(prefix)/share/emacs/etc # Where info files go infodir = $(prefix)/share/info +# Alternate destination root directory for staged installs +DESTDIR = + ##---------------------------------------------------------------------- ## YOU MAY NEED TO EDIT THESE ##---------------------------------------------------------------------- @@ -253,18 +256,21 @@ g: lisp/org-odt.elc: BATCH_EXTRA = -eval "(setq org-odt-data-dir (expand-file-name \"$(datadir)\"))" install-lisp: $(LISPFILES) $(ELCFILES) - if [ ! -d $(lispdir) ]; then $(MKDIR) $(lispdir); else true; fi ; - $(CP) $(LISPFILES) $(lispdir) - $(CP) $(ELCFILES) $(lispdir) + if [ ! -d $(DESTDIR)$(lispdir) ]; then \ + $(MKDIR) $(DESTDIR)$(lispdir); else true; fi ; + $(CP) $(LISPFILES) $(DESTDIR)$(lispdir) + $(CP) $(ELCFILES) $(DESTDIR)$(lispdir) install-info: $(INFOFILES) - if [ ! -d $(infodir) ]; then $(MKDIR) $(infodir); else true; fi ; - $(CP) $(INFOFILES) $(infodir) - $(INSTALL_INFO) --infodir=$(infodir) $(INFOFILES) + if [ ! -d $(DESTDIR)$(infodir) ]; then \ + $(MKDIR) $(DESTDIR)$(infodir); else true; fi ; + $(CP) $(INFOFILES) $(DESTDIR)$(infodir) + $(INSTALL_INFO) --infodir=$(DESTDIR)$(infodir) $(INFOFILES) install-data: $(DATAFILES) - if [ ! -d $(datadir) ]; then $(MKDIR) $(datadir); else true; fi ; - $(CP) $(DATAFILES) $(datadir) + if [ ! -d $(DESTDIR)$(datadir) ]; then \ + $(MKDIR) $(DESTDIR)$(datadir); else true; fi ; + $(CP) $(DATAFILES) $(DESTDIR)$(datadir) autoloads: lisp/org-install.el -- 1.7.8.2