diff --git a/lisp/Makefile b/lisp/Makefile index f507f18a2..c57095f65 100644 --- a/lisp/Makefile +++ b/lisp/Makefile @@ -10,7 +10,8 @@ LISPA := $(LISPV) $(LISPI) LISPB := $(LISPA:%el=%elc) org-install.elc LISPF := $(filter-out $(LISPA),$(sort $(wildcard *.el))) LISPC := $(filter-out $(LISPB) $(LISPN:%el=%elc),$(LISPF:%el=%elc)) -_ORGCM_ := dirall single source slint1 slint2 +LISPN := $(filter-out $(LISPB) $(LISPN:%el=%eln),$(LISPF:%el=%eln)) +_ORGCM_ := dirall single native source slint1 slint2 -include local.mk .PHONY: all compile compile-dirty \ @@ -28,6 +29,7 @@ endif compile-dirall: dirall compile-single: single $(LISPC) +compile-native: native $(LISPN) compile-source: source dirall compile-slint1: dirall slint1 compile-slint2: source dirall slint1 @@ -38,6 +40,8 @@ dirall: @$(ELCDIR) single: @$(info ==================== $@ ====================) +native: + @$(info ==================== $@ ====================) source: cleanelc @$(info ==================== $@ ====================) @$(foreach elc,$(LISPC),$(MAKE) $(elc) && $(RM) $(elc);) @@ -49,6 +53,10 @@ slint1: @$(info Compiling single $(abspath $<)...) -@$(ELC) $< +%.eln: %.el + @$(info Native compiling single $(abspath $<)...) + -@$(ELN) $< + autoloads: cleanauto $(LISPI) $(LISPV) $(LISPV): $(LISPF) diff --git a/mk/default.mk b/mk/default.mk index 13c5a56ed..c07f91001 100644 --- a/mk/default.mk +++ b/mk/default.mk @@ -156,6 +156,10 @@ ELCDIR = $(BATCHL) \ ELC = $(BATCHL) \ --eval '(batch-byte-compile)' +# How to native-compile a single file +ELN = $(BATCHL) \ + --eval '(batch-native-compile)' + # How to make a pdf file from a texinfo file TEXI2PDF = texi2pdf --batch --clean --expand @@ -202,6 +206,7 @@ INSTALL_INFO = install-info ORGCM = dirall # ORGCM = dirall # 1x slowdown compared to default compilation method # ORGCM = single # 4x one Emacs process per compilation +# ORGCM = native # 4x one Emacs process per native compilation # ORGCM = source # 5x ditto, but remove compiled file immediately # ORGCM = slint1 # 3x possibly elicit more warnings # ORGCM = slint2 # 7x possibly elicit even more warnings diff --git a/mk/targets.mk b/mk/targets.mk index 06016561c..22f1f6e6d 100644 --- a/mk/targets.mk +++ b/mk/targets.mk @@ -27,7 +27,7 @@ ifneq ($(GITSTATUS),) GITVERSION := $(GITVERSION:.dirty=).dirty endif -.PHONY: all oldorg update update2 up0 up1 up2 single $(SUBDIRS) \ +.PHONY: all oldorg update update2 up0 up1 up2 single native $(SUBDIRS) \ check test install $(INSTSUB) \ info html pdf card refcard doc docs \ autoloads cleanall clean $(CLEANDIRS:%=clean%) \ @@ -41,7 +41,7 @@ CONF_BASE = EMACS DESTDIR ORGCM ORG_MAKE_DOC CONF_DEST = lispdir infodir datadir testdir CONF_TEST = BTEST_PRE BTEST_POST BTEST_OB_LANGUAGES BTEST_EXTRA BTEST_RE CONF_EXEC = CP MKDIR RM RMR FIND CHMOD SUDO PDFTEX TEXI2PDF TEXI2HTML MAKEINFO INSTALL_INFO -CONF_CALL = BATCH BATCHL ELC ELCDIR NOBATCH BTEST MAKE_LOCAL_MK MAKE_ORG_INSTALL MAKE_ORG_VERSION +CONF_CALL = BATCH BATCHL ELC ELN ELCDIR NOBATCH BTEST MAKE_LOCAL_MK MAKE_ORG_INSTALL MAKE_ORG_VERSION config-eol:: EOL = \# config-eol:: config-all config config-all:: @@ -74,6 +74,9 @@ update update2:: up0 all single: ORGCM=single single: compile +native: ORGCM=native +native: compile + .PRECIOUS: local.mk local.mk: $(info ======================================================)