-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
33 lines (26 loc) · 966 Bytes
/
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
# Support passing additional arguments to subcommands like `make shellcheck .bashrc`.
args = $(filter-out $@,$(MAKECMDGOALS))
.DEFAULT_GOAL := all
.PHONY: all ## Run all the checks
all:
lint
# Using .PHONY to avoid conflicts with files named the same as the target
# E.g., `shellcheck` exists in both filesystem and in the commands
.PHONY: lint ## Lint all the scripts in the codebase
lint:
lint-shell
.PHONY: lint-shell ## Run shellcheck on relevants scripts
lint-shell:
shellcheck $(args) || ./bin/.local/bin/*
.PHONY: activate ## Link all of the local repo files to the system
activate:
stow -vt ~ $(args)
.PHONY: help ## Print this help
help:
@echo "COMMANDS"
@echo
@grep -E '^\.PHONY: [a-zA-Z_-]+ .*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = "(: |##)"}; {printf " %-15s %s\n", $$2, $$3}'
# Wildcard target to support passing additional arguments to commands.
# This is required to ensure `make shellcheck .bashrc` does what you expect.
%:
@: