-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
203 lines (142 loc) · 4.83 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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
# Note
# $@ - sources
# $< - target
# Check operating system
ifeq '$(findstring ;,$(PATH))' ';' # Windows
detected_OS := Windows
else
detected_OS := $(shell uname 2>/dev/null || echo Unknown)
detected_OS := $(patsubst CYGWIN%,Cygwin,$(detected_OS))
detected_OS := $(patsubst MSYS%,MSYS,$(detected_OS))
detected_OS := $(patsubst MINGW%,MSYS,$(detected_OS))
endif
ifeq ($(detected_OS),Darwin) # Mac OS X
OS = osx
endif
ifeq ($(detected_OS),Linux) # Linux
OS = deb
endif
# Dummy targets
.PHONY: vim_plugins install clean dotfiles directories
# Default targets
all: dotfiles bin tmux_plugins
vim_benchmark:
${HOME}/bin/vim -c 'StartupTime'
# vim_plugins:
# NEOVIM_SETUP=1 ${HOME}/bin/vim --headless -c 'autocmd User PackerComplete quitall' -c 'silent PackerSync'
tmux_plugins:
bash ./setup/tmux_plugins.sh
tmux_tpm:
bash ./setup/tmux_tpm.sh
# Directories
${HOME}/bin:
mkdir -p $@
${HOME}/.config:
mkdir -p $@
${HOME}/.config/nvim: ${HOME}/.config
mkdir -p $@
${HOME}/.ssh:
mkdir -p $@
${HOME}/.config/i3:
mkdir -p $@
${HOME}/.config/i3status: ${HOME}/.config
mkdir $@
directories: ${HOME}/bin ${HOME}/.config/nvim
directories.x: ${HOME}/.config/i3status ${HOME}/.config/i3
# Executables
${HOME}/bin/vim:
ln -fs `pwd`/bin.$(OS)/vim ${HOME}/bin/vim
${HOME}/opt/neovim: ${HOME}/opt/nvm
bash setup.$(OS)/nvim_setup.sh
${HOME}/opt/tmux-3.2a:
bash ./setup/tmux_compile.sh 1> /dev/null
bash ./setup/tmux_tpm.sh
bash ./setup/tmux_plugins.sh
${HOME}/opt/nvm:
bash ./setup/javascript_nvm.sh
bash ./setup/javascript_node.sh
bash ./setup/javascript_yarn.sh
${HOME}/bin/zsh:
bash ./setup/zsh_install.sh
${HOME}/.oh-my-zsh:
bash ./setup/zsh_ohmyzsh.sh
bash ./setup/zsh_ohmyzsh_plugins.sh
# TODO for bin folder, I should probably use CMakefile for rule generation
bin: ${HOME}/bin bindir_default bindir_$(OS) bindir_dev
bindir_default:
@bash ./setup/install_bin_directories.sh bin
bindir_dev:
@bash ./setup/install_bin_directories.sh bin.dev
bindir_deb:
@bash ./setup/install_bin_directories.sh bin.deb
bindir_deb.x:
@bash ./setup/install_bin_directories.sh bin.deb.x
bindir_osx:
@bash ./setup/install_bin_directories.sh bin.osx
bindir_hpc:
@bash ./setup/install_bin_directories.sh bin.hpc
# Dotfiles
dotfiles: directories dotfiles_defaults dotfiles_$(OS)
dotfiles.x: directories.x bindir_deb.x dotfiles_deb.x
${HOME}/.%:
test -f $@ && mv $@ $@.bk;:
ln -s `pwd`/$< $@
dotfiles_defaults: ${HOME}/.bashrc ${HOME}/.bash_profile ${HOME}/.bash_aliases ${HOME}/.bash_paths ${HOME}/.condarc ${HOME}/.gitconfig ${HOME}/.tmux.conf ${HOME}/.tmux-osx ${HOME}/.tmux-linux ${HOME}/.config/nvim/init.lua ${HOME}/.config/nvim/lua ${HOME}/.vsnip ${HOME}/.zshrc ${HOME}/.config/alacritty ${HOME}/.config/neofetch ${HOME}/.hushlogin
${HOME}/.bash_aliases: ./dot/bash_aliases
${HOME}/.bash_paths: ./dot/bash_paths
${HOME}/.bash_profile: ./dot/bash_profile
${HOME}/.bashrc: ./dot/bashrc
${HOME}/.condarc: ./dot/condarc
${HOME}/.gitconfig: ./dot/gitconfig
${HOME}/.hushlogin: ./dot/hushlogin
${HOME}/.tmux-linux: ./dot/tmux.linux.conf
${HOME}/.tmux-osx: ./dot/tmux.osx.conf
${HOME}/.tmux.conf: ./dot/tmux.conf
${HOME}/.zshrc: ./dot/zshrc
${HOME}/.ssh/config: ./dot/ssh_config
${HOME}/.config/neofetch: ./dot/neofetch
${HOME}/.config/alacritty: ./dot/alacritty
${HOME}/.config/nvim/init.lua: ./dot/neovim/init.lua
${HOME}/.config/nvim/lua: ./dot/neovim/lua
${HOME}/.vsnip: ./dot/neovim/snippets
dotfiles_osx: ${HOME}/.yabairc ${HOME}/.skhdrc ${HOME}/.gitignore ${HOME}/.ssh/config
${HOME}/.yabairc: ./dot.osx/yabairc
${HOME}/.skhdrc: ./dot.osx/skhdrc
${HOME}/.gitignore: ./dot.osx/gitignore
dotfiles_deb: ${HOME}/.inputrc
${HOME}/.inputrc: ./dot.deb/inputrc
dotfiles_deb.x: ${HOME}/.Xresources ${HOME}/.config/dunstrc ${HOME}/.config/i3status/config ${HOME}/.config/i3/config
${HOME}/.Xresources: ./dot.deb.x/Xresources
${HOME}/.config/dunstrc: ./dot.deb.x/dunstrc
${HOME}/.config/i3status/config: ./dot.deb.x/i3status
${HOME}/.config/i3/config: ./dot.deb.x/i3config
#
${HOME}/.fzf:
bash ./setup/fzf_setup.sh
# Meta
install: dotfiles bin ${HOME}/opt/neovim ${HOME}/.fzf ${HOME}/opt/tmux-3.2a ${HOME}/.oh-my-zsh
install_osx: ${HOME}/opt/homebrew
brew bundle --file ./lists/gnu.Brewfile
HOMEBREW_CASK_OPTS="--no-quarantine" brew bundle --file ./lists/i3like.Brewfile
${HOME}/opt/homebrew:
bash ./setup.osx/setup_brew.sh
install_deb:
@#
install_laptop: install_apt install_apt_x install_fonts
install_apt:
apt install $$(cat ./lists/packages.apt) -y
install_apt_x:
apt install $$(cat ./lists/packages.apt.x) -y
install_fonts:
bash ./fonts/setup_mononoki.sh
install_fonts_post_deb:
fc-cache -f -v
symlink_clean:
# TODO if there and is symlink, rm. For example, if symlink points to dotfiles, but is deprecated
clean: symlink_clean
clean_neovim:
mkdir -p ~/tmp/trash/
mv ~/opt/neovim/ ~/tmp/trash/
mv ~/bin/vim ~/tmp/trash/
mv ~/.local/share/nvim/ ~/tmp/trash/
rm -rf ~/tmp/trash/