forked from davidcelis/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
82 lines (59 loc) · 1.41 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
symlinks = \
atom \
bundle \
config \
local \
gemrc \
gitconfig \
gitignore \
pryrc \
ruby-version \
tmux \
tmux.conf \
vimrc \
default: | update clean
install: | brew ln ruby vim_plug
update: | install
brew update
brew upgrade
gem update
vim +PlugUpgrade +PlugInstall +PlugUpdate +qall
mas upgrade
clean: | install
brew cleanup
gem clean
vim +PlugClean +qall
# brew
brew: | $(homebrew)
homebrew_root = /usr/local
homebrew = $(homebrew_root)/bin/brew
$(homebrew):
@ruby -e "$$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# ln
prefixed_symlinks = $(addprefix $(HOME)/.,$(symlinks))
ln: | $(prefixed_symlinks)
$(prefixed_symlinks):
@ln -Fsv $(PWD)/$(patsubst .%,%,$(notdir $@)) $@
# ruby
ruby_version := $(shell cat $(PWD)/ruby-version)
ruby_versions = $(HOME)/.rbenv/versions
ruby = $(ruby_versions)/$(ruby_version)
bundler = $(ruby)/bin/bundle
cocoapods = $(ruby)/bin/pod
ruby: | $(ruby) $(bundler)
$(ruby): | $(brew) $(HOME)/.ruby-version
ruby-install ruby-$(ruby_version) -i $(ruby_versions)/$(ruby_version)
rbenv global $(ruby_version)
rbenv rehash
gem = $(ruby)/bin/gem
$(bundler): | $(ruby)
$(gem) install bundler
# vim
vim_plug = $(HOME)/.vim/autoload/plug.vim
vim_plug: | $(vim_plug)
$(vim_plug):
curl -fLo $(vim_plug) --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
mkdir -p $(HOME)/.vim/tmp
# make
.PHONY: update