]> git.rmz.io Git - dotfiles.git/blobdiff - Makefile
offlineimap: sync labels and switch to daemon mode
[dotfiles.git] / Makefile
index 8f85fd5d2e2a1b6cf9fa8b4ffe7f2742624e26a4..03446499bed398dc56fe17c2266133b9bfa0eceb 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,9 +1,41 @@
-.PHONY: install
+APATH := $(realpath .)
 
-install:
-       cp -f vimrc ~/.vimrc
-       cp -f flexget/config.yml ~/.flexget/config.yml
+FILES := bin
+DOTFILES := conky* git* goobookrc msmtp* mutt ncmpcpp profile weechat xbindkeysrc Xresources xprofile zprofile zshrc
+CONFIGFILES := aliases compton.conf git mimeo.conf mpd offlineimap ranger retroarch vim xkb zsh
 
-update:
-       cp -f ~/.vimrc vimrc
-       cp -f ~/.flexget/config.yml flexget/config.yml 
+.PHONY: install $(FILES) $(DOTFILES) $(CONFIGFILES)
+install: $(FILES) $(DOTFILES) $(CONFIGFILES)
+
+$(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/$@