list-utils
list-utils copied to clipboard
Makefile: issues with RESOLVED_EMACS
By default readlink produces relative paths, so when Emacs is installed through Homebrew the make tasks fail since RESOLVED_EMACS is set to something like
../Cellar/emacs-edge/25.1-rc1/bin/emacs
And unfortunately the -f flag isn't available on the version of readlink included with macOS.
The Makefile could be changed to something like this
diff --git a/Makefile b/Makefile
index 777dd06..73c9dae 100644
--- a/Makefile
+++ b/Makefile
@@ -13,8 +13,13 @@ INTERACTIVE_EMACS=/usr/local/bin/emacs
# INTERACTIVE_EMACS=/Applications/Emacs.app/Contents/MacOS/Emacs
# INTERACTIVE_EMACS=/Applications/Emacs.app/Contents/MacOS/bin/emacs
-RESOLVED_EMACS=$(shell readlink `which $(EMACS)` || echo "$(EMACS)")
-RESOLVED_INTERACTIVE_EMACS=$(shell readlink `which "$(INTERACTIVE_EMACS)"` || echo "$(INTERACTIVE_EMACS)")
+ifeq ($(shell uname), "Darwin")
+ RESOLVED_EMACS=${EMACS}
+ RESOLVED_INTERACTIVE_EMACS=${INTERACTIVE_EMACS}
+else
+ RESOLVED_EMACS=$(shell readlink -f `which $(EMACS)` || echo "$(EMACS)")
+ RESOLVED_INTERACTIVE_EMACS=$(shell readlink -f `which "$(INTERACTIVE_EMACS)"` || echo "$(INTERACTIVE_EMACS)")
+endif
EMACS_CLEAN=-Q
EMACS_BATCH=$(EMACS_CLEAN) --batch
But could the resolving logic be removed from the Makefile entirely? When is it necessary?