From 6a3ec67abd61b4707ec4847ac81e3612201e5ec5 Mon Sep 17 00:00:00 2001 From: Achim Gratz Date: Mon, 2 Jan 2012 20:07:04 +0100 Subject: [PATCH] Introduce $(datadir), prefix all installation paths with $(DESTDIR) Makefile: remove includes for maintainer targets, these will go into local.mk on the server default.mk: introduce $(datadir) to replace $(etcdir) in etc/Makefile doc/Makefile: replace $etcdir) with $(datadir) lisp/Makefile: record ODT styles location as defconst in org-install {doc,etc,lisp}/Makefile: prefix all installation targets with $(DESTDIR) --- Makefile | 15 +++++++-------- default.mk | 4 +++- doc/Makefile | 13 ++++++------- etc/Makefile | 7 +++---- lisp/Makefile | 9 +++++---- 5 files changed, 24 insertions(+), 24 deletions(-) diff --git a/Makefile b/Makefile index 5f1d9bff7..b6b3b930a 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,9 @@ # Makefile - for the org-mode distribution # -# Maintainer: Carsten Dominik -# Version: VERSIONTAG -# +# This file is not part of GNU Emacs + +# default target is "all" +.DEFAULT: all # Describe valid make targets for org-mode. .PHONY: targets help @@ -32,8 +33,6 @@ targets help: $(info make clean-install - remove installed Org ELisp and documentation files) @echo "" - include default.mk --include local.mk # optional local customization - include maint.mk - include targets.mk - include maint-targets.mk + include default.mk # defaults, customizable via "local.mk" +-include local.mk # optional local customization, use default.mk as template + include targets.mk # toplevel make machinery diff --git a/default.mk b/default.mk index a1831feb5..0d32e3a51 100644 --- a/default.mk +++ b/default.mk @@ -11,6 +11,9 @@ prefix = /usr/share # Where local lisp files go. lispdir = $(prefix)/emacs/site-lisp/org +# Where local data files go. +datadir = $(lispdir)/etc + # Where info files go. infodir = $(prefix)/info @@ -63,4 +66,3 @@ CP = install -p # Name of the program to install info files INSTALL_INFO = install-info - diff --git a/doc/Makefile b/doc/Makefile index 04c4fb81d..bb3e80762 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -1,7 +1,7 @@ +.SUFFIXES: # we don't need default suffix rules ifeq ($(MAKELEVEL), 0) $(error This make needs to be started as a sub-make from the toplevel directory.) endif - .PHONY: all info html pdf card manual guide install clean cleanall clean-install all: info html pdf card @@ -30,9 +30,9 @@ git-describe.texi: org.texi install: org - if [ ! -d $(infodir) ]; then $(MKDIR) $(infodir); else true; fi ; - $(CP) org $(infodir) - $(INSTALL_INFO) --infodir=$(infodir) org + if [ ! -d $(DESTDIR)$(infodir) ]; then $(MKDIR) $(DESTDIR)$(infodir); else true; fi ; + $(CP) org $(DESTDIR)$(infodir) + $(INSTALL_INFO) --infodir=$(DESTDIR)$(infodir) org clean: $(RM) org *.pdf *.html *_letter.tex \ @@ -42,10 +42,9 @@ cleanall: clean $(RMR) guide manual clean-install: - $(RM) $(infodir)/org* - $(INSTALL_INFO) --infodir=$(infodir) --remove org + $(RM) $(DESTDIR)$(infodir)/org* + $(INSTALL_INFO) --infodir=$(DESTDIR)$(infodir) --remove org -.SUFFIXES: # we don't need default suffix rules .SUFFIXES: .texi .tex .txt %: %.texi diff --git a/etc/Makefile b/etc/Makefile index c58d9120d..9ef280df2 100644 --- a/etc/Makefile +++ b/etc/Makefile @@ -1,4 +1,3 @@ -etcdir = $(lispdir)/etc ETCDIRS = styles -include local.mk # optional local customization @@ -13,12 +12,12 @@ endif all: install: $(ETCDIRS) - $(foreach dir, $?, if [ ! -d $(etcdir)/$(dir) ]; then $(MKDIR) $(etcdir)/$(dir); else true; fi ; $(CP) $(dir)/* $(etcdir)/$(dir); ) + $(foreach dir, $?, if [ ! -d $(DESTDIR)$(datadir)/$(dir) ]; then $(MKDIR) $(DESTDIR)$(datadir)/$(dir); else true; fi ; $(CP) $(dir)/* $(DESTDIR)$(datadir)/$(dir); ) clean: cleanall: clean-install: - if [ ! -d $(etcdir) ]; then $(MKDIR) $(etcdir); else true; fi ; - $(RMR) $(etcdir) + if [ ! -d $(DESTDIR)$(datadir) ]; then $(MKDIR) $(DESTDIR)$(datadir); else true; fi ; + $(RMR) $(DESTDIR)$(datadir) diff --git a/lisp/Makefile b/lisp/Makefile index 4aa022611..31ecdb758 100644 --- a/lisp/Makefile +++ b/lisp/Makefile @@ -6,6 +6,7 @@ ORG-INSTALL = $(BATCH) \ --eval '(insert "\n(provide (quote org-install))\n")' \ --eval '(insert "\n(defconst org-release \"$(ORGVERSION)\"\n \"The release version of org-mode. Inserted by installing org-mode\n or when a release is made.\")\n")' \ --eval '(insert "\n(defconst org-git-version \"$(GITVERSION)\"\n \"The Git version of org-mode. Inserted by installing org-mode\n or when a release is made.\")\n")' \ + --eval '(insert "\n(defconst org-odt-data-dir \"$(datadir)\"\n \"The location of ODT styles.\")\n")' \ --eval '(save-buffer)' -include local.mk # optional local customization @@ -32,8 +33,8 @@ org-install.el: $(LISPF) $(ORG-INSTALL) install: $(LISPF) compile autoloads - if [ ! -d $(lispdir) ]; then $(MKDIR) $(lispdir); else true; fi ; - $(CP) $(LISPC) $(LISPF) $(LISPO) $(lispdir) + if [ ! -d $(DESTDIR)$(lispdir) ]; then $(MKDIR) $(DESTDIR)$(lispdir); else true; fi ; + $(CP) $(LISPC) $(LISPF) $(LISPO) $(DESTDIR)$(lispdir) clean: $(RM) *.elc @@ -45,5 +46,5 @@ cleanall: $(RM) *.elc $(LISPO) clean-install: - if [ ! -d $(lispdir) ]; then $(MKDIR) $(lispdir); else true; fi ; - $(RM) $(lispdir)/org*.el* $(lispdir)/ob*.el* + if [ ! -d $(DESTDIR)$(lispdir) ]; then $(MKDIR) $(DESTDIR)$(lispdir); else true; fi ; + $(RM) $(DESTDIR)$(lispdir)/org*.el* $(DESTDIR)$(lispdir)/ob*.el*