-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
147 lines (125 loc) · 2.92 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
SYSTEMD_DIR := systemd-units
SYSTEMD_CONFIG_DIR := ${HOME}/.config/systemd/user
UNITS := clean-local-tmp.service \
clean-local-tmp.timer \
mpdstats.service \
dunst.service \
change-wallpaper.service \
change-wallpaper.timer \
sort-pictures.service \
sort-pictures.timer \
send-mqtt@.timer \
send-mqtt@.service
SYSTEMD_UNITS := $(addprefix $(SYSTEMD_CONFIG_DIR)/, $(UNITS))
VIRTUALENVS_DIR := $(HOME)/.virtualenvs
NEOVIM_2 := $(HOME)/.virtualenvs/neovim2
PYTHON_2 := $(shell command -v python2 2>/dev/null)
NEOVIM_3 := $(HOME)/.virtualenvs/neovim3
PYTHON_3 := $(shell command -v python3 2>/dev/null)
SOFTWARE_DIRS := bash \
ctags \
git \
haskell \
python \
redshift \
shell \
vim \
formatters \
glances \
cmus \
latex \
xbindkeys \
urxvt \
tmux \
xfonts \
Xresources \
mutt \
javascript \
cpp \
xmonad \
xorg \
locale \
xmobar \
zathura \
feh \
icons \
weechat \
compton \
newsboat \
alacritty \
pandoc \
tmuxp \
beets \
mpd \
ncmpcpp \
kitty \
dunst \
gdb \
ocaml \
emacs \
rofi \
pulse \
kerl \
rebar3 \
erlang \
erlang_ls \
neovim
INSTALL_DIRS := $(SOFTWARE_DIRS:%=install-%)
.PHONY: all
all: $(SOFTWARE_DIRS) \
setup-virtual-environments \
install-scripts \
install-systemd-units
.PHONY: install-zsh
install-zsh:
@mkdir -p zsh/.zsh
@touch zsh/.zsh/histfile
@stow zsh -t ~
.PHONY: install-scripts
install-scripts:
@$(MAKE) -C scripts
.PHONY: subdirs $(SOFTWARE_DIRS)
$(SOFTWARE_DIRS): $(INSTALL_DIRS)
.PHONY: $(INSTALL_DIRS)
$(INSTALL_DIRS):
@stow $(@:install-%=%) -t ~
.PHONY: setup-vim-plugins
setup-vim-plugins: install-vim
@nvim +PlugInstall +qa
@$(MAKE) -C $(HOME)/.vim/bundle/vimproc.vim
.PHONY: setup-virtual-environments
setup-virtual-environments: $(NEOVIM_2) $(NEOVIM_3)
$(NEOVIM_2): | install-virtual-environment-wrapper
ifdef PYTHON_2
@virtualenv -p /usr/bin/python2 $(VIRTUALENVS_DIR)/neovim2 && pip install neovim
endif
$(NEOVIM_3): | install-virtual-environment-wrapper
ifdef PYTHON_3
@virtualenv -p /usr/bin/python3 $(VIRTUALENVS_DIR)/neovim3 && pip install neovim
endif
.PHONY: install-virtual-environment-wrapper
install-virtual-environment-wrapper: $(VIRTUALENVS_DIR)
@pip install --user virtualenv virtualenvwrapper
$(VIRTUALENVS_DIR):
@mkdir -p $(VIRTUALENVS_DIR)
.PHONY: install-language-servers
install-language-servers: install-python-language-server
install-python-language-server:
@pip install --user python-language-server pyls-mypy
.PHONY: install-systemd-units
install-systemd-units: $(SYSTEMD_UNITS)
$(SYSTEMD_CONFIG_DIR)/%.service: $(SYSTEMD_DIR)/%.service | $(SYSTEMD_CONFIG_DIR)
@cp $< $(SYSTEMD_CONFIG_DIR)
$(SYSTEMD_CONFIG_DIR)/%.timer: $(SYSTEMD_DIR)/%.timer | $(SYSTEMD_CONFIG_DIR)
@cp $< $(SYSTEMD_CONFIG_DIR)
$(SYSTEMD_CONFIG_DIR):
@mkdir -p $(SYSTEMD_CONFIG_DIR)
.PHONY: install-themes
install-themes:
@stow gtk -t ~
.PHONY: fonts
fonts:
@stow fonts -t ~
.PHONY: install-fonts
install-fonts: fonts
@fc-cache -fv fonts/.fonts