]> code.delx.au - gnu-emacs-elpa/commitdiff
Strip headers. Use make dependencies.
authorJackson Ray Hamilton <jackson@jacksonrayhamilton.com>
Thu, 5 Feb 2015 05:46:10 +0000 (21:46 -0800)
committerJackson Ray Hamilton <jackson@jacksonrayhamilton.com>
Thu, 5 Feb 2015 05:46:10 +0000 (21:46 -0800)
Makefile
scripts/download-dependencies.el

index 4c00db7fc30b5a9ad4f5465700ed84dec6c1a968..2d37cd6f3b641fa38b1f7b43e0648fc64083fa59 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,8 +1,9 @@
 EMACS = emacs
+DEPENDENCIES = libraries/ert-async.el libraries/js2-mode.el
 
 all: clean compile test
 
-bench:
+bench: ${DEPENDENCIES}
        ${EMACS} -Q \
        -L . \
        -L libraries \
@@ -10,20 +11,20 @@ bench:
        -l benchmark/context-coloring-benchmark \
        -f context-coloring-benchmark-run
 
-compile:
+compile: ${DEPENDENCIES}
        ${EMACS} -Q -batch \
        -L . \
        -L libraries \
        -f batch-byte-compile *.el libraries/*.el
 
 clean:
-       rm -f *.elc libraries/*.elc
+       rm -f *.elc libraries/*.elc ${DEPENDENCIES}
 
-deps:
+${DEPENDENCIES}:
        ${EMACS} -Q -batch \
        -l scripts/download-dependencies.el
 
-test:
+test: ${DEPENDENCIES}
        ${EMACS} -Q -batch \
        -L . \
        -L libraries \
@@ -33,4 +34,4 @@ test:
        -l test/context-coloring-test.el \
        -f ert-run-tests-batch-and-exit
 
-.PHONY: all bench compile clean deps test
+.PHONY: all bench compile clean test
index 0734d77f35ee2a8eea8134fc607e793f7c353127..37f243b96d8136eef10d3cdde24fb251e43742b0 100644 (file)
 (defun resolve-path (path)
   (expand-file-name path directory))
 
+(defun strip-headers ()
+  (goto-char 1)
+  (kill-paragraph 1) ; The headers are 1 paragraph. I hope.
+  (kill-line)        ; A line separates the headers from the file's content.
+  )
+
 (let ((files '("https://raw.githubusercontent.com/mooz/js2-mode/master/js2-mode.el"
                "https://raw.githubusercontent.com/rejeep/ert-async.el/master/ert-async.el")))
   (make-directory (resolve-path "../libraries") t)
@@ -30,4 +36,5 @@
            (destination (resolve-path (concat "../libraries/" basename))))
       (when (null (file-exists-p destination))
         (with-current-buffer (url-retrieve-synchronously file)
+          (strip-headers)
           (write-file destination))))))