2019-04-14 07:26:21 +00:00
|
|
|
SRC_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
|
|
|
|
|
|
|
|
cmd_exist = $(shell (command -v $(1) 1>&2 >/dev/null && echo true || echo false) )
|
|
|
|
|
|
|
|
install: | init update
|
|
|
|
|
|
|
|
init: vim_init tmux_init
|
2019-04-16 00:00:14 +00:00
|
|
|
@ ln -svf $(SRC_DIR)/bin/post-merge $(SRC_DIR)/.git/hooks/post-merge
|
2019-04-14 07:26:21 +00:00
|
|
|
update: vim_update
|
|
|
|
|
|
|
|
tmux_init:
|
|
|
|
$(info => Setting up tmux)
|
|
|
|
@ [ $(call cmd_exist,'tmux') ] \
|
|
|
|
&& ! [ -e ~/.tmux.conf ] \
|
|
|
|
&& ln -svf $(SRC_DIR)/tmux/tmux.conf ~/.tmux.conf \
|
|
|
|
|| echo " ~/.tmux.conf already exist. Skipping."
|
|
|
|
|
|
|
|
vim_init:
|
|
|
|
@ $(MAKE) -C $(SRC_DIR)/vim init
|
|
|
|
vim_update:
|
|
|
|
@ $(MAKE) -C $(SRC_DIR)/vim update
|
|
|
|
|
|
|
|
.PHONY: install update init foo
|