]> git.rmz.io Git - dotfiles.git/blobdiff - Makefile
ncmpcpp: add config
[dotfiles.git] / Makefile
index 51eeb965237744da3386393532590225108e3a0a..790826f78bc9b02e6787ec9fd2cab786821f8247 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,30 +1,41 @@
 APATH := $(realpath .)
-RPATH := $(subst $(wildcard ~/),,$(APATH))
 
-FILES :=
-DOTFILES := bash* flexget vimrc
+FILES := bin
+DOTFILES := aliases bash* conky* flexget git* goobookrc msmtp* mutt ncmpcpp offlineimap* vim* weechat xbindkeysrc Xmodmap Xresources xprofile zsh*
+CONFIGFILES := retroarch compton.conf mimeo.conf
 
-.PHONY: install $(FILES) $(DOTFILES)
-install: $(FILES) $(DOTFILES)
+.PHONY: install $(FILES) $(DOTFILES) $(CONFIGFILES)
+install: $(FILES) $(DOTFILES) $(CONFIGFILES)
 
 $(FILES): 
-       if [[ -f ~/$@ || -d ~/$@ ]]; then \
-         if [[ -d $@ ]]; then \
-           cp -rf ~/$@/* $@; \
-         else \
-           cp -rf ~/$@ $@; \
-         fi; \
-         rm -r ~/$@; \
+       @if [[ -e ~/$@ && ! -L ~/$@ ]]; then \
+           if [[ -d $@ ]]; then \
+             cp -r ~/$@/* $@; \
+           else \
+             cp -r ~/$@ $@; \
+           fi; \
+           rm -r ~/$@; \
        fi; 
-       ln -sf $(RPATH)/$@ ~/.$@ 
+       ln -sfT $(APATH)/$@ ~/$@
 
 $(DOTFILES): 
-       if [[ -f ~/.$@ || -d ~/.$@ ]]; then \
-         if [[ -d $@ ]]; then \
-           cp -rf ~/.$@/* $@; \
-         else \
-           cp -rf ~/.$@ $@; \
-         fi; \
-         rm -r ~/.$@; \
+       @if [[ -e ~/.$@ && ! -L ~/.$@ ]]; then \
+           if [[ -d .$@ ]]; then \
+             cp -r ~/.$@/* $@; \
+           else \
+             cp -r ~/.$@ $@; \
+           fi; \
+           rm -r ~/.$@; \
        fi; 
-       ln -sf $(RPATH)/$@ ~/.$@ 
+       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/$@