]> git.donarmstrong.com Git - org-ref.git/blobdiff - Makefile
add back my makefile
[org-ref.git] / Makefile
index 601933829817bfe193514172adfcb19475132348..bb522b5f5b969023f303ca97079544d91780d0f9 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,18 +1,21 @@
-EMACS ?= emacs
-CASK_EXEC ?= cask exec
+#!/usr/bin/make -f
 
-all: test
+WHICH_EMACS:=$(shell which emacs >/dev/null 2>&1 || echo "fail")
 
-test: clean-elc
-       ${MAKE} unit
+ELC_FILES=
+ifeq ($(strip $(WHICH_EMACS)),)
+ELC_FILES=$(patsubst %.el,%.elc,$(wildcard *.el)) org-ref.elc doi-utils.elc pubmed.elc
+endif
 
-unit:
-       ${CASK_EXEC} ${EMACS} -Q -batch  -l org-ref-init.el -l org-ref-test.el --eval "(ert t)"
+all: $(ELC_FILES)
 
-compile:
-       ${CASK_EXEC} ${EMACS} -Q -batch -f batch-byte-compile org-ref-init.el
+EMACS=emacs
+
+%.elc: %.el
+       $(EMACS) -q -no-site-file -L . -L .. -L ../helm --no-site-file -batch -f batch-byte-compile $<;
+
+
+%.el: %.org
+       $(EMACS) -batch -q -no-site-file --visit $< --funcall org-babel-tangle
 
-clean-elc:
-       rm -f f.elc
 
-.PHONY:        all test