Skip to content

Commit 6dba60a

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 64b0ca3 commit 6dba60a

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
@@ -7,11 +7,13 @@ ELCS = $(ELS:.el=.elc)
77

88
DEPS =
99

10-
EMACS ?= emacs
11-
EMACS_ARGS ?=
10+
LOAD_PATH ?= $(addprefix -L ../,$(DEPS))
11+
LOAD_PATH += -L .
1212

13-
LOAD_PATH ?= $(addprefix -L ../,$(DEPS))
14-
LOAD_PATH += -L .
13+
EMACS ?= emacs
14+
EMACS_ARGS ?=
15+
EMACS_Q_ARG ?= -Q
16+
EMACS_BATCH ?= $(EMACS) $(EMACS_Q_ARG) --batch $(EMACS_ARGS) $(LOAD_PATH)
1517

1618
all: lisp
1719

@@ -30,12 +32,11 @@ autoloads: $(PKG)-autoloads.el
3032

3133
%.elc: %.el
3234
@printf "Compiling $<\n"
33-
@$(EMACS) -Q --batch $(EMACS_ARGS) $(LOAD_PATH) -f batch-byte-compile $<
35+
@$(EMACS_BATCH) --funcall batch-byte-compile $<
3436

3537
check-declare:
3638
@printf " Checking function declarations\n"
37-
@$(EMACS) -Q --batch $(EMACS_ARGS) $(LOAD_PATH) \
38-
--eval "(check-declare-directory default-directory)"
39+
@$(EMACS_BATCH) --eval "(check-declare-directory default-directory)"
3940

4041
CLEAN = $(ELCS) $(PKG)-autoloads.el
4142

@@ -45,7 +46,7 @@ clean:
4546

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

0 commit comments

Comments
 (0)