]> git.rmz.io Git - dotfiles.git/blobdiff - Makefile
ncmpcpp: add config
[dotfiles.git] / Makefile
index 1e63778452555e8a3008f374d82607a0d1381f93..790826f78bc9b02e6787ec9fd2cab786821f8247 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,20 +1,41 @@
 APATH := $(realpath .)
-RPATH := $(subst $(wildcard ~/),,$(APATH))
 
-EXCLUDES := Makefile 
-ALL := $(wildcard *)
-FILES := $(filter-out $(EXCLUDES),$(ALL))
+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) $(CONFIGFILES)
+install: $(FILES) $(DOTFILES) $(CONFIGFILES)
 
-test:
-       echo $(APATH)
-       echo $(FILES);
-       echo $(RPATH)
+$(FILES): 
+       @if [[ -e ~/$@ && ! -L ~/$@ ]]; then \
+           if [[ -d $@ ]]; then \
+             cp -r ~/$@/* $@; \
+           else \
+             cp -r ~/$@ $@; \
+           fi; \
+           rm -r ~/$@; \
+       fi; 
+       ln -sfT $(APATH)/$@ ~/$@
 
-.PHONY: install $(FILES)
-install: $(FILES)
+$(DOTFILES): 
+       @if [[ -e ~/.$@ && ! -L ~/.$@ ]]; then \
+           if [[ -d .$@ ]]; then \
+             cp -r ~/.$@/* $@; \
+           else \
+             cp -r ~/.$@ $@; \
+           fi; \
+           rm -r ~/.$@; \
+       fi; 
+       ln -sfT $(APATH)/$@ ~/.$@
 
-$(FILES): 
-       cp -r ~/.$@ $@
-       rm -r ~/.$@
-       ln -sf $(RPATH)/$@ ~/.$@ 
+$(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/$@