2024-05-09 20:25:00 +00:00
|
|
|
TOOL_DIR = .tool
|
|
|
|
BINNY = $(TOOL_DIR)/binny
|
|
|
|
TASK = $(TOOL_DIR)/task
|
2020-07-06 10:59:55 +00:00
|
|
|
|
2024-05-09 20:25:00 +00:00
|
|
|
.DEFAULT_GOAL := make-default
|
2020-07-06 10:59:55 +00:00
|
|
|
|
2023-03-03 21:17:44 +00:00
|
|
|
## Bootstrapping targets #################################
|
2021-07-01 16:28:49 +00:00
|
|
|
|
2024-05-09 20:25:00 +00:00
|
|
|
# note: we need to assume that binny and task have not already been installed
|
|
|
|
$(BINNY):
|
|
|
|
@mkdir -p $(TOOL_DIR)
|
|
|
|
@curl -sSfL https://raw.githubusercontent.com/anchore/binny/main/install.sh | sh -s -- -b $(TOOL_DIR)
|
2021-07-01 16:28:49 +00:00
|
|
|
|
2024-05-09 20:25:00 +00:00
|
|
|
# note: we need to assume that binny and task have not already been installed
|
|
|
|
.PHONY: task
|
|
|
|
$(TASK) task: $(BINNY)
|
|
|
|
@$(BINNY) install task -q
|
2021-11-30 18:10:07 +00:00
|
|
|
|
2024-05-09 20:25:00 +00:00
|
|
|
.PHONY: ci-bootstrap-go
|
|
|
|
ci-bootstrap-go:
|
2021-11-30 18:10:07 +00:00
|
|
|
go mod download
|
|
|
|
|
2024-05-09 20:25:00 +00:00
|
|
|
# this is a bootstrapping catch-all, where if the target doesn't exist, we'll ensure the tools are installed and then try again
|
|
|
|
%:
|
|
|
|
make $(TASK)
|
|
|
|
$(TASK) $@
|
2023-03-03 21:17:44 +00:00
|
|
|
|
2024-05-09 20:25:00 +00:00
|
|
|
## Shim targets #################################
|
2023-03-03 21:17:44 +00:00
|
|
|
|
2024-05-09 20:25:00 +00:00
|
|
|
.PHONY: make-default
|
|
|
|
make-default: $(TASK)
|
|
|
|
@# run the default task in the taskfile
|
|
|
|
@$(TASK)
|
2023-03-03 21:17:44 +00:00
|
|
|
|
2024-05-09 20:25:00 +00:00
|
|
|
# for those of us that can't seem to kick the habit of typing `make ...` lets wrap the superior `task` tool
|
|
|
|
TASKS := $(shell bash -c "test -f $(TASK) && $(TASK) -l | grep '^\* ' | cut -d' ' -f2 | tr -d ':' | tr '\n' ' '" ) $(shell bash -c "test -f $(TASK) && $(TASK) -l | grep 'aliases:' | cut -d ':' -f 3 | tr '\n' ' ' | tr -d ','")
|
2023-03-03 21:17:44 +00:00
|
|
|
|
2024-05-09 20:25:00 +00:00
|
|
|
.PHONY: $(TASKS)
|
|
|
|
$(TASKS): $(TASK)
|
|
|
|
@$(TASK) $@
|
2022-02-11 19:24:25 +00:00
|
|
|
|
2024-05-09 20:25:00 +00:00
|
|
|
help: $(TASK)
|
|
|
|
@$(TASK) -l
|