-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
206 lines (159 loc) · 5.24 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
.PHONY: all \
clean \
distclean \
install \
list \
test
all :
@echo "Run \`make -n install\` and read the output carefully."
@echo "If you're happy with what will happen, then run \`make install\`."
list:
@$(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | sort | egrep -v -e '^[^[:alnum:]]' -e '^$@$$'
clean :
@rm -f git/gitconfig
distclean :
@:
install : install-dotjs \
install-git \
install-gpg \
install-python \
install-readline \
install-ripgrep \
install-vim \
install-zsh
install-ack :
cp -p -- ack/ackrc "$(HOME)"/.ackrc
install-bash :
cp -p -- bash/bashrc "$(HOME)"/.bashrc
cp -p -- bash/bash_profile "$(HOME)"/.bash_profile
install-dotjs :
mkdir -p -- "$(HOME)"/.js
cp -p -- dotjs/*.js "$(HOME)"/.js
create-gitconfig:
git/setup
install-git : create-gitconfig
cp -p -- git/gitconfig "$(HOME)"/.gitconfig
cp -p -- git/gitignore-global "$(HOME)"/.gitignore-global
mkdir -p -- "$(HOME)"/.local/bin
cp -p -- git/git-* "$(HOME)"/.local/bin
install-gpg :
mkdir -p -- "$(HOME)"/.gnupg
cp -p -- gpg/gpg-agent.conf "$(HOME)"/.gnupg/gpg-agent.conf
install-eslint :
cp -p -- eslint/eslintrc "$(HOME)"/.eslintrc
install-lein :
mkdir -p -- "$(HOME)"/.lein
cp -p -- lein/profiles.clj "$(HOME)"/.lein/profiles.clj
install-python :
cp -p -- python/pythonrc "$(HOME)"/.pythonrc
install-readline :
cp -p -- readline/inputrc "$(HOME)"/.inputrc
install-tarsnap :
cp -p -- tarsnap/tarsnaprc "$(HOME)"/.tarsnaprc
configure-tarsnap :
ln -s "$(HOME)"/.tarsnaprc /var/root/.tarsnaprc
install-tarsnap-acts :
cp -p -- tarsnap/acts.conf /usr/local/etc/acts.conf
configure-tarsnap-acts : configure-tarsnap-acts-launch-daemon \
configure-tarsnap-acts-newsyslog
configure-tarsnap-acts-launch-daemon :
cp -p -- tarsnap/com.thomasupton.tarsnap-acts.plist /Library/LaunchDaemons/com.thomasupton.tarsnap-acts.plist
launchctl unload /Library/LaunchDaemons/com.thomasupton.tarsnap-acts.plist && launchctl load -w /Library/LaunchDaemons/com.thomasupton.tarsnap-acts.plist
configure-tarsnap-acts-newsyslog :
cp -p -- tarsnap/com.thomasupton.tarsnap-acts.conf /etc/newsyslog.d/com.thomasupton.tarsnap-acts.conf
newsyslog -nvv -f /etc/newsyslog.d/com.thomasupton.tarsnap-acts.conf
install-textmate :
cp -p -- TextMate/tm_properties "$(HOME)"/.tm_properties
install-tmux : install-tpm
cp -p -- tmux/tmux.conf "$(HOME)"/.tmux.conf
mkdir -p -- "$(HOME)"/.tmuxinator
cp -p -- tmux/tmuxinator/* "$(HOME)"/.tmuxinator
mkdir -p -- "$(HOME)"/.local/bin
cp -p -- tmux/bin/* "$(HOME)"/.local/bin
install-tpm :
tmux/install-tpm
install-vim : install-vim-config \
install-vim-init \
install-vim-plug \
install-vim-plugins \
install-vim-plugin-config
install-gvim : install-vim \
install-gvim-config
install-vim-config :
cp -p -- vim/vimrc "$(HOME)"/.vimrc
install-gvim-config :
cp -p -- vim/gvimrc "$(HOME)"/.gvimrc
install-vim-init:
mkdir -p -- \
"$(HOME)"/.vim/autoload \
"$(HOME)"/.vim/swap \
"$(HOME)"/.vim/undodir \
"$(HOME)"/.vim/plugged
install-vim-plug :
vim/install-vim-plug
install-vim-plugins :
vim/install-plugins
install-vim-plugin-config :
cp -p -- vim/coc-settings.json "$(HOME)"/.vim/coc-settings.json
install-zsh : install-zsh-config \
install-oh-my-zsh
install-zshd :
mkdir -p -- "$(HOME)"/.zshrc.d
cp -p -- zsh/zshrc.d/* "$(HOME)"/.zshrc.d
install-zsh-config : install-zshd
cp -p -- zsh/zshrc "$(HOME)"/.zshrc
install-oh-my-zsh :
zsh/install-oh-my-zsh
install-xdg-config :
mkdir -p -- "$(HOME)"/.config
install-karabiner-elements : install-xdg-config
mkdir -p -- "$(HOME)"/.config/karabiner
cp -p -- Karabiner-Elements/karabiner.json "$(HOME)"/.config/karabiner/karabiner.json
cp -p -- Karabiner-Elements/karabiner.edn "$(HOME)"/.config/karabiner.edn
install-ripgrep : install-zsh
cp -p -- ripgrep/ripgreprc "$(HOME)"/.ripgreprc
install-gh : install-xdg-config
mkdir -p -- "$(HOME)"/.config/gh
cp -p -- gh/config.yml "$(HOME)"/.config/gh/config.yml
install-atuin : install-xdg-config
mkdir -p -- "$(HOME)"/.config/atuin
cp -p -- atuin/config.toml "$(HOME)"/.config/atuin/config.toml
install-nvim : install-xdg-config
mkdir -p -- "$(HOME)"/.config/nvim
cp -p -- nvim/init.lua "$(HOME)"/.config/nvim/init.lua
test : test-setup test-zsh test-bash test-vimrc test-dotjs
test-setup :
@for setup in git/setup vim/install-* vim/update-* zsh/install-* zsh/update-*; do \
echo "Parsing $$setup" ; \
if [ -f "$$setup" ] && ! zsh --no-exec "$$setup" ; then \
exit 1 ; \
fi \
done
@echo "All setup scripts parsed successfully."
test-zsh :
@for zsh in zsh/zshrc zsh/zshrc.d/*.zsh git/git-* ; do \
echo "Parsing $$zsh" ; \
if [ -f "$$zsh" ] && ! zsh --no-exec "$$zsh" ; then \
exit 1 ; \
fi \
done
@echo "All zsh scripts parsed succesfully."
test-bash :
@for bash in bash/* ; do \
echo "Parsing $$bash" ; \
if [ -f "$$bash" ] && ! bash -n "$$bash" ; then \
exit 1 ; \
fi \
done
@echo "All bash scripts parsed successfully."
test-vimrc :
@for vim in vim/vimrc vim/gvimrc ; do \
echo "Linting $$vim" ; \
if [ -f "$$vim" ] && ! vint --color --style-problem "$$vim" ; then \
exit 1 ; \
fi \
done
@echo "All vim config files linted successfully."
test-dotjs :
@yarn test || exit 1
@echo "All dotjs files linted successfully."