From 4b06eb26103a8f0840915532fdf411ef82e9ad24 Mon Sep 17 00:00:00 2001 From: Samir Benmendil Date: Sat, 27 Oct 2012 07:21:59 +0200 Subject: [PATCH] ignore links in MAkefile --- Makefile | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/Makefile b/Makefile index 48a4ccb..1c5af2e 100644 --- a/Makefile +++ b/Makefile @@ -1,30 +1,30 @@ APATH := $(realpath .) RPATH := $(subst $(wildcard ~/),,$(APATH)) -FILES := +FILES := bin DOTFILES := bash* flexget vim* .PHONY: install $(FILES) $(DOTFILES) install: $(FILES) $(DOTFILES) $(FILES): - @if [[ -f ~/$@ || -d ~/$@ ]]; then \ - if [[ -d $@ ]]; then \ - cp -r ~/$@/* $@; \ - else \ - cp -r ~/$@ $@; \ - fi; \ - rm -r ~/$@; \ + @if [[ -e ~/$@ && ! -L ~/$@ ]]; then \ + if [[ -d $@ ]]; then \ + cp -r ~/$@/* $@; \ + else \ + cp -r ~/$@ $@; \ + fi; \ + rm -r ~/$@; \ fi; - ln -sf $(RPATH)/$@ ~/.$@ + ln -sf $(RPATH)/$@ ~/$@ $(DOTFILES): - @if [[ -f ~/.$@ || -d ~/.$@ ]]; then \ - if [[ -d $@ ]]; then \ - cp -r ~/.$@/* $@; \ - else \ - cp -r ~/.$@ $@; \ - fi; \ - rm -r ~/.$@; \ + @if [[ -e ~/.$@ && ! -L ~/.$@ ]]; then \ + if [[ -d .$@ ]]; then \ + cp -r ~/.$@/* $@; \ + else \ + cp -r ~/.$@ $@; \ + fi; \ + rm -r ~/.$@; \ fi; - ln -sf $(RPATH)/$@ ~/.$@ + ln -sf $(RPATH)/$@ ~/.$@ -- 2.48.1