-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathMakefile
79 lines (70 loc) · 2.14 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
.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:
make deploy
make -C config/emacs
sudo make sudo
deploy:
@-unlink ~/.gnupg
mkdir -p ~/.gnupg
for file in ~/Documents/jianguo/jianguo/keepass/gnupg/*; do \
name="$$(basename $$file)"; \
if [ ! "$$name" = "private-keys-v1.d" ]; then \
$(LINK_CMD) $$file ~/.gnupg/$$name; \
fi; \
done
make -C ~/Documents/jianguo/jianguo/keepass/gpg-backup restore
gpg -d dots/notmuch-config.gpg > dots/notmuch-config 2>/dev/null
@-for file in dots/*; do \
link_name=$$(echo "$$file" | tr ':' '/'); \
name="$${link_name#"dots/"}";\
rm -rf ~/.$$name ;\
$(LINK_CMD) $(PWD)/$$file ~/.$$name ;\
done
@-rm -f ~/.notmuch-config.gpg
gpg -d ~/.ssh/id_rsa.gpg > ~/.ssh/id_rsa 2>/dev/null
gpg -d ~/.ssh/config.gpg > ~/.ssh/config 2>/dev/null
gpg -d ~/.ssh/authorized_keys.gpg > ~/.ssh/authorized_keys 2>/dev/null
chmod 600 ~/.ssh/id_rsa
sudo cp -f ~/.ssh/config /etc/ssh/ssh_config.d/1config.conf
sudo chmod 644 /etc/ssh/ssh_config.d/1config.conf
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;
meow:
make -C config/emacs meow