]> git.rmz.io Git - dotfiles.git/blobdiff - Makefile
Makefile: add separate targets for mpd and ncmpcpp
[dotfiles.git] / Makefile
index 91cc601f9ac1f1c01dc3fd83b250ae5067f57cdd..e4f5e152dae05c544bb34f87367a2c9302ede025 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,51 @@
-.PHONY: install
+APATH := $(realpath .)
 
-install:
-       cp -f vimrc ~/.vimrc
+FILES := bin
+DOTFILES := conky* goobookrc msmtp* mutt profile tmux.conf weechat Xresources xprofile zprofile zshenv zshrc
+CONFIGFILES := aliases compton.conf git gnupg mpv offlineimap ranger retroarch systemd vim xbindkeys xkb zsh
 
-update:
-       cp -f ~/.vimrc vimrc
+.PHONY: install $(FILES) $(DOTFILES) $(CONFIGFILES)
+install: $(FILES) $(DOTFILES) $(CONFIGFILES)
+
+mpd:
+       ln -sfT $(APATH)/mpd ~/.config/mpd
+       mkdir -p ~/.local/share/mpd/playlists
+.PHONY: mpd
+
+ncmpcpp:
+       ln -sfT $(APATH)/ncmpcpp ~/.config/ncmpcpp
+       mkdir -p ~/.local/share/mpd/lyrics
+.PHONY: ncmpcpp
+
+$(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): 
+       @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/$@