This repository was archived by the owner on Nov 30, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
53 lines (37 loc) · 1.53 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
SHELL = /bin/bash
DOTFILES_DIR := $(dir $(realpath $(firstword $(MAKEFILE_LIST))))
OS := $(shell bin/is-supported bin/is-macos macos linux)
PATH := $(DOTFILES_DIR)/bin:$(PATH)
export STOW_DIR := $(DOTFILES_DIR)
all: $(OS)
macos: sudo core-macos packages link
linux: link
core-macos: brew bash
stow-macos: brew
is-executable stow || brew install stow
stow-linux:
is-executable stow || apt-get -y install stow
sudo:
sudo -v
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
packages: brew-packages cask-apps python-packages
link: stow-$(OS)
for FILE in $$(\ls -A runcom && ls -A etc); do if [ -f $(HOME)/$$FILE -a ! -h $(HOME)/$$FILE ]; then mv -v $(HOME)/$$FILE{,.bak}; fi; done
stow -t $(HOME) runcom
stow -t $(HOME) etc
unlink: stow-$(OS)
stow --delete -t $(HOME) runcom
stow --delete -t $(HOME) etc
for FILE in $$(\ls -A runcom && ls -A etc); do if [ -f $(HOME)/$$FILE.bak ]; then mv -v $(HOME)/$$FILE.bak $(HOME)/$${FILE%%.bak}; fi; done
brew:
is-executable brew || curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install | ruby
bash: BASH=/usr/local/bin/bash
bash: SHELLS=/private/etc/shells
bash: brew
if ! grep -q $(BASH) $(SHELLS); then brew install bash bash-completion@2 pcre && sudo append $(BASH) $(SHELLS) && chsh -s $(BASH); fi
brew-packages: brew
brew bundle --no-lock --file=$(DOTFILES_DIR)/install/Brewfile
cask-apps: brew
brew bundle --no-lock --file=$(DOTFILES_DIR)/install/Caskfile
python-packages: brew-packages
pip3 install -r $(DOTFILES_DIR)/install/pipfile