-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
77 lines (55 loc) · 1.8 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
71
72
73
74
75
76
77
SHELL = /bin/bash
DOTFILES_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
export PATH := $(DOTFILES_DIR)/bin:/opt/homebrew/bin:$(PATH)
OS := $(shell bin/is-supported bin/is-macos macos linux)
SHELL := env PATH=$(PATH) /bin/bash
NEW_SHELL := fish
export XDG_CONFIG_HOME = $(HOME)/.config
export STOW_DIR = $(DOTFILES_DIR)
export ACCEPT_EULA=Y
.PHONY: test
all: $(OS)
macos: core-macos packages-macos link post-macos
linux: core-linux packages-linux link post-linux
core-macos: ;
core-linux:
apt-get update
apt-get upgrade -y
apt-get dist-upgrade -f
packages-macos: brew-packages cask-apps
packages-linux: ;
link: stow-$(OS)
mkdir -p $(XDG_CONFIG_HOME)
stow -t $(XDG_CONFIG_HOME) config
unlink: stow-$(OS)
stow --delete -t $(XDG_CONFIG_HOME) config
post-macos: setup-macos new-shell gcloud
post-linux: ;
brew:
is-executable brew || bash -c "$$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
stow-macos: brew
is-executable stow || brew install stow
stow-linux: core-linux
is-executable stow || apt-get -y install stow
brew-packages: brew
brew analytics off
brew bundle --file=$(DOTFILES_DIR)/install/homebrew/Brewfile
cask-apps: brew
brew bundle --file=$(DOTFILES_DIR)/install/homebrew/Caskfile || true
brew bundle --file=$(DOTFILES_DIR)/install/homebrew/Tapfile || true
./install/macos/java.sh || true
defaults write org.hammerspoon.Hammerspoon MJConfigFile "~/.config/hammerspoon/init.lua"
for EXT in $$(cat install/vscodium/extensions); do code --install-extension $$EXT; done
setup-macos:
./install/macos/setup.sh || true
./install/macos/dock.sh || true
new-shell:
if [ -z "$${GITHUB_ACTION+x}" ]; then \
./bin/set-shell $(NEW_SHELL); \
fi
gcloud:
if [ -z "$${GITHUB_ACTION+x}" ]; then \
./install/gcloud/setup.sh; \
fi
test:
bats test