Add makefile to tangle all the dotfiles
This commit is contained in:
parent
c212a0672c
commit
b789d8b516
29
Makefile
29
Makefile
@ -1,25 +1,4 @@
|
|||||||
cache_dir := .cache
|
test: *.org
|
||||||
orgs := $(wildcard dotfiles/*.org)
|
for f in *.org; do emacsclient -e "(progn (find-file \"$$f\") (org-babel-tangle))"; done
|
||||||
|
tangle: *.org
|
||||||
tangle_el := elisp/tangle.el
|
for f in ./dotfiles/*.org; do emacsclient -e "(progn (find-file \"$$f\") (org-babel-tangle))"; done
|
||||||
|
|
||||||
^el = $(filter %.el,$^)
|
|
||||||
EMACS.funcall = emacs --batch --no-init-file $(addprefix --load ,$(^el)) --funcall
|
|
||||||
|
|
||||||
all: tangle
|
|
||||||
|
|
||||||
clean:
|
|
||||||
rm -rf $(cache_dir)
|
|
||||||
|
|
||||||
tangle: $(basename $(orgs))
|
|
||||||
$(cache_dir)/%.out: %.org $(tangle_el) $(cache_dir)/
|
|
||||||
$(EMACS.funcall) literate-dotfiles-tangle $< > $@
|
|
||||||
|
|
||||||
%/:
|
|
||||||
mkdir -p $@
|
|
||||||
|
|
||||||
%: %.org $(cache_dir)/%.out
|
|
||||||
@$(NOOP)
|
|
||||||
|
|
||||||
.PHONY: all clean test
|
|
||||||
.PRECIOUS: $(cache_dir)/ $(cache_dir)/%.out
|
|
||||||
|
Loading…
Reference in New Issue
Block a user