-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
116 lines (91 loc) · 2.66 KB
/
Makefile
File metadata and controls
116 lines (91 loc) · 2.66 KB
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# Code generated by go.einride.tech/sage. DO NOT EDIT.
# To learn more, see ../.sage/main.go and https://github.com/einride/sage.
.DEFAULT_GOAL := default
cwd := $(dir $(realpath $(firstword $(MAKEFILE_LIST))))
sagefile := $(abspath $(cwd)/../.sage/bin/sagefile)
# Setup Go.
go := $(shell command -v go 2>/dev/null)
export GOWORK ?= off
ifndef go
SAGE_GO_VERSION ?= 1.25.7
export GOROOT := $(abspath $(cwd)/../.sage/tools/go/$(SAGE_GO_VERSION)/go)
export PATH := $(PATH):$(GOROOT)/bin
go := $(GOROOT)/bin/go
os := $(shell uname | tr '[:upper:]' '[:lower:]')
arch := $(shell uname -m)
ifeq ($(arch),x86_64)
arch := amd64
endif
$(go):
$(info installing Go $(SAGE_GO_VERSION)...)
@mkdir -p $(dir $(GOROOT))
@curl -sSL https://go.dev/dl/go$(SAGE_GO_VERSION).$(os)-$(arch).tar.gz | tar xz -C $(dir $(GOROOT))
@touch $(GOROOT)/go.mod
@chmod +x $(go)
endif
.PHONY: $(sagefile)
$(sagefile): $(go)
@cd ../.sage && $(go) mod tidy && $(go) run .
.PHONY: sage
sage:
@$(MAKE) $(sagefile)
.PHONY: update-sage
update-sage: $(go)
@cd ../.sage && $(go) get go.einride.tech/sage@latest && $(go) mod tidy && $(go) run .
.PHONY: clean-sage
clean-sage:
@git clean -fdx ../.sage/tools ../.sage/bin ../.sage/build
.PHONY: api-linter-lint
api-linter-lint: $(sagefile)
@$(sagefile) Proto:APILinterLint
.PHONY: buf-format
buf-format: $(sagefile)
@$(sagefile) Proto:BufFormat
.PHONY: buf-generate
buf-generate: $(sagefile)
@$(sagefile) Proto:BufGenerate
.PHONY: buf-generate-auth
buf-generate-auth: $(sagefile)
@$(sagefile) Proto:BufGenerateAuth
.PHONY: buf-generate-book
buf-generate-book: $(sagefile)
@$(sagefile) Proto:BufGenerateBook
.PHONY: buf-generate-cli
buf-generate-cli: $(sagefile)
@$(sagefile) Proto:BufGenerateCLI
.PHONY: buf-lint
buf-lint: $(sagefile)
@$(sagefile) Proto:BufLint
.PHONY: buf-push
buf-push: $(sagefile)
@$(sagefile) Proto:BufPush
.PHONY: buf-readme
buf-readme: $(sagefile)
@$(sagefile) Proto:BufReadme
.PHONY: clean-generated
clean-generated: $(sagefile)
@$(sagefile) Proto:CleanGenerated
.PHONY: default
default: $(sagefile)
@$(sagefile) Proto:Default
.PHONY: go-mod-tidy
go-mod-tidy: $(sagefile)
@$(sagefile) Proto:GoModTidy
.PHONY: install-cli
install-cli: $(sagefile)
@$(sagefile) Proto:InstallCLI
.PHONY: protoc-gen-go
protoc-gen-go: $(sagefile)
@$(sagefile) Proto:ProtocGenGo
.PHONY: protoc-gen-go-aip
protoc-gen-go-aip: $(sagefile)
@$(sagefile) Proto:ProtocGenGoAip
.PHONY: protoc-gen-go-aip-cli
protoc-gen-go-aip-cli: $(sagefile)
@$(sagefile) Proto:ProtocGenGoAipCli
.PHONY: protoc-gen-go-iam
protoc-gen-go-iam: $(sagefile)
@$(sagefile) Proto:ProtocGenGoIam
.PHONY: protoc-gen-open-api-v-2
protoc-gen-open-api-v-2: $(sagefile)
@$(sagefile) Proto:ProtocGenOpenApiV2