Makefile: add elint to compilation methods, ensure *.elc files exist after compilation

* lisp/Makefile: Add targets `slint3´ (one Emacs process for all
  sources) and `slint4´ (one Emacs instance for each source) using
  ELINTL and ELINTF to lint lisp files.  Split out compile actions
  into internal targets and implement `compile-*´ targets in terms of
  these internal targets.  Follow all targets that do not
  procude *.elc files with `dirall´ so that the *.elc files exist at
  the end of compilation.

* default.mk: Add configuration variables ELINTL and ELINTF.

* targets.mk: Add ELINTL and ELINTF to CONF_CALL.
This commit is contained in:
Achim Gratz 2012-08-12 15:39:53 +02:00
parent e1d5a31786
commit 1e47e65e97
3 changed files with 37 additions and 13 deletions

View file

@ -73,6 +73,10 @@ MAKE_LOCAL_MK = $(BATCH) \
# Emacs must be started in lisp directory
BATCHL = $(BATCH) \
--eval '(add-to-list '"'"'load-path ".")'
ELINTL = $(BATCHL) \
--eval '(load "elint")'
ELINTF = --eval '(elint-initialize t)' \
--eval '(elint-file "./$$(el)")'
# How to generate org-install.el
MAKE_ORG_INSTALL = $(BATCHL) \
@ -132,9 +136,12 @@ SUDO = sudo
# INSTALL_INFO = ginstall-info # Debian: avoid harmless warning message
INSTALL_INFO = install-info
# target variant for 'compile'
# _COMPILE_ = single # one Emacs process per compilation
# _COMPILE_ = source # ditto, but remove compiled file immediately
# _COMPILE_ = slint1 # possibly elicit more warnings
# _COMPILE_ = slint2 # possibly elicit even more warnings
# target method for 'compile'
_COMPILE_ = dirall
# (w/ slowdown compared to default variant)
# _COMPILE_ = single # 4x one Emacs process per compilation
# _COMPILE_ = source # 5x ditto, but remove compiled file immediately
# _COMPILE_ = slint1 # 3x possibly elicit more warnings
# _COMPILE_ = slint2 # 7x possibly elicit even more warnings
# _COMPILE_ = slint3 # 25x run elint in a single Emacs process
# _COMPILE_ = slint4 # 275x run elint in one Emacs process per source file

View file

@ -11,7 +11,9 @@ LISPF = $(filter-out $(LISPA),$(sort $(wildcard *.el)))
LISPC = $(filter-out $(LISPN:%el=%elc),$(LISPF:%el=%elc))
.PHONY: all compile compile-dirty \
compile-single compile-source compile-slint1 compile-slint2 \
dirall source slint1 slint3 slint4 \
compile-single compile-source \
compile-slint1 compile-slint2 compile-slint3 compile-slint4 \
autoloads \
install clean cleanauto cleanall cleanelc clean-install
@ -19,15 +21,30 @@ LISPC = $(filter-out $(LISPN:%el=%elc),$(LISPF:%el=%elc))
all compile compile-dirty:: autoloads
$(MAKE) compile-$(_COMPILE_)
compile-dirall:
@$(ELCDIR)
compile-dirall: dirall
compile-single: $(LISPC)
compile-source: cleanelc
compile-source: source dirall
compile-slint1: dirall slint1
compile-slint2: source dirall slint1
compile-slint3: slint3 dirall
compile-slint4: slint4 dirall
# internal
dirall:
@$(info ==================== $@ ====================)
@$(ELCDIR)
source: cleanelc
@$(info ==================== $@ ====================)
@$(foreach elc,$(LISPC),$(MAKE) $(elc) && $(RM) $(elc);)
compile-slint1: compile-dirall
slint1:
@$(info ==================== $@ ====================)
@$(foreach elc,$(LISPC),$(RM) $(elc); $(MAKE) $(elc);)
compile-slint2:
$(MAKE) compile-source compile-slint1
slint3:
@$(info ==================== $@ ====================)
-@$(ELINTL) $(foreach el,$(LISPF),$(ELINTF))
slint4:
@$(info ==================== $@ ====================)
-@$(foreach el,$(LISPF),$(ELINTL) $(ELINTF);)
%.elc: %.el
@$(info Compiling single $(abspath $<)...)

View file

@ -35,7 +35,7 @@ CONF_BASE = EMACS DESTDIR
CONF_DEST = lispdir infodir datadir testdir
CONF_TEST = BTEST_PRE BTEST_POST BTEST_OB_LANGUAGES BTEST_EXTRA
CONF_EXEC = CP MKDIR RM RMR FIND SUDO PDFTEX TEXI2PDF TEXI2HTML MAKEINFO INSTALL_INFO
CONF_CALL = BATCH BATCHL ELCDIR BTEST MAKE_LOCAL_MK MAKE_ORG_INSTALL MAKE_ORG_VERSION
CONF_CALL = BATCH BATCHL ELCDIR ELINTL ELINTF BTEST MAKE_LOCAL_MK MAKE_ORG_INSTALL MAKE_ORG_VERSION
config-eol:: EOL = \#
config-eol:: config-all
config config-all::