dotfiles/zsh/makefile

43 lines
1.1 KiB
Makefile
Raw Normal View History

# -*- mode: makefile-gmake; -*-
SRC := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
include ../lib/shared.mk
ZSH_DIR := ~/.zsh
2024-07-10 19:31:17 +00:00
ZGENOM_DIR := ~/.zgenom
2021-11-28 21:33:24 +00:00
up: init
2024-07-10 19:31:17 +00:00
if [ ! -d $(ZGENOM_DIR) ] ; then
$(report) error "$(ZGENOM_DIR) doesn't exist - run init first."
2021-11-28 21:33:24 +00:00
return
fi
2024-07-10 19:31:17 +00:00
source $(ZGENOM_DIR)/zgenom.zsh
2021-11-28 21:33:24 +00:00
down:
2024-07-10 19:31:17 +00:00
rm -rf $(ZGENOM_DIR) ; $(report) "deleting zgenom dir"
2021-11-28 21:33:24 +00:00
$(rm_link) ~/.zprofile
$(rm_link) ~/.zlogin
$(rm_link) ~/.zshrc
$(rm_link) ~/.zsh
$(rm_link) ~/.zshenv
$(rm_link) ~/.zlogout
init:
$(info => Setting up zsh)
2024-07-10 19:31:17 +00:00
$(MAKE) -C $(SRC) init_zgenom
$(mk_link) $(SRC) ~/.zsh
$(mk_link) $(ZSH_DIR)/zshrc ~/.zshrc
$(mk_link) $(ZSH_DIR)/zlogin ~/.zlogin
$(mk_link) $(ZSH_DIR)/zprofile ~/.zprofile
$(mk_link) $(ZSH_DIR)/zshenv ~/.zshenv
2019-09-18 01:12:24 +00:00
$(mk_link) $(ZSH_DIR)/zlogout ~/.zlogout
chmod 700 $(ZSH_DIR)/cache \
; $(report) "updating cache permissions"
2024-07-10 19:31:17 +00:00
init_zgenom:
if [ -e $(ZGENOM_DIR) ] ; then
$(report) debug "zgenom already installed. Skipping"
2021-05-11 19:11:30 +00:00
return
fi
2024-07-10 19:31:17 +00:00
git clone https://github.com/jandamm/zgenom.git "${HOME}/.zgenom" \
; $(report) "zgenom installed"