From: Samir Benmendil Date: Tue, 23 Oct 2012 18:13:35 +0000 (+0200) Subject: finish makefile X-Git-Url: https://git.rmz.io/dotfiles.git/commitdiff_plain/97997c722219be6a91f42bf7ed7882c4aa8f6b0c finish makefile --- diff --git a/Makefile b/Makefile index af701e0..1e63778 100644 --- a/Makefile +++ b/Makefile @@ -1,17 +1,20 @@ -.PHONY: install update +APATH := $(realpath .) +RPATH := $(subst $(wildcard ~/),,$(APATH)) -install: - cp -f bashrc ~/.bashrc - cp -f bash_aliases ~/.bash_aliases - cp -f bash_colors ~/.bash_colors - cp -f bash_logout ~/.bash_logout - cp -f flexget/config.yml ~/.flexget/config.yml - cp -f vimrc ~/.vimrc +EXCLUDES := Makefile +ALL := $(wildcard *) +FILES := $(filter-out $(EXCLUDES),$(ALL)) -update: - cp -f ~/.bashrc bashrc - cp -f ~/.bash_aliases bash_aliases - cp -f ~/.bash_colors bash_colors - cp -f ~/.bash_logout bash_logout - cp -f ~/.flexget/config.yml flexget/config.yml - cp -f ~/.vimrc vimrc + +test: + echo $(APATH) + echo $(FILES); + echo $(RPATH) + +.PHONY: install $(FILES) +install: $(FILES) + +$(FILES): + cp -r ~/.$@ $@ + rm -r ~/.$@ + ln -sf $(RPATH)/$@ ~/.$@