-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
70 lines (54 loc) · 2.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
HOMEBREW_INSTALL_SCRIPT := /usr/bin/ruby -e "$$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
VUNDLE_URL := https://github.com/gmarik/Vundle.vim.git
VUNDLE_PATH := $(CURDIR)/vim/vim/bundle/Vundle.vim
RESET := \033[0m
RED := \033[0;31m
GREEN := \033[0;32m
BLUE := \033[0;34m
.PHONY: all basics shells vim vimvundle vimdotfiles vimplugins vimcompletion git gitdotfiles gituser brewbundle osx linux uninstall
all: basics shells vim git
basics:
# Install Xcode Command Line Tools if nonexistent
@xcode-select --print-path >/dev/null 2>&1 || xcode-select --install
# Install Homebrew if nonexistent
@hash brew 2>/dev/null || $(HOMEBREW_INSTALL_SCRIPT)
shells: $(wildcard shells/*)
@echo "Symlink $(GREEN)[$^]$(RESET) to $(GREEN)[$(addprefix ~/.,$(^F))]$(RESET)"
@$(foreach df, $(^F), ln -nfs $(CURDIR)/shells/$(df) ~/.$(df);)
vim: basics vimvundle vimdotfiles vimplugins
@echo "Install prerequisites for $(BLUE)$@$(RESET) via Homebrew"
@brew install ctags vim
vimvundle:
# Install Vundle.vim plugin manager if nonexistent
@[[ -d $(VUNDLE_PATH) ]] || git clone $(VUNDLE_URL) $(VUNDLE_PATH)
vimdotfiles: $(wildcard vim/*)
@echo "Symlink $(GREEN)[$^]$(RESET) to $(GREEN)[$(addprefix ~/.,$(^F))]$(RESET)"
@$(foreach df, $(^F), ln -nfs $(CURDIR)/vim/$(df) ~/.$(df);)
vimplugins: vimvundle vimdotfiles
# Install Vim plugins
@vim +PluginInstall +qall
vimcompletion: vim
@echo "Install prerequisites for $(BLUE)$@$(RESET) via Homebrew"
@brew install cmake
# Install YouCompleteMe with --clang-completer option
@~/.vim/bundle/YouCompleteMe/install.py --clang-completer
git: basics gitdotfiles gituser
@echo "Install prerequisites for $(BLUE)$@$(RESET) via Homebrew"
@brew install git
gitdotfiles: $(wildcard git/*)
@echo "Symlink $(GREEN)[$^]$(RESET) to $(GREEN)[$(addprefix ~/.,$(^F))]$(RESET)"
@$(foreach df, $(^F), ln -nfs $(CURDIR)/git/$(df) ~/.$(df);)
gituser:
# Set up user Git configuration
@$(CURDIR)/script/gituser
brewbundle: basics
# Install all Homebrew formulas and casks
@brew bundle
osx:
# Configure OS X
@$(CURDIR)/script/defaults
linux: shells vimvundle vimdotfiles vimplugins gitdotfiles gituser
@echo "Set up minimal configuration for Linux environment"
uninstall: $(wildcard shells/*) $(wildcard vim/*) $(wildcard git/*)
@echo "Unlink $(RED)[$^]$(RESET) from $(RED)[$(addprefix ~/.,$(^F))]$(RESET)"
@$(foreach df, $(^F), rm -rf ~/.$(df))