forked from ChrisBuchholz/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
40 lines (29 loc) · 1 KB
/
Makefile
File metadata and controls
40 lines (29 loc) · 1 KB
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
27
28
29
30
31
32
33
34
35
36
37
38
39
# Makefile for dotfiles (cf. https://github.com/pix/dotfiles)
DIR =
DOT_DIR = fonts local vim oh-my-zsh virtualenvs
DOT_FILE = Xdefaults profile git-completion.sh gitignore \
inputrc screenrc tmux.conf vimrc osx com.googlecode.iterm2.plist \
zshrc zshrc-linux zshrc-osx
all: install
install: $(HOME)/.history $(foreach f, $(DIR), install-dir-$(f)) \
$(foreach f, $(DOT_DIR), install-dotdir-$(f)) \
$(foreach f, $(DOT_FILE), install-file-$(f))
$(HOME)/.history:
@echo " MKDIR Creating ~/.history"
@mkdir $(HOME)/.history 2>/dev/null
install-dir-%: %
@echo " LN $< to ~/$<"
@ln -snf $(CURDIR)/$< $(HOME)/$<
install-dotdir-%: %
@echo " LN $< to ~/.$<"
@ln -snf $(CURDIR)/$< $(HOME)/.$<
install-file-%: %
@echo " LN $< to ~/.$<"
@ln -sf $(CURDIR)/$< $(HOME)/.$<
clean: $(foreach f, $(DIR), clean-$(f)) \
$(foreach f, $(DOT_DIR), clean-.$(f)) \
$(foreach f, $(DOT_FILE), clean-.$(f))
clean-%:
@echo " CLEAN ~/$*"
@sh -c "if [ -h ~/$* ]; then rm ~/$*; fi"
.PHONY : clean