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