-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
99 lines (83 loc) · 2.98 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
.PHONY: install dotfiles fonts bins tmuxstart vim systemd tools
FONT_CONF_DIR := $(HOME)/.config/fontconfig/conf.d
FONT_DIR := $(HOME)/.fonts
DIR := $(shell pwd)
BINS := $(shell find usr/local/bin -executable -type f)
SERVICES := $(shell find usr/lib/systemd/system -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
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
# 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/solarized)
tmuxstart: .deps
curl -L https://raw.githubusercontent.com/treyhunner/tmuxstart/master/tmuxstart > /tmp/tmuxstart
chmod +x /tmp/tmuxstart
sudo mv /tmp/tmuxstart /usr/local/bin/tmuxstart
cp tmuxstart/dotfiles $(HOME)/.tmuxstart/dotfiles
bins:
@for BINARY in $(BINS); do sudo cp -f $$BINARY /$$BINARY; done
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=/usr/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 && sudo make install
systemd:
@$(call installed,systemctl)
@for REL in $(SERVICES); do sudo cp -f $$REL /$$REL; done
.deps:
@$(call installed,git)
@$(call installed,vim)
@$(call installed,curl)
@mkdir -p $(FONT_DIR) $(FONT_CONF_DIR) $(HOME)/.tmuxstart