forked from opentofu/opentofu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
64 lines (53 loc) · 1.66 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
export PATH := $(abspath bin/):${PATH}
# Dependency versions
LICENSEI_VERSION = 0.9.0
# generate runs `go generate` to build the dynamically generated
# source files, except the protobuf stubs which are built instead with
# "make protobuf".
.PHONY: generate
generate:
go generate ./...
# We separate the protobuf generation because most development tasks on
# OpenTofu do not involve changing protobuf files and protoc is not a
# go-gettable dependency and so getting it installed can be inconvenient.
#
# 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.
.PHONY: protobuf
protobuf:
go run ./tools/protobuf-compile .
.PHONY: fmtcheck
fmtcheck:
"$(CURDIR)/scripts/gofmtcheck.sh"
.PHONY: importscheck
importscheck:
"$(CURDIR)/scripts/goimportscheck.sh"
.PHONY: staticcheck
staticcheck:
"$(CURDIR)/scripts/staticcheck.sh"
.PHONY: exhaustive
exhaustive:
"$(CURDIR)/scripts/exhaustive.sh"
# Run license check
.PHONY: license-check
license-check:
go mod vendor
licensei cache --debug
licensei check --debug
licensei header --debug
rm -rf vendor/
git diff --exit-code
# 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 $@
# 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: