branch: externals/transient
commit a91418a93c4ae450e8afaa669e29aa3c57518cb2
Author: Jonas Bernoulli <[email protected]>
Commit: Jonas Bernoulli <[email protected]>

    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 `EMACS_ORG', and rework use of related variables.
---
 default.mk    | 18 +++++++++---------
 docs/Makefile |  3 +--
 lisp/Makefile |  7 +++----
 test/Makefile |  6 +++---
 4 files changed, 16 insertions(+), 18 deletions(-)

diff --git a/default.mk b/default.mk
index e5be73c90c..7e88a9f04b 100644
--- a/default.mk
+++ b/default.mk
@@ -11,18 +11,18 @@ DEPS  = compat
 DEPS += cond-let
 DEPS += seq
 
+LOAD_PATH     ?= $(addprefix -L ../../,$(DEPS))
+LOAD_PATH     += -L .
+ORG_LOAD_PATH ?= -L ../../org/lisp
+
 VERSION ?= $(shell test -e $(TOP).git && git describe --tags --abbrev=0 | cut 
-c2-)
 REVDESC := $(shell test -e $(TOP).git && git describe --tags)
 
-EMACS      ?= emacs
-EMACS_ARGS ?=
-
-LOAD_PATH  ?= $(addprefix -L ../../,$(DEPS))
-LOAD_PATH  += -L $(TOP)lisp
-
-ifndef ORG_LOAD_PATH
-ORG_LOAD_PATH  = -L ../../org/lisp
-endif
+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)
 
 INSTALL_INFO     ?= $(shell command -v ginstall-info || printf install-info)
 MAKEINFO         ?= makeinfo
diff --git a/docs/Makefile b/docs/Makefile
index a4c21f4765..45cf5f7f5b 100644
--- a/docs/Makefile
+++ b/docs/Makefile
@@ -11,7 +11,6 @@ html:     $(PKG).html
 html-dir: $(PKG)/index.html
 pdf:      $(PKG).pdf
 
-ORG_ARGS  = --batch -Q $(ORG_LOAD_PATH)
 ORG_EVAL += --eval "(setq indent-tabs-mode nil)"
 ORG_EVAL += --eval "(setq org-src-preserve-indentation nil)"
 ORG_EVAL += --eval "\
@@ -29,7 +28,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)
        @sed -i -e 's/“/``/g' -e "s/”/''/g" -e '$$a\' $(PKG).texi #'
 
 %.info: %.texi
diff --git a/lisp/Makefile b/lisp/Makefile
index 064f37d5b1..9c482abf30 100644
--- a/lisp/Makefile
+++ b/lisp/Makefile
@@ -7,12 +7,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)"
 
 clean:
        @printf " Cleaning lisp/*...\n"
@@ -20,7 +19,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)\
diff --git a/test/Makefile b/test/Makefile
index 54767050a3..277f124d34 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -5,14 +5,14 @@ LOAD_PATH += -L $(TOP)test
 
 test: lisp
        @printf "  Testing...\n"
-       @$(EMACS) -Q --batch $(EMACS_ARGS) $(LOAD_PATH) \
-       -l ert -l $(PKG)-test -f ert-run-tests-batch-and-exit
+       @$(EMACS_BATCH) --load ert --load $(PKG)-test \
+       --funcall ert-run-tests-batch-and-exit
 
 lisp: ../lisp/$(PKG).elc $(PKG)-test.elc
 
 %.elc: %.el
        @printf "Compiling $<\n"
-       @$(EMACS) -Q --batch $(EMACS_ARGS) $(LOAD_PATH) -f batch-byte-compile $<
+       @$(EMACS_BATCH) --funcall batch-byte-compile $<
 
 clean:
        @printf " Cleaning test/*...\n"

Reply via email to