]> git.rmz.io Git - dotfiles.git/blob - Makefile
Makefile: add system target
[dotfiles.git] / Makefile
1 APATH := $(realpath .)
2
3 FILES := bin
4 DOTFILES := conky* goobookrc msmtp* mutt profile tmux.conf weechat Xresources
5 CONFIGFILES := aliases compton.conf git gnupg 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 awesome: ~/.config
20 ln -sfT $(APATH)/awesome ~/.config/awesome
21 .PHONY: awesome
22
23 qutebrowser: ~/.config
24 ln -sfT $(APATH)/qutebrowser ~/.config/qutebrowser
25 mkdir -p ~/downloads
26 .PHONY: qutebrowser
27
28 mpd:
29 ln -sfT $(APATH)/mpd ~/.config/mpd
30 mkdir -p ~/.local/share/mpd/playlists
31 .PHONY: mpd
32
33 ncmpcpp:
34 ln -sfT $(APATH)/ncmpcpp ~/.config/ncmpcpp
35 mkdir -p ~/.local/share/mpd/lyrics
36 .PHONY: ncmpcpp
37
38 systemd:
39 ln -sfT $(APATH)/$@ ~/.config/$@
40 .PHONY: systemd
41
42 zsh:
43 ln -sfT $(APATH)/zshrc ~/.zshrc
44 ln -sfT $(APATH)/zprofile ~/.zprofile
45 ln -sfT $(APATH)/zshenv ~/.zshenv
46 ln -sfT $(APATH)/zsh ~/.config/zsh
47 mkdir -p ~/.cache/zsh
48 .PHONY: zsh
49
50 xprofile:
51 ln -sfT $(APATH)/xprofile ~/.xprofile
52 .PHONY: xprofile
53
54 dircolors:
55 ln -sfT $(APATH)/dircolors ~/.config/dircolors
56 .PHONY: dircolors
57
58 urxvt:
59 ln -sfT $(APATH)/urxvt ~/.config/urxvt
60 .PHONY: urxvt
61
62 $(FILES):
63 @if [[ -e ~/$@ && ! -L ~/$@ ]]; then \
64 if [[ -d $@ ]]; then \
65 cp -r ~/$@/* $@; \
66 else \
67 cp -r ~/$@ $@; \
68 fi; \
69 rm -r ~/$@; \
70 fi;
71 ln -sfT $(APATH)/$@ ~/$@
72
73 $(DOTFILES):
74 @if [[ -e ~/.$@ && ! -L ~/.$@ ]]; then \
75 if [[ -d .$@ ]]; then \
76 cp -r ~/.$@/* $@; \
77 else \
78 cp -r ~/.$@ $@; \
79 fi; \
80 rm -r ~/.$@; \
81 fi;
82 ln -sfT $(APATH)/$@ ~/.$@
83
84 $(CONFIGFILES): ~/.config
85 @if [[ -e ~/.config/$@ && ! -L ~/.config/$@ ]]; then \
86 if [[ -d .config/$@ ]]; then \
87 cp -r ~/.config/$@/* $@; \
88 else \
89 cp -r ~/.config/$@ $@; \
90 fi; \
91 rm -r ~/.config/$@; \
92 fi;
93 ln -sfT $(APATH)/$@ ~/.config/$@