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