-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
44 lines (33 loc) · 1.37 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
DOTPATH := $(shell cd $(dir $(lastword $(MAKEFILE_LIST))); pwd)
HOMEBREW_PREFIX :=
SUDO := 0
FULL_INSTALL := 0
SHELL := /bin/zsh
.PHONY: all list deploy init update install test clean help
all: install
deploy: ## Create symlink to home directory
@DOTPATH=$(DOTPATH) bash $(DOTPATH)/deploy/main.sh
init: ## Setup environment settings
HOMEBREW_PREFIX=$(HOMEBREW_PREFIX) SUDO=$(SUDO) FULL_INSTALL=$(FULL_INSTALL) \
bash $(DOTPATH)/init/main.sh
update: ## Fetch changes for this repo
git pull origin main
upgrade: ## Upgrade installed packages
brew update && brew upgrade && brew cleanup
(type pipx &> /dev/null) && pipx upgrade-all
pip3 install -U pip
pkgs="$$(pip3 list --user -o --disable-pip-version-check | tail -n +3 | awk '{ print $$1 }')"; \
[[ -n $$pkgs ]] && pip3 install --user -U $$pkgs || true
(type zinit &> /dev/null) && zinit update --all || true
install: update init deploy ## Run make update, init, deploy
zsh -l -c 'exit'
test: ## Test if expected tools are installed
zsh -i $(DOTPATH)/test/main.zsh
# clean: ## Remove the dot files and this repo
# @echo 'Remove dot files in your home directory...'
# @-$(foreach val, $(DOTFILES), rm -vrf $(HOME)/$(val);)
# -rm -rf $(DOTPATH)
help: ## Self-documented Makefile
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) \
| sort \
| awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-15s\033[0m=> %s\n", $$1, $$2}'