Browse Source

Makefile: Support DESTDIR in Makefile

* Makefile (install-lisp, install-info, install-data): Support
DESTDIR.

Patch by Ulrich Mueller <ulm@gentoo.org>. See
http://lists.gnu.org/archive/html/emacs-orgmode/2012-01/msg00042.html
Jambunathan K 9 years ago
parent
commit
f7ea4bef43
1 changed files with 11 additions and 8 deletions
  1. 11 8
      Makefile

+ 11 - 8
Makefile

@@ -258,18 +258,21 @@ org-odt-data-dir:
 install-lisp: 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