diff options
author | Achim Gratz <Stromeko@Stromeko.DE> | 2012-08-12 15:39:53 +0200 |
---|---|---|
committer | Achim Gratz <Stromeko@Stromeko.DE> | 2012-08-12 15:41:35 +0200 |
commit | 1e47e65e977e0f704feed505595ff87da0369350 (patch) | |
tree | 22b6621f54292a29e7b31f007532e585477bd32c | |
parent | e1d5a31786f9c59c4aff4ad23b8b0bc56f149f9c (diff) | |
download | org-mode-1e47e65e977e0f704feed505595ff87da0369350.tar.gz |
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.
-rw-r--r-- | default.mk | 17 | ||||
-rw-r--r-- | lisp/Makefile | 31 | ||||
-rw-r--r-- | targets.mk | 2 |
3 files changed, 37 insertions, 13 deletions
@@ -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 diff --git a/lisp/Makefile b/lisp/Makefile index c547810..4047b42 100644 --- a/lisp/Makefile +++ b/lisp/Makefile @@ -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 $<)...) @@ -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:: |