EMACS = emacs
+DEPENDENCIES = libraries/ert-async.el libraries/js2-mode.el
all: clean compile test
-bench:
+bench: ${DEPENDENCIES}
${EMACS} -Q \
-L . \
-L libraries \
-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 \
-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
(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)
(destination (resolve-path (concat "../libraries/" basename))))
(when (null (file-exists-p destination))
(with-current-buffer (url-retrieve-synchronously file)
+ (strip-headers)
(write-file destination))))))