-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathMakefile
83 lines (58 loc) · 1.67 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
symlinks = \
bundle \
config \
local \
gemrc \
gitconfig \
gitignore \
tool-versions \
vimrc \
default: | update clean
install: | ln brew ruby vim_plug fisher
update: | install
brew upgrade
gem update
fish -c "fisher update"
vim +PlugUpgrade +PlugInstall +PlugUpdate +qall
clean: | install
brew cleanup
gem clean
vim +PlugClean +qall
# brew
brew: | $(homebrew)
homebrew_root = /opt/homebrew
homebrew = $(homebrew_root)/bin/brew
$(homebrew):
@/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
/opt/homebrew/bin/brew bundle --file=$(PWD)/Brewfile
# ln
prefixed_symlinks = $(addprefix $(HOME)/.,$(symlinks))
ln: | $(prefixed_symlinks)
$(prefixed_symlinks):
@ln -Fsv $(PWD)/$(patsubst .%,%,$(notdir $@)) $@
# ruby
ruby_version := $(shell cat $(PWD)/tool-versions | awk -v tool=ruby '$$1 == tool { print $$2 }')
ruby_versions = $(HOME)/.asdf/installs/ruby
ruby = $(ruby_versions)/$(ruby_version)
bundler = $(ruby)/bin/bundle
ruby: | $(ruby) $(bundler)
$(ruby): | $(brew) $(HOME)/.tool-versions
asdf plugin add ruby
asdf install ruby $(ruby_version)
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
# fisher
fisher = $(HOME)/.config/fish/functions/fisher.fish
fisher: | $(fisher)
$(fisher):
@/opt/homebrew/bin/fish -c "curl -sL https://raw.githubusercontent.com/jorgebucaran/fisher/main/functions/fisher.fish | source && fisher install jorgebucaran/fisher"
# make
.PHONY: update