From b789d8b516d746ac8ec95616a64acb4821a63aa9 Mon Sep 17 00:00:00 2001 From: Thomas Dehaeze Date: Sat, 20 Jul 2019 16:16:12 +0200 Subject: [PATCH] Add makefile to tangle all the dotfiles --- Makefile | 29 ++++------------------------- 1 file changed, 4 insertions(+), 25 deletions(-) diff --git a/Makefile b/Makefile index f11425f..65531e6 100644 --- a/Makefile +++ b/Makefile @@ -1,25 +1,4 @@ -cache_dir := .cache -orgs := $(wildcard dotfiles/*.org) - -tangle_el := elisp/tangle.el - -^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 +test: *.org + for f in *.org; do emacsclient -e "(progn (find-file \"$$f\") (org-babel-tangle))"; done +tangle: *.org + for f in ./dotfiles/*.org; do emacsclient -e "(progn (find-file \"$$f\") (org-babel-tangle))"; done