-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
106 lines (81 loc) · 3.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
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
.PHONY: all test clean
.DEFAULT_GOAL := help
MAKEFLAGS += --always-make
AQUA_INSTALLER_HASH := fb4b3b7d026e5aba1fc478c268e8fbd653e01404c8a8c6284fdba88ae62eda6a
RULE_AND_DESC_REGEX := ^[%a-zA-Z_-]+:.*?## .*$$
EXTRA_COMMENT_REGEX := ^## .* ##$$
# INFO: 参考サイト - https://postd.cc/auto-documented-makefile/
help: ## subcommand list and description.
@grep -E -e $(RULE_AND_DESC_REGEX) -e $(EXTRA_COMMENT_REGEX) $(MAKEFILE_LIST) \
| ./scripts/help.awk | less -R
help-fzf: ## Search for fzf and run the target rule
@grep -E -e $(RULE_AND_DESC_REGEX) $(MAKEFILE_LIST) \
| ./scripts/help.awk \
| fzf --ansi \
| cut -d ' ' -f1 \
| xargs -I{} make {}
## Neovim Tools ##
nvim-build: ## building neovim head.
@./scripts/nvim_build.sh
nvim-%: ## download neovim at version %(nightly|stable) build.
@./scripts/nvim_dl.sh ${@:nvim-%=%}
nvim-bench: ## neovim bench mark with vim-startuptime used.
-@vim-startuptime -vimpath nvim -count 100 | head -6
## Vim Tools ##
vim-build: ## building vim head.
@./scripts/vim_build.sh
## Arch Linux System Package Management ##
arch_iso: ## Download Arch Linux iso image at latest, and verification.
@./scripts/arch_iso.sh
pkglist: ## Update Arch Linux package list.
@./scripts/update_pkglist.sh
## vi-sual studio code... ##
vscode-setup: ## install extensions and expand settings.json for mac or linux.
@./scripts/vscode-setup.sh
vscode-ext: ## update installed vscode extensions list.
@code --list-extensions | tee ${HOME}/dotfiles/vscode/extensions.txt
vscode-byebye: ## Uninstall VSCode extensions and unlink settings.json
@./scripts/vscode-byebye.sh
## Utility Commands ##
true-color: ## 24-bit-color.sh
@curl -s \
https://gist.githubusercontent.com/lifepillar/09a44b8cf0f9397465614e622979107f/raw/24-bit-color.sh \
| bash
@./scripts/termcolors
path: ## List up for $PATH
@printenv \
| rg '^PATH' \
| sed -e 's/PATH=//' \
| sed -e 's/:/\n/g'
zsh-bench: ## zsh bench mark with hyperfine used.
@hyperfine -w 5 -r 100 'zsh -i -c exit'
repolist: ## Update ghq management of repository list.
@ghq list > ./document/repolist.txt
repoget: ## Get and update ghq management repositories.
@cat ./document/repolist.txt | ghq get -p -u --parallel
work_repolist: ## Update ghq management of repository list.
@./scripts/work_repolist.sh view
work_repoget: ## Get and update ghq management repositories.
@./scripts/work_repolist.sh
## NixOS utility commands ##
nixos-%: ## nixos-rebuild switch --flake ".#"%(laptop | desktop)
@sudo nixos-rebuild switch --flake ".#"${@:nixos-%=%}
nix-home-%: ## nix run "nixpkgs#home-manager" -- switch --flake ".#"%(linux | macx64)
@nix run "nixpkgs#home-manager" -- -b hm_backup switch --flake ".#"${@:nix-home-%=%}
nix-gc: ## nix-collect-garbage -d
@nix-collect-garbage -d
## Environment Setup Tools ##
nix-install: ## Install nix.
@curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install
symlink: ## expand symlinks
@./scripts/expand_symlink.sh
mkdir: ## make direcotries of required
@mkdir -p ${HOME}/.local/bin
@mkdir -p ${HOME}/.local/dotfiles
@mkdir -p ${HOME}/.config
@mkdir -p ${HOME}/.cache
init: ## expand config files. ※WARNING: Execute when Initial setup only!!
@make mkdir
@make symlink
@make aqua-install
@./scripts/setup.sh