]> git.rmz.io Git - dotfiles.git/blobdiff - Makefile
Makefile: add target for git
[dotfiles.git] / Makefile
index 1e63778452555e8a3008f374d82607a0d1381f93..d8da053456ba8fd63a0ab28821b77da40fc1bf54 100644 (file)
--- a/Makefile
+++ b/Makefile
 APATH := $(realpath .)
-RPATH := $(subst $(wildcard ~/),,$(APATH))
 
-EXCLUDES := Makefile 
-ALL := $(wildcard *)
-FILES := $(filter-out $(EXCLUDES),$(ALL))
+FILES := bin
+DOTFILES := goobookrc msmtp* profile tmux.conf weechat Xresources
+CONFIGFILES := compton.conf mpv offlineimap ranger retroarch xbindkeys xkb
 
+.PHONY: install $(FILES) $(DOTFILES) $(CONFIGFILES)
+install: $(FILES) $(DOTFILES) $(CONFIGFILES)
 
-test:
-       echo $(APATH)
-       echo $(FILES);
-       echo $(RPATH)
+~/.config:
+       mkdir -p ~/.config
 
-.PHONY: install $(FILES)
-install: $(FILES)
+git: ~/.config
+       ln -sfT $(APATH)/git ~/.config/git
+.PHONY: git
 
-$(FILES): 
-       cp -r ~/.$@ $@
-       rm -r ~/.$@
-       ln -sf $(RPATH)/$@ ~/.$@ 
+vim: ~/.config
+       ln -sfT $(APATH)/vim ~/.config/vim
+       mkdir -p ~/.local/share/vim
+       git clone https://github.com/gmarik/vundle ~/.local/share/vim/vundle
+.PHONY: vim
+
+mutt: ~/.config
+       ln -sfT $(APATH)/mutt ~/.config/mutt
+.PHONY: mutt
+
+gdb:
+       ln -sfT $(APATH)/gdbinit ~/.gdbinit
+       ln -sfT $(APATH)/cgdb ~/.cgdb
+.PHONY: gdb
+
+awesome: ~/.config
+       ln -sfT $(APATH)/awesome ~/.config/awesome
+.PHONY: awesome
+
+qutebrowser: ~/.config
+       ln -sfT $(APATH)/qutebrowser ~/.config/qutebrowser
+       mkdir -p ~/downloads
+.PHONY: qutebrowser
+
+mpd: systemd
+       ln -sfT $(APATH)/mpd ~/.config/mpd
+       mkdir -p ~/.local/share/mpd/playlists
+       systemctl --user enable mpd
+       systemctl --user start mpd
+.PHONY: mpd
+
+ncmpcpp: ~/.config
+       ln -sfT $(APATH)/ncmpcpp ~/.config/ncmpcpp
+       mkdir -p ~/.local/share/mpd/lyrics
+.PHONY: ncmpcpp
+
+systemd: ~/.config
+       ln -sfT $(APATH)/$@ ~/.config/$@
+.PHONY: systemd
+
+gnupg: systemd
+       ln -sfT $(APATH)/$@ ~/.config/$@
+       systemctl --user enable gpg-agent.socket gpg-agent-extra.socket gpg-agent-browser.socket dirmngr.socket
+       systemctl --user start gpg-agent.socket gpg-agent-extra.socket gpg-agent-browser.socket dirmngr.socket
+.PHONY: gnupg
+
+zsh: ~/.config
+       ln -sfT $(APATH)/zshrc ~/.zshrc
+       ln -sfT $(APATH)/zprofile ~/.zprofile
+       ln -sfT $(APATH)/zshenv ~/.zshenv
+       ln -sfT $(APATH)/zsh ~/.config/zsh
+       ln -sfT $(APATH)/aliases ~/.config/aliases
+       mkdir -p ~/.cache/zsh
+.PHONY: zsh
+
+xprofile:
+       ln -sfT $(APATH)/xprofile ~/.xprofile
+.PHONY: xprofile
+
+dircolors: ~/.config
+       ln -sfT $(APATH)/dircolors ~/.config/dircolors
+.PHONY: dircolors
+
+urxvt: ~/.config
+       ln -sfT $(APATH)/urxvt ~/.config/urxvt
+.PHONY: urxvt
+
+$(FILES):
+       @if [[ -e ~/$@ && ! -L ~/$@ ]]; then \
+           if [[ -d $@ ]]; then \
+             cp -r ~/$@/* $@; \
+           else \
+             cp -r ~/$@ $@; \
+           fi; \
+           rm -r ~/$@; \
+       fi;
+       ln -sfT $(APATH)/$@ ~/$@
+
+$(DOTFILES):
+       @if [[ -e ~/.$@ && ! -L ~/.$@ ]]; then \
+           if [[ -d .$@ ]]; then \
+             cp -r ~/.$@/* $@; \
+           else \
+             cp -r ~/.$@ $@; \
+           fi; \
+           rm -r ~/.$@; \
+       fi;
+       ln -sfT $(APATH)/$@ ~/.$@
+
+$(CONFIGFILES):  ~/.config
+       @if [[ -e ~/.config/$@ && ! -L ~/.config/$@ ]]; then \
+           if [[ -d .config/$@ ]]; then \
+             cp -r ~/.config/$@/* $@; \
+           else \
+             cp -r ~/.config/$@ $@; \
+           fi; \
+           rm -r ~/.config/$@; \
+       fi;
+       ln -sfT $(APATH)/$@ ~/.config/$@