-
Notifications
You must be signed in to change notification settings - Fork 10
/
Makefile
62 lines (55 loc) · 1.57 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
.PHONY: all emacs-compile elisp-compile deploy
PWD := `pwd`
LINK_CMD := ln -s -f
LINK_CMD_HARD := ln -f
NORMAL_FILES_COMMON := `echo ssh password-store pam-gnupg gnupg mitmproxy authinfo.gpg gitconfig gitattributes gitignore vimrc zshenv zshrc bashrc fzf.zsh mbsyncrc mailrc msmtprc`
default:
sudo make sudo
make deploy
make -C config/emacs
deploy:
@-for file in dots/*; do \
link_name=$$(echo "$$file" | tr ':' '/'); \
name=$$(basename "$$link_name"); \
rm -rf ~/.$$name ;\
$(LINK_CMD) $(PWD)/$$file ~/.$$name ;\
done
gpg -d ~/.ssh/id_rsa.gpg > ~/.ssh/id_rsa
gpg -d ~/.ssh/config.gpg > ~/.ssh/config
gpg -d ~/.ssh/authorized_keys.gpg > ~/.ssh/authorized_keys
chmod 600 ~/.ssh/id_rsa
chmod 600 ~/.ssh/config
chmod 600 ~/.ssh/authorized_keys
@-mkdir -p ~/.config/
@-for file in config/*; do \
link_name=$$(echo "$$file" | tr ':' '/'); \
mkdir -p "$$HOME/.$$(dirname "$$link_name")"; \
if [ -h ~/.$$link_name ]; then \
rm -rf ~/.$$link_name ;\
fi;\
$(LINK_CMD) $(PWD)/$$file ~/.$$link_name ;\
done
@if [ ! -d ~/.cache/.vimbackup ]; then\
mkdir -p ~/.cache/.vimbackup;\
fi
@if [ `uname -s` = "Linux" ] ; then \
cd linux && $(MAKE) ; \
fi
@if [ `uname -s` = "Darwin" ] ; then \
cd mac && $(MAKE) ; \
fi
sudo:
@if [ `uname -s` = "Linux" ] ; then \
cd linux && $(MAKE) sudo; \
fi
@if [ `uname -s` = "Darwin" ] ; then \
cd mac && $(MAKE) sudo; \
fi
for file in bin/*; do \
if [ -h /usr/local/$$file ]; then \
rm -rf /usr/local/$$file ;\
fi;\
if [ -f $$file ]; then \
$(LINK_CMD) $(PWD)/$$file /usr/local/$$file ;\
fi;\
done;