dotfiles/makefile

34 lines
1018 B
Makefile
Raw Normal View History

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
2019-04-20 04:15:00 +00:00
init: vim_init tmux_init ssh_init waybar_init
@ ln -svf $(SRC_DIR)/bin/post-merge $(SRC_DIR)/.git/hooks/post-merge
update: vim_update
ssh_init:
$(info => Setting up ssh config)
@ ! [ -e ~/.ssh/config ] \
&& ln -svf $(SRC_DIR)/ssh/config ~/.ssh/config \
|| echo " ~/.ssh/config already exist. Skipping."
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."
2019-04-20 04:15:00 +00:00
waybar_init:
@ [ $(call cmd_exist,'waybar') ] \
&& ! [ -e ~/.config/waybar ] \
&& ln -svf $(SRC_DIR)/waybar ~/.config/waybar \
|| echo " ~/.waybar.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