From 1d74e879990e3cf71450ac799aa4c495229a791b Mon Sep 17 00:00:00 2001 From: Gabriel Ebner Date: Sun, 20 Sep 2015 08:36:24 +0200 Subject: [PATCH] makefile: use symlinks. --- Makefile | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 7ef126e..b78a5c3 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,6 @@ FILES = bashrc vimrc zshrc gitconfig screenrc commonshrc \ gnomerc gvimrc muttrc pentadactylrc mailcap latexmkrc ctags \ - i3/config i3status.conf -FILES2 = msmtprc + i3/config i3status.conf msmtprc spacemacs emacs.d .PHONY: install clean check @@ -25,14 +24,12 @@ install-vim-plug: else -install-conf: $(FILES) $(FILES2) - for i in $(FILES); do install -Dm0644 $$i ~/.$$i; done - for i in $(FILES2); do install -Dm0600 $$i ~/.$$i; done - ln -sf $(PWD)/spacemacs ~/.spacemacs - test -d ~/.emacs.d || ln -s $(PWD)/emacs.d ~/.emacs.d +.PHONY: install-conf -check: $(FILES) - for i in $(FILES); do diff -u ~/.$$i $$i; done +install-conf: $(foreach i,$(FILES),install-file/$(i)) + +install-file/%: % + mkdir -p ~/.$(dir $<) && ln -Trsf $< ~/.$< VIM_DIR = $(HOME)/.vim