]> git.rmz.io Git - dotfiles.git/blobdiff - Makefile
mv bash_aliases, more zsh settings
[dotfiles.git] / Makefile
index 91cc601f9ac1f1c01dc3fd83b250ae5067f57cdd..1f63f7cde52674dbd779d39e5a8542b9fb88fe43 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,30 @@
-.PHONY: install
+APATH := $(realpath .)
+RPATH := $(subst $(wildcard ~/),,$(APATH))
 
-install:
-       cp -f vimrc ~/.vimrc
+FILES := bin
+DOTFILES := aliasesrc bash* flexget vim* zsh*
 
-update:
-       cp -f ~/.vimrc vimrc
+.PHONY: install $(FILES) $(DOTFILES)
+install: $(FILES) $(DOTFILES)
+
+$(FILES): 
+       @if [[ -e ~/$@ && ! -L ~/$@ ]]; then \
+           if [[ -d $@ ]]; then \
+             cp -r ~/$@/* $@; \
+           else \
+             cp -r ~/$@ $@; \
+           fi; \
+           rm -r ~/$@; \
+       fi; 
+       ln -sfT $(RPATH)/$@ ~/$@
+
+$(DOTFILES): 
+       @if [[ -e ~/.$@ && ! -L ~/.$@ ]]; then \
+           if [[ -d .$@ ]]; then \
+             cp -r ~/.$@/* $@; \
+           else \
+             cp -r ~/.$@ $@; \
+           fi; \
+           rm -r ~/.$@; \
+       fi; 
+       ln -sfT $(RPATH)/$@ ~/.$@