]> git.rmz.io Git - dotfiles.git/blobdiff - Makefile
Other changes at cadscan (with the ones I want to keep stripped)
[dotfiles.git] / Makefile
index a5116c4e341252ea80c2eb8bd7782c69472a5bfa..5e09a427432adc696de28efa7c49e76ac10f929a 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,14 +1,41 @@
 APATH := $(realpath .)
-RPATH := $(subst $(wildcard ~/),,$(APATH))
 
-EXCLUDES := Makefile 
-ALL := $(wildcard *)
-FILES := $(filter-out $(EXCLUDES),$(ALL))
+FILES := bin
+DOTFILES := conky* goobookrc msmtp* mutt profile tmux.conf weechat Xresources xprofile zprofile zshenv zshrc
+CONFIGFILES := aliases compton.conf git gnupg mimeo.conf mpd mpv ncmpcpp offlineimap ranger retroarch systemd vim xbindkeys xkb zsh
 
-.PHONY: install $(FILES)
-install: $(FILES)
+.PHONY: install $(FILES) $(DOTFILES) $(CONFIGFILES)
+install: $(FILES) $(DOTFILES) $(CONFIGFILES)
 
 $(FILES): 
-       cp -r ~/.$@ $@
-       rm -r ~/.$@
-       ln -sf $(RPATH)/$@ ~/.$@ 
+       @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/$@