forked from kshenoy/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
26 lines (21 loc) · 1.07 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# Based on https://gitlab.com/to1ne/literate-dotfiles/blob/master/Makefile
# gnu make functions: https://www.gnu.org/software/make/manual/html_node/Functions.html
EMACS ?= emacs
MKLINK := command ln -svTf
docs := README.org
orgs := $(filter-out $(docs), $(wildcard *.org))
all: $(basename $(orgs))
# https://www.gnu.org/software/make/manual/html_node/Double_002dColon.html#Double_002dColon
# Using a double-colon rule with no prerequisite will always execute its recipe. Since the recipe is always executed, I don't have to declare it as PHONY
# Also, I have two things per target that I want to do
# - the tangling which I can do as a pattern and,
# - other recipes that are specific to the target
$(basename $(orgs))::
$(EMACS) --batch --no-init-file --load emacs.d/tangle.el --funcall literate-dotfiles-tangle [email protected]
emacs::
command mkdir -p ~/.emacs.d
@$(MKLINK) $(CURDIR)/emacs.d/private_work.el ~/.emacs.d/private_work.el
@$(MKLINK) $(CURDIR)/emacs.d/snippets ~/.emacs.d/snippets
git::
command mkdir -p ~/.config/git
@$(MKLINK) $(CURDIR)/gitignore ~/.config/git/ignore