]> git.rmz.io Git - dotfiles.git/blob - Makefile
3184bb619f16f60853b29708be82c716bbfeda38
[dotfiles.git] / Makefile
1 APATH := $(realpath .)
2
3 FILES := bin
4 DOTFILES := goobookrc msmtp* profile tmux.conf weechat Xresources
5 CONFIGFILES := aliases compton.conf git mpv offlineimap ranger retroarch xbindkeys xkb
6
7 .PHONY: install $(FILES) $(DOTFILES) $(CONFIGFILES)
8 install: $(FILES) $(DOTFILES) $(CONFIGFILES)
9
10 ~/.config:
11 mkdir -p ~/.config
12
13 vim:
14 ln -sfT $(APATH)/vim ~/.config/vim
15 mkdir -p ~/.local/share/vim
16 git clone https://github.com/gmarik/vundle ~/.local/share/vim/vundle
17 .PHONY: vim
18
19 mutt:
20 ln -sfT $(APATH)/mutt ~/.config/mutt
21 .PHONY: mutt
22
23 gdb:
24 ln -sfT $(APATH)/gdbinit ~/.gdbinit
25 ln -sfT $(APATH)/cgdb ~/.cgdb
26 .PHONY: gdb
27
28 awesome: ~/.config
29 ln -sfT $(APATH)/awesome ~/.config/awesome
30 .PHONY: awesome
31
32 qutebrowser: ~/.config
33 ln -sfT $(APATH)/qutebrowser ~/.config/qutebrowser
34 mkdir -p ~/downloads
35 .PHONY: qutebrowser
36
37 mpd: systemd
38 ln -sfT $(APATH)/mpd ~/.config/mpd
39 mkdir -p ~/.local/share/mpd/playlists
40 systemctl --user enable mpd
41 systemctl --user start mpd
42 .PHONY: mpd
43
44 ncmpcpp:
45 ln -sfT $(APATH)/ncmpcpp ~/.config/ncmpcpp
46 mkdir -p ~/.local/share/mpd/lyrics
47 .PHONY: ncmpcpp
48
49 systemd:
50 ln -sfT $(APATH)/$@ ~/.config/$@
51 .PHONY: systemd
52
53 gnupg: systemd
54 ln -sfT $(APATH)/$@ ~/.config/$@
55 systemctl --user enable gpg-agent.socket gpg-agent-extra.socket gpg-agent-browser.socket dirmngr.socket
56 systemctl --user start gpg-agent.socket gpg-agent-extra.socket gpg-agent-browser.socket dirmngr.socket
57 .PHONY: gnupg
58
59 zsh:
60 ln -sfT $(APATH)/zshrc ~/.zshrc
61 ln -sfT $(APATH)/zprofile ~/.zprofile
62 ln -sfT $(APATH)/zshenv ~/.zshenv
63 ln -sfT $(APATH)/zsh ~/.config/zsh
64 mkdir -p ~/.cache/zsh
65 .PHONY: zsh
66
67 xprofile:
68 ln -sfT $(APATH)/xprofile ~/.xprofile
69 .PHONY: xprofile
70
71 dircolors:
72 ln -sfT $(APATH)/dircolors ~/.config/dircolors
73 .PHONY: dircolors
74
75 urxvt:
76 ln -sfT $(APATH)/urxvt ~/.config/urxvt
77 .PHONY: urxvt
78
79 $(FILES):
80 @if [[ -e ~/$@ && ! -L ~/$@ ]]; then \
81 if [[ -d $@ ]]; then \
82 cp -r ~/$@/* $@; \
83 else \
84 cp -r ~/$@ $@; \
85 fi; \
86 rm -r ~/$@; \
87 fi;
88 ln -sfT $(APATH)/$@ ~/$@
89
90 $(DOTFILES):
91 @if [[ -e ~/.$@ && ! -L ~/.$@ ]]; then \
92 if [[ -d .$@ ]]; then \
93 cp -r ~/.$@/* $@; \
94 else \
95 cp -r ~/.$@ $@; \
96 fi; \
97 rm -r ~/.$@; \
98 fi;
99 ln -sfT $(APATH)/$@ ~/.$@
100
101 $(CONFIGFILES): ~/.config
102 @if [[ -e ~/.config/$@ && ! -L ~/.config/$@ ]]; then \
103 if [[ -d .config/$@ ]]; then \
104 cp -r ~/.config/$@/* $@; \
105 else \
106 cp -r ~/.config/$@ $@; \
107 fi; \
108 rm -r ~/.config/$@; \
109 fi;
110 ln -sfT $(APATH)/$@ ~/.config/$@