branch: externals/phpinspect
commit 52e1254001480c83075bc96f8128c2bba89625fb
Author: Hugo Thunnissen <de...@hugot.nl>
Commit: Hugo Thunnissen <de...@hugot.nl>

    Use compile scripts in makefile + add bytecomp step to native comp script
---
 Makefile            |  8 +++++---
 native-compile.bash | 13 +++++++++++--
 2 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/Makefile b/Makefile
index a1a03a5743..c237cb4c98 100644
--- a/Makefile
+++ b/Makefile
@@ -10,9 +10,11 @@ cask: $(CASK_DIR)
 
 .PHONY: compile
 compile: cask
-       cask emacs -batch -L . -L test \
-         -f batch-byte-compile $$(cask files); \
-         (ret=$$? ; cask clean-elc && exit $$ret)
+       bash ./compile.bash
+
+.PHONY: compile-native
+compile-native: cask
+       bash ./native-compile.bash
 
 .PHONY: test
 test: compile
diff --git a/native-compile.bash b/native-compile.bash
index 3e88f3d35e..ac5d6e249a 100644
--- a/native-compile.bash
+++ b/native-compile.bash
@@ -1,11 +1,20 @@
 #!/bin/bash
 
+rm ./**/*.elc
+rm *.elc
+
 for file in ./*.el; do
     echo 'Compiling '"$file"' ...'
-    cask emacs -batch -L . --eval '(setq native-compile-error-on-warn t)' -f 
batch-native-compile "$file" || break
+    cask emacs -batch -L . --eval '(progn '"(require 'comp)"' (setq 
byte-compile-error-on-warn t native-compile-target-directory (car 
native-comp-eln-load-path))  (nreverse native-comp-eln-load-path))' -f 
batch-byte+native-compile "$file" || break
 done
 
 for file in ./**/*.el; do
     echo 'Compiling '"$file"' ...'
-    cask emacs -batch -L . --eval '(setq byte-compile-error-on-warn t)' -f 
batch-native-compile "$file" || break
+    cask emacs -batch -L . --eval '(progn '"(require 'comp)"' (setq 
byte-compile-error-on-warn t native-compile-target-directory (car 
native-comp-eln-load-path))  (nreverse native-comp-eln-load-path))' -f 
batch-byte+native-compile "$file" || break
 done
+
+
+if [[ -z $NO_REMOVE_ELC ]]; then
+    rm ./**/*.elc
+    rm *.elc
+fi

Reply via email to