-
-
Notifications
You must be signed in to change notification settings - Fork 98
/
Makefile
36 lines (28 loc) · 1.23 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
DOTPATH := $(realpath $(dir $(lastword $(MAKEFILE_LIST))))
CANDIDATES := $(wildcard .??*) bin
EXCLUSIONS := .DS_Store .git .gitmodules .travis.yml
DOTFILES := $(filter-out $(EXCLUSIONS), $(CANDIDATES))
.DEFAULT_GOAL := help
all: afx brew install
afx: ## Install babarot/afx
@curl -sL https://raw.githubusercontent.com/babarot/afx/HEAD/hack/install | sh
@echo 'Done. Run "afx install" next.'
brew: ## Install brew and run brew bundle
@sh ./etc/scripts/brew.sh
@brew bundle
@echo 'Done. For saving your brew packages added newly, run "brew bundle dump".'
list: ## Show dot files in this repo
@$(foreach val, $(DOTFILES), /bin/ls -dF $(val);)
install: ## Create symlink to home directory
@echo 'Copyright (c) 2013-2015 BABAROT All Rights Reserved.'
@echo '==> Start to link dotfiles to home directory.'
@echo ''
@$(foreach val, $(DOTFILES), ln -sfnv $(abspath $(val)) $(HOME)/$(val);)
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}'