-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
27 lines (20 loc) · 875 Bytes
/
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
DOTPATH := $(realpath $(dir $(lastword $(MAKEFILE_LIST))))
CANDIDATES := $(wildcard .??*)
EXCLUSIONS := .DS_Store .git
DOTFILES := $(filter-out $(EXCLUSIONS), $(CANDIDATES))
.DEFAULT_GOAL := help
.PHONY: help
list: ## Show dotfiles in this repository
@$(foreach val, $(DOTFILES), ls -dF $(val);)
init: ## Setup the environment
@$(foreach val, $(wildcard ./setup/*.sh), DOTPATH=${DOTPATH} bash $(val);)
deploy: ## Create symlinks to your home directory
@$(foreach val, $(DOTFILES), ln -sfnv $(abspath $(val)) $(HOME)/$(val);)
update: ## Fetch changes for this repository
git pull origin master
clean: ## Remove files this created
@-$(foreach val, $(DOTFILES), rm -vrf $(HOME)/$(val);)
help: ## Show all the targets
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) \
| sort \
| awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'