X-Git-Url: https://git.rmz.io/dotfiles.git/blobdiff_plain/a06f433fb0135a5598c3b63d198af3792882032d..638342a08e62388aa223d6da5de0f40efab47056:/Makefile diff --git a/Makefile b/Makefile index a5116c4..48a4ccb 100644 --- a/Makefile +++ b/Makefile @@ -1,14 +1,30 @@ APATH := $(realpath .) RPATH := $(subst $(wildcard ~/),,$(APATH)) -EXCLUDES := Makefile -ALL := $(wildcard *) -FILES := $(filter-out $(EXCLUDES),$(ALL)) +FILES := +DOTFILES := bash* flexget vim* -.PHONY: install $(FILES) -install: $(FILES) +.PHONY: install $(FILES) $(DOTFILES) +install: $(FILES) $(DOTFILES) $(FILES): - cp -r ~/.$@ $@ - rm -r ~/.$@ + @if [[ -f ~/$@ || -d ~/$@ ]]; then \ + if [[ -d $@ ]]; then \ + cp -r ~/$@/* $@; \ + else \ + cp -r ~/$@ $@; \ + fi; \ + rm -r ~/$@; \ + fi; + ln -sf $(RPATH)/$@ ~/.$@ + +$(DOTFILES): + @if [[ -f ~/.$@ || -d ~/.$@ ]]; then \ + if [[ -d $@ ]]; then \ + cp -r ~/.$@/* $@; \ + else \ + cp -r ~/.$@ $@; \ + fi; \ + rm -r ~/.$@; \ + fi; ln -sf $(RPATH)/$@ ~/.$@