X-Git-Url: https://git.rmz.io/dotfiles.git/blobdiff_plain/58777dce33c8872a464c857e1afba7a417c08b61..refs/heads/cadscan:/Makefile diff --git a/Makefile b/Makefile index 91cc601..5e09a42 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,41 @@ -.PHONY: install +APATH := $(realpath .) -install: - cp -f vimrc ~/.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 -update: - cp -f ~/.vimrc vimrc +.PHONY: install $(FILES) $(DOTFILES) $(CONFIGFILES) +install: $(FILES) $(DOTFILES) $(CONFIGFILES) + +$(FILES): + @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/$@