etc/Makefile
2015-02-09 14:00:14 +01:00

51 lines
1.2 KiB
Makefile

FILES = bashrc vimrc zshrc emacs.el gitconfig screenrc commonshrc \
gnomerc gvimrc muttrc pentadactylrc mailcap latexmkrc ctags
FILES2 = msmtprc
.PHONY: install clean check
install: install-conf install-vim-plug
ifeq ($(OS),Windows_NT)
HOME = $(HOMEDRIVE)$(HOMEPATH)
install-conf: $(FILES) $(FILES2)
cp gitconfig $(HOME)\.gitconfig
cp vimrc $(HOME)\_vimrc
cp gvimrc $(HOME)\_gvimrc
VIM_DIR = $(HOME)\vimfiles
install-vim-plug:
test -d $(VIM_DIR)\autoload || mkdir $(VIM_DIR)\autoload
test -f $(VIM_DIR)/autoload/plug.vim || curl -k -fLo $(VIM_DIR)/autoload/plug.vim \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
else
install-conf: $(FILES) $(FILES2)
for i in $(FILES); do install -m0644 $$i ~/.$$i; done
for i in $(FILES2); do install -m0600 $$i ~/.$$i; done
check: $(FILES)
for i in $(FILES); do diff -u ~/.$$i $$i; done
VIM_DIR = $(HOME)/.vim
install-vim-plug:
mkdir -p $(VIM_DIR)/autoload
test -f $(VIM_DIR)/autoload/plug.vim || curl -fLo $(VIM_DIR)/autoload/plug.vim \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
endif
clean:
$(RM) gitconfig ctags
ctags: ctags.in
grep '^-' $< >$@
%: %.m4
m4 $< >$@