-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
71 lines (57 loc) · 1.87 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
ROOT_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
# --- Ignore Files ---
ignore = Makefile README.md bin windows emacs.d setup.sh
# --- Get Files/Directories ---
dirs = $(wildcard */)
dirs := $(dirs:%/=%)
files = $(filter-out $(dirs), $(wildcard *))
links = $(addprefix $(HOME)/., $(filter-out $(ignore), $(wildcard *)))
# --- Directories ---
.FISH := $(HOME)/.config/fish
# --- powerline ---
temp := $(shell mktemp -d)
fonts := $(HOME)/.fonts
fontconfig := $(HOME)/.config/fontconfig/conf.d
# --- All ---
all: .ssh .vim links
# --- Symbolic Links ---
links: $(links)
$(HOME)/.%: $(ROOT_DIR)/%; ln -fs $< $@
# --- bash ---
bash: bash/downloads/git-completion.bash
bash/downloads/git-completion.bash:
curl -fLo $@ https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash
# --- fisherman ---
# TODO: Delete
# fish plugin manager
fish: $(.FISH)/functions/fisher.fish
$(.FISH)/functions/fisher.fish:
curl -fLo $@ https://git.io/fisher
# --- Powerline Font ---
fonts: $(fonts)/fonts.dir $(fonts)/fonts.scale $(fontconfig)/10-powerline-symbols.conf
cp $(fonts)/fonts.scale $(fonts)/fonts.dir
xset q | grep -q $(fonts) || xset +fp $(fonts)
fc-cache -fv $(fonts)
$(fonts)/fonts.dir: $(fonts)/PowerlineSymbols.otf
mkfontdir $(fonts)
$(fonts)/fonts.scale: $(fonts)/PowerlineSymbols.otf
mkfontscale $(fonts)
$(fonts)/PowerlineSymbols.otf:
@mkdir -p $(@D)
@wget -O $@ https://github.com/powerline/powerline/raw/develop/font/PowerlineSymbols.otf
$(fontconfig)/10-powerline-symbols.conf:
@mkdir -p $(@D)
@wget -O $@ https://github.com/powerline/powerline/raw/develop/font/10-powerline-symbols.conf
# --- SSH ---
.ssh: $(HOME)/.ssh/id_rsa
$(HOME)/.ssh/id_rsa:
setup/ssh-keygen.bash
# --- Vim ---
.vim: vim/autoload/plug.vim
vim/setup.sh:
git submodule update --init vim
vim/autoload/plug.vim: vim/setup.sh
vim/setup.sh
# --- Clean ---
clean:
rm $(links)