]> git.donarmstrong.com Git - lib.git/blobdiff - emacs_el/configuration/Makefile
compile .el files for faster loading
[lib.git] / emacs_el / configuration / Makefile
index a249abf2bf0c4d920155835e2398dcdda2011411..667985fced378caa5f4efaa1d2f4380a831c72b0 100644 (file)
@@ -4,16 +4,27 @@
 WHICH_EMACS:=$(shell which emacs >/dev/null 2>&1 || echo "fail")
 
 ELC_FILES=
+EL_FILES=
+ORG_EL_FILES=
 ifeq ($(strip $(WHICH_EMACS)),)
-ELC_FILES=$(patsubst %.el,%.elc,$(wildcard *.el))
+ORG_EL_FILES=$(patsubst %.org,%.el,$(wildcard *.org))
+ORG_ELC_FILES=$(patsubst %.org,%.elc,$(wildcard *.org))
+EL_FILES=$(sort $(wildcard *.el) $(ORG_EL_FILES))
+ELC_FILES=$(patsubst %.el,%.elc,$(EL_FILES))
 endif
 
-all: $(ELC_FILES)
+LIB_PATH=-L . -L .. -L ../helm
+
+all: $(ORG_ELC_FILES)
 
 EMACS=emacs
 
-%.elc: %.el
-       $(EMACS) -q -no-site-file -L . -L .. --no-site-file -batch -f batch-byte-compile $<;
+$(ELC_FILES): %.elc: %.el
+       $(EMACS) -batch -q -no-site-file $(LIB_PATH) --no-site-file --eval '(byte-recompile-directory "." 0)'
+
+$(ORG_EL_FILES): %.el: %.org
+       $(EMACS) -batch -q -no-site-file --visit $< --funcall org-babel-tangle
+
 
 clean: 
        rm -f *.elc