-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
98 lines (75 loc) · 2.36 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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# Make awesomeness happen.
.PHONY: ALL
ALL = keys-config bash-config vim-config screen-config tmux-config git-config hg-config
# Linux doesn't need a few things that OSX does.
.PHONY: LINUX
LINUX = keys-sys bash-config vim-config screen-config tmux-config git-config hg-config
# Don't put crap in /etc.
.PHONY: NOGLOBAL
NOGLOBAL = keys-home bash-home vim-config tmux-config git-config hg-config
# Where to link files from, should generally be `pwd`.
DOTREPO = $(CURDIR)
# Make sure bash is used so that expansions are performed as expected.
SHELL=/bin/bash
all: $(ALL)
osx: $(ALL)
linux: $(LINUX)
noglobal: $(NOGLOBAL)
# Key setup.
.PHONY: keys-sys
keys-sys:
sudo ln -sf {$(DOTREPO),}/etc/inputrc
.PHONY: keys-home
keys-home:
mkdir -p $(HOME)/Library/KeyBindings/
ln -sf {$(DOTREPO),$(HOME)/Library/KeyBindings}/DefaultKeyBinding.dict
.PHONY: keys-config
keys-config: keys-sys keys-home
# Bash config.
.PHONY: bash-sys
bash-sys:
sudo ln -sf {$(DOTREPO),}/etc/profile
-test ! -L /etc/profile.d && sudo ln -sf {$(DOTREPO),}/etc/profile.d
.PHONY: bash-home
bash-home:
ln -sf {$(DOTREPO)/,$(HOME)/.}bashrc
ln -sf {$(DOTREPO)/,$(HOME)/.}profile
ln -sf {$(DOTREPO)/,$(HOME)/.}bash_aliases
ln -sf {$(DOTREPO)/,$(HOME)/.}bash_profile
.PHONY: bash-config
bash-config: bash-sys bash-home
# zsh.
.PHONY: zsh-config
zsh-config:
ln -sf {$(DOTREPO)/,$(HOME)/.}zshrc
-test ! -d $(HOME)/.zsh/zsh-autosuggestions && git clone https://github.com/zsh-users/zsh-autosuggestions $(HOME)/.zsh/zsh-autosuggestions
# Vim.
.PHONY: vim-config
vim-config:
mkdir -p $(HOME)/.vim/bundle
mkdir -p $(HOME)/tmp/vim/{backup,swap,undo}
ln -sf {$(DOTREPO)/,$(HOME)/.}vimrc
ln -sf {$(DOTREPO)/,$(HOME)/.}gvimrc
ln -sf $(DOTREPO)/vim/* $(HOME)/.vim/
-test ! -d $(HOME)/.vim/autoload/plug.vim && curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
# screen.
.PHONY: screen-sys
screen-sys:
sudo ln -sf {$(DOTREPO),}/etc/screenrc
.PHONY: screen-config
screen-config: screen-sys
# tmux.
.PHONY: tmux-config
tmux-config:
ln -sf {$(DOTREPO)/,$(HOME)/.}tmux.conf
# git.
.PHONY: git-config
git-config:
ln -sf {$(DOTREPO)/,$(HOME)/.}gitconfig
ln -sf {$(DOTREPO)/,$(HOME)/.}gitignore_global
ln -sf {$(DOTREPO)/,$(HOME)/.}tigrc
# Mercurial.
.PHONY: hg-config
hg-config:
ln -sf {$(DOTREPO)/,$(HOME)/.}hgrc
ln -sf {$(DOTREPO)/,$(HOME)/.}hgignore_global