-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
154 lines (121 loc) · 2.97 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
.POSIX:
.PHONY: all \
check \
check-lua \
check-prettier \
install \
install-brew \
install-git \
install-sh \
install-tmux \
install-vim \
install-work \
lint \
lint-bash \
lint-sh \
lint-vim
XDG_CACHE_HOME ?= $(HOME)/.cache
XDG_CONFIG_HOME ?= $(HOME)/.config
XDG_DATA_HOME ?= $(HOME)/.local/share
XDG_STATE_HOME ?= $(HOME)/.local/state
NAME ?= 'Dylan Pinn'
BINS = bin/git-remove-merged-local \
bin/git-stats-loc
all: git/config \
$(BINS)
check: check-lua \
check-prettier
check-lua:
sh check/lua.sh
check-prettier:
npm run format:check
format: format-bash \
format-lua \
format-prettier \
format-sh
format-bash:
sh format/bash.sh
format-lua:
sh format/lua.sh
format-prettier:
npm run format
format-sh:
sh format/sh.sh
git/config: git/config.m4
m4 \
--define=NAME=$(NAME) \
--define=EMAIL="$(EMAIL)" \
--define=SIGNING_KEY="$(SIGNING_KEY)" \
git/config.m4 > $@
# TODO: not 100% sold on this target name.
dump-brew:
brew bundle dump --force --describe --file=homebrew/$(PROFILE).Brewfile
install: install-bash \
install-bin \
install-git \
install-mise \
install-npm \
install-nvim \
install-tmux \
install-vim
install-bash: lint-bash install-sh
cp -p -- bash/bash_profile $(HOME)/.bash_profile
cp -p -- bash/bashrc $(HOME)/.bashrc
mkdir -p -- $(HOME)/.bashrc.d
cp -p -- bash/bashrc.d/* $(HOME)/.bashrc.d/
mkdir -p -- $(XDG_STATE_HOME)/bash
install-bin:
mkdir -p $(HOME)/.local/bin
cp -p -- $(BINS) $(HOME)/.local/bin/
install-git: git/config
mkdir -p -- $(XDG_CONFIG_HOME)/git
cp -p -- git/config $(XDG_CONFIG_HOME)/git/config
cp -p -- git/ignore $(XDG_CONFIG_HOME)/git/ignore
install-mise: install-bash
cp -p -- mise/bashrc.d/* $(HOME)/.bashrc.d/
install-npm:
mkdir -p -- $(XDG_CONFIG_HOME)/npm
cp -pR -- npm/npmrc $(XDG_CONFIG_HOME)/npm/npmrc
cp -p -- npm/profile.d/* $(HOME)/.profile.d/
install-nvim: lint-lua
mkdir -p -- $(XDG_CONFIG_HOME)/nvim
cp -pR -- nvim/ $(XDG_CONFIG_HOME)/nvim/
install-sh: lint-sh
cp -p -- sh/profile $(HOME)/.profile
mkdir -p -- $(HOME)/.profile.d/
cp -p -- sh/profile.d/* $(HOME)/.profile.d/
install-tmux:
mkdir -p -- $(XDG_CONFIG_HOME)/tmux
cp -p -- tmux/tmux.conf $(XDG_CONFIG_HOME)/tmux/tmux.conf
VIMDIR = $(HOME)/.vim
install-vim: lint-vim
mkdir -p -- $(VIMDIR)
mkdir -p -- $(XDG_STATE_HOME)/vim/{backup,swap,undo}
cp -p -- vim/vimrc $(VIMDIR)/vimrc
cp -pR -- vim/after \
vim/autoload \
vim/compiler \
vim/ftdetect \
vim/plugin \
$(VIMDIR)
install-work: install-bash install-sh
cp -p -- work/bashrc.d/* $(HOME)/.bashrc.d/
cp -p -- work/profile.d/* $(HOME)/.profile.d/
# TODO: add this to the install target when it runs only when files have changed.
install-brew:
cp -R -- homebrew/$(PROFILE).Brewfile $(HOME)/.Brewfile
brew bundle --global --no-lock --verbose
cp -p -- homebrew/profile.d/* $(HOME)/.profile.d/
lint: check\
lint-bash \
lint-lua \
lint-sh \
lint-vim
lint-bash:
sh lint/bash.sh
lint-lua: check-lua
sh lint/lua.sh
lint-sh:
sh lint/sh.sh
lint-vim:
sh lint/vim.sh