-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
105 lines (76 loc) · 2.6 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
98
99
100
101
102
103
104
105
CDIR=$(HOME)/dotfiles
VPI=vagrant plugin install
GCG=git config --global
HC=$(HOME)/.config
.PHONY: help bootstrap relink vim vagrant base_dirs java git fish
.DEFAULT_GOAL := help
BINARY_STOW := /usr/local/bin/stow
BINARY_MR := /usr/local/bin/mr
init: ## initialize core
ssh-keyscan github.com >> ~/.ssh/known_hosts
ssh-keygen -o -a 100 -t ed25519 -f ~/.ssh/id_ed25519 -C "[email protected]"
$(BINARY_STOW):
brew install stow
$(BINARY_MR):
brew install mr
java:
brew cask install java
base:
mkdir -p $(HOME)/work/{github,oss,personal,papers}
mkdir -p $(HOME)/.vagrant.d
bootstrap: $(BINARY_STOW) $(BINARY_MR) base_dirs java ## bootstrap dotfiles
stow home
stow mr
stow emacs
stow vim
stow alacritty
stow vagrant
stow fish
BINARY_FISH := /usr/local/bin/fish
$(BINARY_FISH):
brew install fish toilet cowsay kubectl
BINARY_PIP := /usr/local/bin/pip
$(BINARY_PIP):
brew install python
bash: $(BINARY_PIP) ## configure bash
pip install --upgrade pip
pip install powerline-status
fish: $(BINARY_FISH) ## configure fish
sudo chsh -s /usr/local/bin/fish $(USER)
cd $(HC)/fish; mr bootstrap .mrconfig
relink: ## relink the packages with what is installed
brew bundle dump --force --file=$(CDIR)/Brewfile
vagrant plugin list | cut -f 1 -d ' ' > $(CDIR)/vagrant/.vagrant.d/plugins
asdf plugin-list > $(CDIR)/home/.asdf-plugins
brew: ## install all configured brew packages
brew bundle --file=$(CDIR)/Brewfile
asdf-plugins:
cat $(CDIR)/home/.asdf-plugins | xargs -I plugin-name asdf plugin-add plugin-name | true
asdf plugin-remove bazel
asdf plugin-add bazel https://github.com/rajatvig/asdf-bazel.git
asdf-tools: ## install compilers/sdks/tools using asdf
cat $(CDIR)/home/.tool-versions | xargs -I tool-version echo asdf install tool-version > /tmp/tools
chmod +x /tmp/tools
/tmp/tools
vagrant: ## Install and configure Vagrant
cat $(CDIR)/vagrant/.vagrant.d/plugins | xargs $(VPI)
BINARY_VIM := /usr/local/bin/vim
BINARY_NVIM := /usr/local/bin/nvim
$(BINARY_VIM):
brew install vim
$(BINARY_NVIM):
brew install nvim
vim: $(BINARY_PIP) $(BINARY_VIM) $(BINARY_NVIM) ## configure vim/nvim
vim +PlugInstall +qall
nvim +PlugInstall +qall
pip install --upgrade pip
pip install sexpdata websocket-client neovim
git: ## configure git global settings and an ignore file
$(GCG) user.name "Rajat Vig"
$(GCG) user.email "[email protected]"
$(GCG) core.editor vim
$(GCG) core.excludesfile "$(HOME)/.gitignore_global"
osx: ## setup sane OSX defaults
./scripts/_osx
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'