branch: elpa/caml commit aba3de4469d7c1976633bf3c8812faa4ae762b1b Author: Christophe Troestler <christophe.troest...@umons.ac.be> Commit: Christophe Troestler <christophe.troest...@umons.ac.be>
Subtler detection of Emacs executable --- Makefile | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index a8c19b1..53b0761 100644 --- a/Makefile +++ b/Makefile @@ -31,7 +31,24 @@ DIST_FILES = $(FILES) Makefile README* COPYING* CHANGES.md ocamltags.in #EMACSDIR= # Name of Emacs executable -EMACS=emacs +EMACSFORMACOSX = /Applications/Emacs.app/Contents/MacOS/Emacs +EMACSMACPORTS = /Applications/MacPorts/Emacs.app/Contents/MacOS/Emacs +AQUAMACS = $(shell test -d /Applications \ + && find /Applications -type f | grep 'Aquamacs$$') +ifeq ($(wildcard $(EMACSFORMACOSX)),$(EMACSFORMACOSX)) +EMACS ?= $(EMACSFORMACOSX) +else +ifeq ($(wildcard $(EMACSMACPORTS)),$(EMACSMACPORTS)) +EMACS ?= $(EMACSMACPORTS) +else +ifneq ($(strip $(AQUAMACS)),) +ifeq ($(wildcard $(AQUAMACS)),$(AQUAMACS)) +EMACS ?= $(AQUAMACS) +endif +endif +endif +endif +EMACS ?= emacs # Where to install ocamltags script SCRIPTDIR = $(BINDIR)