2023-09-13 11:10:41 -05:00
|
|
|
export PATH := $(abspath bin/):${PATH}
|
|
|
|
|
|
|
|
# Dependency versions
|
|
|
|
LICENSEI_VERSION = 0.9.0
|
|
|
|
|
2015-01-26 20:19:22 -06:00
|
|
|
# generate runs `go generate` to build the dynamically generated
|
2018-10-18 11:27:48 -05:00
|
|
|
# source files, except the protobuf stubs which are built instead with
|
|
|
|
# "make protobuf".
|
2023-09-13 11:10:41 -05:00
|
|
|
.PHONY: generate
|
2019-10-17 15:17:23 -05:00
|
|
|
generate:
|
2020-09-23 15:57:36 -05:00
|
|
|
go generate ./...
|
2015-01-10 17:51:53 -06:00
|
|
|
|
2018-10-18 11:27:48 -05:00
|
|
|
# We separate the protobuf generation because most development tasks on
|
2023-09-21 04:53:02 -05:00
|
|
|
# OpenTofu do not involve changing protobuf files and protoc is not a
|
2018-10-18 11:27:48 -05:00
|
|
|
# go-gettable dependency and so getting it installed can be inconvenient.
|
|
|
|
#
|
2021-08-20 18:07:18 -05:00
|
|
|
# If you are working on changes to protobuf interfaces, run this Makefile
|
|
|
|
# target to be sure to regenerate all of the protobuf stubs using the expected
|
|
|
|
# versions of protoc and the protoc Go plugins.
|
2023-09-13 11:10:41 -05:00
|
|
|
.PHONY: protobuf
|
2018-10-18 11:27:48 -05:00
|
|
|
protobuf:
|
2021-08-20 18:07:18 -05:00
|
|
|
go run ./tools/protobuf-compile .
|
2018-10-18 11:27:48 -05:00
|
|
|
|
2023-09-13 11:10:41 -05:00
|
|
|
.PHONY: fmtcheck
|
2015-12-17 11:21:43 -06:00
|
|
|
fmtcheck:
|
2022-08-25 17:49:39 -05:00
|
|
|
"$(CURDIR)/scripts/gofmtcheck.sh"
|
2015-12-17 11:21:43 -06:00
|
|
|
|
2023-09-13 11:10:41 -05:00
|
|
|
.PHONY: importscheck
|
2022-07-19 04:14:28 -05:00
|
|
|
importscheck:
|
2022-08-25 17:49:39 -05:00
|
|
|
"$(CURDIR)/scripts/goimportscheck.sh"
|
2022-07-19 04:14:28 -05:00
|
|
|
|
2023-09-13 11:10:41 -05:00
|
|
|
.PHONY: staticcheck
|
2020-12-02 11:02:33 -06:00
|
|
|
staticcheck:
|
2022-08-25 17:49:39 -05:00
|
|
|
"$(CURDIR)/scripts/staticcheck.sh"
|
2020-12-02 11:02:33 -06:00
|
|
|
|
2023-09-13 11:10:41 -05:00
|
|
|
.PHONY: exhaustive
|
2021-09-24 14:02:30 -05:00
|
|
|
exhaustive:
|
2022-08-25 17:49:39 -05:00
|
|
|
"$(CURDIR)/scripts/exhaustive.sh"
|
2021-09-24 14:02:30 -05:00
|
|
|
|
2023-09-13 11:10:41 -05:00
|
|
|
# Run license check
|
|
|
|
.PHONY: license-check
|
|
|
|
license-check:
|
|
|
|
go mod vendor
|
2023-09-18 07:25:42 -05:00
|
|
|
licensei cache --debug
|
|
|
|
licensei check --debug
|
|
|
|
licensei header --debug
|
|
|
|
rm -rf vendor/
|
|
|
|
git diff --exit-code
|
2023-09-13 11:10:41 -05:00
|
|
|
|
|
|
|
# Install dependencies
|
|
|
|
deps: bin/licensei
|
|
|
|
deps:
|
|
|
|
|
|
|
|
bin/licensei: bin/licensei-${LICENSEI_VERSION}
|
|
|
|
@ln -sf licensei-${LICENSEI_VERSION} bin/licensei
|
|
|
|
bin/licensei-${LICENSEI_VERSION}:
|
|
|
|
@mkdir -p bin
|
|
|
|
curl -sfL https://git.io/licensei | bash -s v${LICENSEI_VERSION}
|
|
|
|
@mv bin/licensei $@
|
|
|
|
|
2017-02-17 17:31:20 -06:00
|
|
|
# disallow any parallelism (-j) for Make. This is necessary since some
|
|
|
|
# commands during the build process create temporary files that collide
|
|
|
|
# under parallel conditions.
|
|
|
|
.NOTPARALLEL:
|