etc/Makefile

59 lines
1.4 KiB
Makefile

FILES = bashrc bash_profile vimrc zshrc gitconfig screenrc commonshrc liquidpromptrc \
gnomerc gvimrc muttrc pentadactylrc mailcap latexmkrc ctags \
i3/config i3status.conf msmtprc spacemacs emacs.d mbsyncrc authinfo \
config/qutebrowser config/nvim/init.vim
.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
.PHONY: install-conf
install-conf: $(FILES) $(foreach i,$(FILES),install-file/$(i))
install-file/%: %
mkdir -p ~/.$(dir $<) && ln -Trsf $< ~/.$<
VIM_DIR = $(HOME)/.config/nvim
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
cp $(VIM_DIR)/autoload/plug.vim $(HOME)/.vim
mbsyncrc: mbsyncrc.m4
umask 077; m4 $< >$@
authinfo: authinfo.m4
umask 077; m4 $< >$@
endif
clean:
$(RM) gitconfig ctags
ctags: ctags.in
grep '^-' $< >$@
%: %.m4 base16.m4
m4 $< >$@