Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
120 lines (102 loc) · 3.66 KB
/
Copy pathMakefile
File metadata and controls
120 lines (102 loc) · 3.66 KB
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
.PHONY: install dotfiles fonts bins tmuxstart vim nvim systemd tools
FONT_CONF_DIR := $(HOME)/.config/fontconfig/conf.d
FONT_DIR := $(HOME)/.fonts
DIR := $(shell pwd)
BIN_DIR := $(HOME)/.local/bin
BINS := $(shell find local/bin -executable -type f)
SYSTEMD_USER_DIR := $(HOME)/.config/systemd/user
SERVICES := $(shell find config/systemd/user -name '*.service')
# make a symlink to home directory for given dotfile
define dot =
ln -sfn $(DIR)/$(1) $(HOME)/.$(1)
endef
define installed =
command -v $(1) >/dev/null 2>&1 || (echo "$(1) needs to be installed and available in $$PATH"; exit 1)
endef
install: .deps fonts dotfiles bins tmuxstart
@git submodule update --init
vim +PlugInstall +qall
vim +GoUpdateBinaries +qall
nvim --headless +qall
update: .deps fonts tmuxstart
@git submodule update --init
curl -fLo ~/.vim/autoload/plug.vim https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
git submodule foreach git pull origin master
vim +PlugInstall +PlugUpdate +GoUpdateBinaries +qall
nvim --headless "+lua vim.pack.update(nil, { force = true })" +qall
# WARNING: will overwrite these dotfiles in $HOME
dotfiles: .deps
@$(call dot,vim)
@$(call dot,vimrc)
@$(call dot,alacritty.toml)
@$(call dot,xinitrc)
@$(call dot,xmodmap)
@$(call dot,zshrc)
@$(call dot,tmux.conf)
@$(call dot,mplayer)
@$(call dot,gitignore)
@$(call dot,gitconfig)
@$(call dot,config/ranger)
@$(call dot,config/nvim)
@$(call dot,config/solarized)
tmuxstart: .deps
curl -L https://raw.githubusercontent.com/treyhunner/tmuxstart/master/tmuxstart > $(BIN_DIR)/tmuxstart
chmod +x $(BIN_DIR)/tmuxstart
cp tmuxstart/dotfiles $(HOME)/.tmuxstart/dotfiles
bins:
@mkdir -p $(BIN_DIR)
@cp -f $(BINS) $(BIN_DIR)/
POWERLINE := https://raw.github.com/Lokaltog/powerline
fonts: .deps
@curl -L $(POWERLINE)/develop/font/10-powerline-symbols.conf > $(FONT_CONF_DIR)/10-powerline-symbols.conf
@curl -L $(POWERLINE)/develop/font/PowerlineSymbols.otf > $(FONT_DIR)/PowerlineSymbols.otf
@curl -L $(POWERLINE)-fonts/master/Inconsolata/Inconsolata%20for%20Powerline.otf > $(FONT_DIR)/Inconsolata.otf
@fc-cache -vf $(FONT_DIR)
tools: bins
@$(call installed,go)
@go-get-cmd github.com/davecheney/httpstat
@go-get-cmd github.com/gongo/9t
@go-get-cmd github.com/DATA-DOG/goup
@go-get-cmd github.com/vektorlab/slackcat
@curl -Lo $(GOPATH)/bin/ctop https://github.com/bcicen/ctop/releases/download/v0.5.1/ctop-0.5.1-linux-amd64
@chmod +x $(GOPATH)/bin/ctop
vim:
@$(call installed,git)
@rm -rf /tmp/vim_src
@mkdir -p /tmp/vim_src
@curl -s -L https://github.com/vim/vim/tarball/master | tar -C /tmp/vim_src -zx --strip-components 1
@cd /tmp/vim_src && ./configure \
--prefix=$(HOME)/.local \
--with-features=huge \
--with-compiledby="Custom edition" \
--enable-gpm \
--enable-acl \
--with-x=yes \
--disable-gui \
--enable-multibyte \
--enable-cscope \
--disable-netbeans \
--enable-pythoninterp \
--enable-python3interp && make && make install
NVIM_DIR := $(HOME)/.local/opt/nvim
# official release build, lives next to vim
nvim:
@$(call installed,curl)
@rm -rf $(NVIM_DIR)
@mkdir -p $(NVIM_DIR) $(BIN_DIR)
@curl -fsSL https://github.com/neovim/neovim/releases/latest/download/nvim-linux-x86_64.tar.gz | tar -C $(NVIM_DIR) -zx --strip-components 1
@ln -sfn $(NVIM_DIR)/bin/nvim $(BIN_DIR)/nvim
systemd: bins
@$(call installed,systemctl)
@$(call installed,xss-lock)
@$(call installed,i3lock)
@mkdir -p $(SYSTEMD_USER_DIR)
@cp -f $(SERVICES) $(SYSTEMD_USER_DIR)/
@systemctl --user daemon-reload
@systemctl --user enable --now $(notdir $(SERVICES))
.deps:
@$(call installed,git)
@$(call installed,vim)
@$(call installed,nvim)
@$(call installed,curl)
@mkdir -p $(FONT_DIR) $(FONT_CONF_DIR) $(HOME)/.tmuxstart $(BIN_DIR)