This repository was archived by the owner on Jan 2, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
52 lines (41 loc) · 1.8 KB
/
Makefile
File metadata and controls
52 lines (41 loc) · 1.8 KB
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
45
46
47
48
49
50
51
# __ __ _ __ _ _
# | \/ | __ _| | _____ / _(_) | ___
# | |\/| |/ _` | |/ / _ \ |_| | |/ _ \
# | | | | (_| | < __/ _| | | __/
# |_| |_|\__,_|_|\_\___|_| |_|_|\___|
#
#
DOTPATH := $(realpath $(dir $(lastword $(MAKEFILE_LIST))))
DIRECTORIES := .vim .vim/syntax .cache .cache/shell .fonts bin
CANDIDATES := $(shell find .* -maxdepth 0 -type f) $(foreach val, $(DIRECTORIES), $(shell test -d $(abspath $(val)) && find $(val) -maxdepth 1 -type f -o -type l))
EXCLUSIONS := .DS_Store .git .gitmodules .travis.yml $(wildcard .*.swp)
DOTFILES := $(filter-out $(EXCLUSIONS), $(CANDIDATES))
# same as 'all: help'
.DEFAULT_GOAL := help
.PHONY: all list deploy init update install clean help test
list: ## Show dot files in this repo
@$(foreach val, $(DOTFILES), ls -dF $(val);)
deploy: ## Create symlink to home directory
@echo '==> Start to deploy dotfiles to home directory.'
@echo ''
@$(foreach val, $(DIRECTORIES), test ! -d $(HOME)/$(val) && mkdir -v $(HOME)/$(val); :;)
@$(foreach val, $(DOTFILES), ln -sfnv $(abspath $(val)) $(HOME)/$(val);)
init: ## Setup environment settings
@DOTPATH=$(DOTPATH) bash $(DOTPATH)/etc/init/initialize
update: ## Fetch changes for this repo
@git pull origin master
@git submodule init
@git submodule update
@git submodule foreach git pull origin master
install: update deploy init ## Run make update, deploy, init
@exec $$SHELL
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%-30s\033[0m %s\n", $$1, $$2}'
test: ## Execute serverspec
@cd $(DOTPATH)/etc && bundle && rake spec:localhost