-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
207 lines (175 loc) · 5.46 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
204
205
206
207
SHELL := /bin/bash
# TODO(zmanji): Replace this with an easier to understand shell script.
.PHONY: all
all: submodules shells dns osx git neovim vim hammerspoon emacs emacs-bin hunspell bin karabiner iterm2 tmux idea tweak startpage ripgrep dicts pandoc
.PHONY: tmux
tmux: .tmux.conf
@echo removing $^; \
$(foreach df, $^, rm -f ~/$(df))
@echo Installing $^; \
$(foreach df, $^, ln -s $(CURDIR)/$(df) ~; )
.PHONY: git
git: .gitconfig .gitignore_global
@echo removing $^; \
$(foreach df, $^, rm -f ~/$(df))
@echo Installing $^; \
$(foreach df, $^, ln -s $(CURDIR)/$(df) ~; )
.PHONY: ripgrep
ripgrep: .ripgreprc
@echo removing $^; \
$(foreach df, $^, rm -f ~/$(df))
@echo Installing $^; \
$(foreach df, $^, ln -s $(CURDIR)/$(df) ~; )
# Assuming dnsmasq is running
.PHONY: dns
dns: local-services.conf
$(shell mkdir -p /opt/homebrew/etc/dnsmasq.d/)
@echo removing $^; \
$(foreach df, $^, rm -f /opt/homebrew/etc/dnsmasq.d/$(df))
@echo Installing $^; \
$(foreach df, $^, ln -s $(CURDIR)/$(df) /opt/homebrew/etc/dnsmasq.d/; )
.PHONY: vim
vim: .vim .vimrc .gvimrc .surfingkeys.js
@echo removing $^; \
$(foreach df, $^, rm -f ~/$(df))
@echo Installing $^; \
$(foreach df, $^, ln -s $(CURDIR)/$(df) ~; )
.PHONY: pandoc
pandoc: .pandoc
@echo removing $^; \
$(foreach df, $^, rm -f ~/$(df))
@echo Installing $^; \
$(foreach df, $^, ln -s $(CURDIR)/$(df) ~; )
.PHONY: tweak
tweak: .tweak
@echo removing $^; \
$(foreach df, $^, rm -f ~/$(df))
@echo Installing $^; \
$(foreach df, $^, ln -s $(CURDIR)/$(df) ~; )
@echo Installing Native Messenger
.tweak/install_native.py
.PHONY: startpage
startpage: .config/startpage
$(shell mkdir -p ~/.config)
@echo removing $^; \
$(shell rm -rf ~/$^)
@echo Installing $^; \
$(shell ln -s $(CURDIR)/$^ ~/$^)
.PHONY: neovim
neovim: .config/nvim
$(shell mkdir -p ~/.config)
@echo removing $^; \
$(shell rm -rf ~/$^)
@echo Installing $^; \
$(shell ln -s $(CURDIR)/$^ ~/$^)
.PHONY: emacs
emacs: .emacs.d
@echo removing $^; \
$(foreach df, $^, rm -rf ~/$(df))
@echo Installing $^; \
$(foreach df, $^, ln -s $(CURDIR)/$(df) ~; )
.PHONY: shells
shells: .editrc .gemrc .hushlogin .inputrc .zshenv .zshrc .zsh
@echo removing $^; \
$(foreach df, $^, rm -f ~/$(df))
@echo Installing $^; \
$(foreach df, $^, ln -s $(CURDIR)/$(df) ~; )
.PHONY: osx
osx: .osx
@echo removing $^; \
$(foreach df, $^, rm -f ~/$(df))
@echo Installing $^; \
$(foreach df, $^, ln -s $(CURDIR)/$(df) ~; )
@echo Running .osx; \
sh ~/.osx
.PHONY: hammerspoon
hammerspoon: .hammerspoon
@echo removing $^; \
$(foreach df, $^, rm -rf ~/$(df))
@echo Installing $^; \
$(foreach df, $^, ln -s $(CURDIR)/$(df) ~; )
.PHONY: karabiner
karabiner: .config/karabiner
$(shell mkdir -p ~/.config)
@echo removing $^; \
$(shell rm -rf ~/$^)
@echo Installing $^; \
$(shell ln -s $(CURDIR)/$^ ~/$^)
.PHONY: iterm2
iterm2: .config/iterm2
$(shell mkdir -p ~/.config)
@echo removing $^; \
$(shell rm -rf ~/$^)
@echo Installing $^; \
$(shell ln -s $(CURDIR)/$^ ~/$^)
.PHONY: kitty
kitty: .config/kitty
$(shell mkdir -p ~/.config)
@echo removing $^; \
$(shell rm -rf ~/$^)
@echo Installing $^; \
$(shell ln -s $(CURDIR)/$^ ~/$^)
.PHONY: tridactyl
tridactyl: .config/tridactyl
$(shell mkdir -p ~/.config)
@echo removing $^; \
$(shell rm -rf ~/$^)
@echo Installing $^; \
$(shell ln -s $(CURDIR)/$^ ~/$^)
.PHONY: dicts
dicts: dicts/en_CA.aff dicts/en_CA.dic dicts/en_US.aff dicts/en_US.dic
mkdir -p ~/Library/Spelling/
@echo removing $^; \
$(foreach df, $^, rm -rf ~/Library/Spelling/$$(basename $(df)));
@echo Installing $^; \
$(foreach df, $^, ln -s $(CURDIR)/$(df) ~/Library/Spelling/$(notdir $(df)); )
.PHONY: hunspell
hunspell: .hunspell_en_CA .hunspell_en_US
@echo removing $^; \
$(foreach df, $^, rm -f ~/$(df))
@echo Installing $^; \
$(foreach df, $^, ln -s $(CURDIR)/$(df) ~; )
# Update vim spelling file from hunspell dicts
/opt/homebrew/bin/vim -u NONE -e -c "mkspell! ~/.vim/spell/en ~/Library/Spelling/en_CA ~/Library/Spelling/en_US" -c q
# Update vim personal dict from hunspell dict
/opt/homebrew/bin/vim -U NONE -e -c "mkspell! ~/.vim/custom-dictionary.en.utf8.add" -c q
.PHONY: idea
idea: .ideavimrc
@echo removing $^; \
$(foreach df, $^, rm -f ~/$(df))
@echo Installing $^; \
$(foreach df, $^, ln -s $(CURDIR)/$(df) ~; )
.PHONY: bin
bin: git-squash emacs-bin personal-bin
# Sub targets for bin
.PHONY: git-squash
git-squash: ~/bin/git-squash
.PHONY: personal-bin
personal-bin: bin/git-fb bin/startpage.sh bin/startpage.py bin/term-yank bin/term-paste
$(shell mkdir -p ~/bin)
@echo removing $^; \
$(foreach df, $^, rm -rf ~/$(df))
@echo Installing $^; \
$(foreach df, $^, ln -s $(CURDIR)/$(df) ~/$(df); )
.PHONY: emacs-bin
emacs-bin: bin/README.emacs bin/ec bin/et
$(shell mkdir -p ~/bin)
@echo removing $^; \
$(foreach df, $^, rm -rf ~/$(df))
@echo Installing $^; \
$(foreach df, $^, ln -s $(CURDIR)/$(df) ~/$(df); )
.PHONY: ~/bin/git-squash
~/bin/git-squash:
mkdir -p ~/bin/
wget -O ~/bin/git-squash https://github.com/zmanji/git-squash-rs/releases/download/0.2.0/git-squash-rs.stable-x86_64-apple-darwin
chmod +x ~/bin/git-squash
.PHONY: launchd
launchd: launchd/zmanji.emacs.plist launchd/zmanji.startpage.plist launchd/zmanji.pbcopy.plist launchd/zmanji.pbpaste.plist
mkdir -p ~/Library/LaunchAgents/
@echo removing $^; \
$(foreach df, $^, rm -rf ~/Library/LaunchAgents/$$(basename $(df)));
@echo Installing $^; \
$(foreach df, $^, ln -s $(CURDIR)/$(df) ~/Library/LaunchAgents/$(notdir $(df)); )
submodules:
git submodule init
git submodule update --recursive