From 472f5967f6684342d3c042d1ba12c3b3d6cefaba Mon Sep 17 00:00:00 2001 From: Jonas Bernoulli Date: Sun, 30 Nov 2025 20:55:27 +0100 Subject: make: Add new EMACS_Q_ARG variable It defaults to "-Q" but users can instead use "-q", which is useful if "site-start.el" contains essential settings. Also add `EMACS_BATCH', and rework use of related variables. --- Makefile | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 120214a..67caa4b 100644 --- a/Makefile +++ b/Makefile @@ -11,13 +11,16 @@ $(PKG)-tests.elc: $(PKG).elc DEPS = compat -EMACS ?= emacs + +LOAD_PATH ?= $(addprefix -L ../,$(DEPS)) +LOAD_PATH += -L . + +EMACS ?= emacs EMACS_ARGS ?= --eval "(progn \ (put 'if-let 'byte-obsolete-info nil) \ (put 'when-let 'byte-obsolete-info nil))" - -LOAD_PATH ?= $(addprefix -L ../,$(DEPS)) -LOAD_PATH += -L . +EMACS_Q_ARG ?= -Q +EMACS_BATCH ?= $(EMACS) $(EMACS_Q_ARG) --batch $(EMACS_ARGS) $(LOAD_PATH) all: lisp @@ -37,12 +40,11 @@ autoloads: $(PKG)-autoloads.el %.elc: %.el @printf "Compiling $<\n" - @$(EMACS) -Q --batch $(EMACS_ARGS) $(LOAD_PATH) -f batch-byte-compile $< + @$(EMACS_BATCH) --funcall batch-byte-compile $< check-declare: @printf " Checking function declarations\n" - @$(EMACS) -Q --batch $(EMACS_ARGS) $(LOAD_PATH) \ - --eval "(check-declare-directory default-directory)" + @$(EMACS_BATCH) --eval "(check-declare-directory default-directory)" test: lisp @$(EMACS) -Q --batch $(EMACS_ARGS) $(LOAD_PATH) \ @@ -56,7 +58,7 @@ clean: $(PKG)-autoloads.el: $(ELS) @printf " Creating $@\n" - @$(EMACS) -Q --batch -l autoload --eval "\ + @$(EMACS_BATCH) --load autoload --eval "\ (let* ((file (expand-file-name \"$@\"))\ (generated-autoload-file file)\ (coding-system-for-write 'utf-8-emacs-unix)\ -- cgit v1.0