dotfiles/makefile
James Patrick adbe85b7c1 Added post-merge hook to run update on merge.
This will case `make update` to run everytime there is a successful
merge. This will include everytime the is a non no-op merge. This *will
not run* if:

1. There is no changes.
2. There is a conflict in the merge.

Additionally the make install set will now sym link the post-merge hook.
2019-04-15 20:00:14 -04:00

24 lines
632 B
Makefile

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
@ ln -svf $(SRC_DIR)/bin/post-merge $(SRC_DIR)/.git/hooks/post-merge
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