X-Git-Url: https://git.donarmstrong.com/?p=org-ref.git;a=blobdiff_plain;f=Makefile;h=bb522b5f5b969023f303ca97079544d91780d0f9;hp=8ec4b8e7428a154c5111c017f947d9ec769f26a5;hb=HEAD;hpb=c0a019259256ee8189620264893c36f10ab1c672 diff --git a/Makefile b/Makefile index 8ec4b8e..bb522b5 100644 --- a/Makefile +++ b/Makefile @@ -1,24 +1,21 @@ -emacs ?= emacs -CASK ?= cask -CASK_EXEC ?= ${CASK} exec -EL_SOURCES = org-ref.el arxiv.el jmax-bibtex.el doi-utils.el isbn.el pubmed.el -SOURCES = ${EL_SOURCES} +#!/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.el -l org-ref-test.el --eval "(ert t)" +all: $(ELC_FILES) -compile: - ${CASK_EXEC} ${emacs} -Q -batch -f batch-byte-compile *.el +EMACS=emacs -clean-elc: - rm -f *.elc +%.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 -package : ${SOURCES} - ${CASK} package -.PHONY: all test package clean-elc clean-tangled