X-Git-Url: https://git.rmz.io/dotfiles.git/blobdiff_plain/bd78babfeb92083f4e5e153603397ea0ec64dd4c..refs/heads/cadscan:/Makefile diff --git a/Makefile b/Makefile index 51eeb96..5e09a42 100644 --- a/Makefile +++ b/Makefile @@ -1,30 +1,41 @@ APATH := $(realpath .) -RPATH := $(subst $(wildcard ~/),,$(APATH)) -FILES := -DOTFILES := bash* flexget vimrc +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) $(DOTFILES) -install: $(FILES) $(DOTFILES) +.PHONY: install $(FILES) $(DOTFILES) $(CONFIGFILES) +install: $(FILES) $(DOTFILES) $(CONFIGFILES) $(FILES): - if [[ -f ~/$@ || -d ~/$@ ]]; then \ - if [[ -d $@ ]]; then \ - cp -rf ~/$@/* $@; \ - else \ - cp -rf ~/$@ $@; \ - fi; \ - rm -r ~/$@; \ + @if [[ -e ~/$@ && ! -L ~/$@ ]]; then \ + if [[ -d $@ ]]; then \ + cp -r ~/$@/* $@; \ + else \ + cp -r ~/$@ $@; \ + fi; \ + rm -r ~/$@; \ fi; - ln -sf $(RPATH)/$@ ~/.$@ + ln -sfT $(APATH)/$@ ~/$@ $(DOTFILES): - if [[ -f ~/.$@ || -d ~/.$@ ]]; then \ - if [[ -d $@ ]]; then \ - cp -rf ~/.$@/* $@; \ - else \ - cp -rf ~/.$@ $@; \ - fi; \ - rm -r ~/.$@; \ + @if [[ -e ~/.$@ && ! -L ~/.$@ ]]; then \ + if [[ -d .$@ ]]; then \ + cp -r ~/.$@/* $@; \ + else \ + cp -r ~/.$@ $@; \ + fi; \ + rm -r ~/.$@; \ fi; - ln -sf $(RPATH)/$@ ~/.$@ + 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/$@