X-Git-Url: https://git.rmz.io/dotfiles.git/blobdiff_plain/a06f433fb0135a5598c3b63d198af3792882032d..597f492caf7440699e8da0ae5bdef6499d3b2f2c:/Makefile diff --git a/Makefile b/Makefile index a5116c4..cfbb170 100644 --- a/Makefile +++ b/Makefile @@ -1,14 +1,42 @@ APATH := $(realpath .) RPATH := $(subst $(wildcard ~/),,$(APATH)) -EXCLUDES := Makefile -ALL := $(wildcard *) -FILES := $(filter-out $(EXCLUDES),$(ALL)) +FILES := bin +DOTFILES := aliases bash* conky* flexget git* vim* xbindkeysrc Xmodmap zsh* +CONFIGFILES := retroarch -.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 $(RPATH)/$@ ~/$@ + +$(DOTFILES): + @if [[ -e ~/.$@ && ! -L ~/.$@ ]]; then \ + if [[ -d .$@ ]]; then \ + cp -r ~/.$@/* $@; \ + else \ + cp -r ~/.$@ $@; \ + fi; \ + rm -r ~/.$@; \ + fi; + ln -sfT $(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 $(RPATH)/$@ ~/.config/$@