/
Makefile
57 lines (48 loc) · 1.38 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
SHELL := /bin/bash
OUTPUT_FORMAT = $(shell if [ "${GITHUB_ACTIONS}" == "true" ]; then echo "github"; else echo ""; fi)
GOBIN ?= $(shell go env GOPATH)/bin
.PHONY: help
help: ## Shows all targets and help from the Makefile (this message).
@echo "root-signing Makefile"
@echo "Usage: make [COMMAND]"
@echo ""
@grep --no-filename -E '^([/a-z.A-Z0-9_%-]+:.*?|)##' $(MAKEFILE_LIST) | \
awk 'BEGIN {FS = "(:.*?|)## ?"}; { \
if (length($$1) > 0) { \
printf " \033[36m%-20s\033[0m %s\n", $$1, $$2; \
} else { \
if (length($$2) > 0) { \
printf "%s\n", $$2; \
} \
} \
}'
## Linters
#####################################################################
lint: ## Run all linters.
lint: golangci-lint yamllint
golangci-lint: ## Runs the golangci-lint linter.
@set -e;\
extraargs=""; \
if [ "$(OUTPUT_FORMAT)" == "github" ]; then \
extraargs="--out-format github-actions"; \
fi; \
$(GOBIN)/golangci-lint run -c .golangci.yml ./... $$extraargs
yamllint: ## Runs the yamllint linter.
@set -e;\
extraargs=""; \
if [ "$(OUTPUT_FORMAT)" == "github" ]; then \
extraargs="-f github"; \
fi; \
yamllint -c .yamllint.yaml . $$extraargs
.PHONY: keygen
keygen:
@go build -tags=pivkey -o $@ ./tests/keygen
.PHONY: tuf
tuf:
@go build -tags=pivkey -o $@ ./cmd/tuf
.PHONY: verify
verify:
@go build -o verify ./cmd/verify
.PHONY: test
test:
@go test -tags=pivkey ./...