]> git.donarmstrong.com Git - lib.git/blob - emacs_el/configuration/Makefile
compile .el files for faster loading
[lib.git] / emacs_el / configuration / Makefile
1 #!/usr/bin/make
2
3
4 WHICH_EMACS:=$(shell which emacs >/dev/null 2>&1 || echo "fail")
5
6 ELC_FILES=
7 EL_FILES=
8 ORG_EL_FILES=
9 ifeq ($(strip $(WHICH_EMACS)),)
10 ORG_EL_FILES=$(patsubst %.org,%.el,$(wildcard *.org))
11 ORG_ELC_FILES=$(patsubst %.org,%.elc,$(wildcard *.org))
12 EL_FILES=$(sort $(wildcard *.el) $(ORG_EL_FILES))
13 ELC_FILES=$(patsubst %.el,%.elc,$(EL_FILES))
14 endif
15
16 LIB_PATH=-L . -L .. -L ../helm
17
18 all: $(ORG_ELC_FILES)
19
20 EMACS=emacs
21
22 $(ELC_FILES): %.elc: %.el
23         $(EMACS) -batch -q -no-site-file $(LIB_PATH) --no-site-file --eval '(byte-recompile-directory "." 0)'
24
25 $(ORG_EL_FILES): %.el: %.org
26         $(EMACS) -batch -q -no-site-file --visit $< --funcall org-babel-tangle
27
28
29 clean: 
30         rm -f *.elc
31
32 .PHONY: clean all
33