diff options
| author | Jonas Bernoulli <jonas@bernoul.li> | 2025-11-30 19:43:17 +0100 |
|---|---|---|
| committer | Jonas Bernoulli <jonas@bernoul.li> | 2025-11-30 19:43:17 +0100 |
| commit | b572104164929b592cd980fad5afa9d216321ec1 (patch) | |
| tree | a2c02045b355557e76894b873cbab7846b680ba6 | |
| parent | 4b90a7b890e0bcda16dcf34e1be9a2f5854c919f (diff) | |
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 rename `BATCH'
to `EMACS_BATCH', add `EMACS_ORG' and `EMACS_INTR', and rework use
of related variables.
| -rw-r--r-- | Makefile | 2 | ||||
| -rw-r--r-- | default.mk | 17 | ||||
| -rw-r--r-- | docs/Makefile | 5 | ||||
| -rw-r--r-- | lisp/Makefile | 6 | ||||
| -rw-r--r-- | test/Makefile | 6 |
5 files changed, 18 insertions, 18 deletions
@@ -123,7 +123,7 @@ test-interactive: emacs-Q: clean-lisp @$(MAKE) -C lisp autoloads - @$(EMACS) -Q $(LOAD_PATH) --debug-init --eval "(progn\ + @$(EMACS_INTR) --debug-init --eval "(progn\ (setq debug-on-error t)\ (require 'magit-autoloads)\ (global-set-key \"\\C-xg\" 'magit-status))" @@ -30,9 +30,12 @@ RMDIR ?= rm -rf TAR ?= tar SED ?= sed -EMACS ?= emacs -EMACS_ARGS ?= -BATCH = $(EMACS) -Q --batch $(EMACS_ARGS) $(LOAD_PATH) +EMACS ?= emacs +EMACS_ARGS ?= +EMACS_Q_ARG ?= -Q +EMACS_BATCH ?= $(EMACS) $(EMACS_Q_ARG) --batch $(EMACS_ARGS) $(LOAD_PATH) +EMACS_ORG ?= $(EMACS) $(EMACS_Q_ARG) --batch $(EMACS_ARGS) $(ORG_LOAD_PATH) +EMACS_INTR ?= $(EMACS) $(EMACS_Q_ARG) $(EMACS_ARGS) $(LOAD_PATH) LISP_EXTRA_TARGETS ?= check-declare @@ -116,9 +119,9 @@ REVDESC := $(shell test -e $(TOP).git && git describe --tags) EMACS_VERSION = 28.1 -EMACSOLD := $(shell $(BATCH) --eval \ +EMACS_OLD := $(shell $(EMACS_BATCH) --eval \ "(and (version< emacs-version \"$(EMACS_VERSION)\") (princ \"true\"))") -ifeq "$(EMACSOLD)" "true" +ifeq "$(EMACS_OLD)" "true" $(error At least version $(EMACS_VERSION) of Emacs is required) endif @@ -223,9 +226,7 @@ endif endif # ifndef LOAD_PATH -ifndef ORG_LOAD_PATH -ORG_LOAD_PATH = -L ../../org/lisp -endif +ORG_LOAD_PATH ?= -L ../../org/lisp ## Dependencies ###################################################### diff --git a/docs/Makefile b/docs/Makefile index 351bc27..5b606de 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -14,8 +14,7 @@ html-dir: $(HTMLTOPS) pdf: $(PDFFILES) epub: $(EPUBFILES) -ORG_ARGS = --batch -Q $(ORG_LOAD_PATH) -l ol-man -ORG_EVAL += --eval "(progn $$ORG_MAN_EXPORT)" +ORG_EVAL += --load ol-man --eval "(progn $$ORG_MAN_EXPORT)" ORG_EVAL += --eval "(setq indent-tabs-mode nil)" ORG_EVAL += --eval "(setq org-src-preserve-indentation nil)" ORG_EVAL += --eval "\ @@ -33,7 +32,7 @@ _ := $(shell test "$(REVDESC)" = "$$(cat .revdesc 2> /dev/null)" ||\ %.texi: %.org .orgconfig .revdesc @printf "Generating $@\n" - @$(EMACS) $(ORG_ARGS) $< $(ORG_EVAL) + @$(EMACS_ORG) $< $(ORG_EVAL) %.info: %.texi @printf "Generating $@\n" diff --git a/lisp/Makefile b/lisp/Makefile index f3ca6f4..a83a1a9 100644 --- a/lisp/Makefile +++ b/lisp/Makefile @@ -68,7 +68,7 @@ versionlib: $(PKG)-version.el %.elc: %.el @printf "Compiling $<\n" - @$(BATCH) --eval "(progn\ + @$(EMACS_BATCH) --eval "(progn\ (when (file-exists-p \"$@\")\ (delete-file \"$@\"))\ (setq with-editor-emacsclient-executable nil)\ @@ -78,7 +78,7 @@ versionlib: $(PKG)-version.el $(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)\ @@ -95,7 +95,7 @@ $(PKG)-version.el: check-declare: @printf "Checking function declarations\n" - @$(BATCH) -L $(TOP)../borg -L $(TOP)../forge/lisp \ + @$(EMACS_BATCH) -L $(TOP)../borg -L $(TOP)../forge/lisp \ --eval "(check-declare-directory default-directory)" ## Install ########################################################### diff --git a/test/Makefile b/test/Makefile index c7ab8b8..11eec3a 100644 --- a/test/Makefile +++ b/test/Makefile @@ -3,13 +3,13 @@ include ../default.mk test: lisp @printf "Testing...\n" - @$(BATCH) --eval "(progn\ + @$(EMACS_BATCH) --eval "(progn\ $$suppress_warnings\ (load-file \"$(TOP)test/magit-tests.el\")\ (ert-run-tests-batch-and-exit))" test-interactive: - @$(EMACS) -Q $(LOAD_PATH) --eval "(progn\ + @$(EMACS_INTR) --eval "(progn\ (load-file \"$(TOP)test/magit-tests.el\")\ (ert t))" @@ -17,7 +17,7 @@ lisp: magit-tests.elc %.elc: %.el @printf "Compiling $<\n" - @$(BATCH) --eval "(progn\ + @$(EMACS_BATCH) --eval "(progn\ (when (file-exists-p \"$@\")\ (delete-file \"$@\"))\ (setq with-editor-emacsclient-executable nil)\ |
