Skip to content

Commit 34b83f3

Browse files
committed
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.
1 parent dfc450d commit 34b83f3

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

Makefile

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,13 @@ ELCS = $(ELS:.el=.elc)
1010

1111
DEPS = compat
1212

13-
EMACS ?= emacs
14-
EMACS_ARGS ?=
13+
LOAD_PATH ?= $(addprefix -L ../,$(DEPS))
14+
LOAD_PATH += -L .
1515

16-
LOAD_PATH ?= $(addprefix -L ../,$(DEPS))
17-
LOAD_PATH += -L .
16+
EMACS ?= emacs
17+
EMACS_ARGS ?=
18+
EMACS_Q_ARG ?= -Q
19+
EMACS_BATCH ?= $(EMACS) $(EMACS_Q_ARG) --batch $(EMACS_ARGS) $(LOAD_PATH)
1820

1921
all: lisp
2022

@@ -33,12 +35,11 @@ autoloads: $(PKG)-autoloads.el
3335

3436
%.elc: %.el
3537
@printf "Compiling $<\n"
36-
@$(EMACS) -Q --batch $(EMACS_ARGS) $(LOAD_PATH) -f batch-byte-compile $<
38+
@$(EMACS_BATCH) --funcall batch-byte-compile $<
3739

3840
check-declare:
3941
@printf " Checking function declarations\n"
40-
@$(EMACS) -Q --batch $(EMACS_ARGS) $(LOAD_PATH) \
41-
--eval "(check-declare-directory default-directory)"
42+
@$(EMACS_BATCH) --eval "(check-declare-directory default-directory)"
4243

4344
CLEAN = $(ELCS) $(PKG)-autoloads.el
4445

@@ -48,7 +49,7 @@ clean:
4849

4950
$(PKG)-autoloads.el: $(ELS)
5051
@printf " Creating $@\n"
51-
@$(EMACS) -Q --batch -l autoload --eval "\
52+
@$(EMACS_BATCH) --load autoload --eval "\
5253
(let* ((file (expand-file-name \"$@\"))\
5354
(generated-autoload-file file)\
5455
(coding-system-for-write 'utf-8-emacs-unix)\

0 commit comments

Comments
 (0)