...
1# Code generated by go.einride.tech/sage. DO NOT EDIT.
2# To learn more, see ../.sage/main.go and https://github.com/einride/sage.
3
4.DEFAULT_GOAL := all
5
6cwd := $(dir $(realpath $(firstword $(MAKEFILE_LIST))))
7sagefile := $(abspath $(cwd)/../.sage/bin/sagefile)
8
9# Setup Go.
10go := $(shell command -v go 2>/dev/null)
11export GOWORK ?= off
12ifndef go
13SAGE_GO_VERSION ?= 1.20.2
14export GOROOT := $(abspath $(cwd)/../.sage/tools/go/$(SAGE_GO_VERSION)/go)
15export PATH := $(PATH):$(GOROOT)/bin
16go := $(GOROOT)/bin/go
17os := $(shell uname | tr '[:upper:]' '[:lower:]')
18arch := $(shell uname -m)
19ifeq ($(arch),x86_64)
20arch := amd64
21endif
22$(go):
23 $(info installing Go $(SAGE_GO_VERSION)...)
24 @mkdir -p $(dir $(GOROOT))
25 @curl -sSL https://go.dev/dl/go$(SAGE_GO_VERSION).$(os)-$(arch).tar.gz | tar xz -C $(dir $(GOROOT))
26 @touch $(GOROOT)/go.mod
27 @chmod +x $(go)
28endif
29
30.PHONY: $(sagefile)
31$(sagefile): $(go)
32 @cd ../.sage && $(go) mod tidy && $(go) run .
33
34.PHONY: sage
35sage:
36 @$(MAKE) $(sagefile)
37
38.PHONY: update-sage
39update-sage: $(go)
40 @cd ../.sage && $(go) get -d go.einride.tech/sage@latest && $(go) mod tidy && $(go) run .
41
42.PHONY: clean-sage
43clean-sage:
44 @git clean -fdx ../.sage/tools ../.sage/bin ../.sage/build
45
46.PHONY: api-linter-lint
47api-linter-lint: $(sagefile)
48 @$(sagefile) Proto:APILinterLint
49
50.PHONY: all
51all: $(sagefile)
52 @$(sagefile) Proto:All
53
54.PHONY: buf-format
55buf-format: $(sagefile)
56 @$(sagefile) Proto:BufFormat
57
58.PHONY: buf-generate
59buf-generate: $(sagefile)
60 @$(sagefile) Proto:BufGenerate
61
62.PHONY: buf-generate-testdata
63buf-generate-testdata: $(sagefile)
64 @$(sagefile) Proto:BufGenerateTestdata
65
66.PHONY: buf-lint
67buf-lint: $(sagefile)
68 @$(sagefile) Proto:BufLint
69
70.PHONY: protoc-gen-go
71protoc-gen-go: $(sagefile)
72 @$(sagefile) Proto:ProtocGenGo
73
74.PHONY: protoc-gen-go-aip
75protoc-gen-go-aip: $(sagefile)
76 @$(sagefile) Proto:ProtocGenGoAIP
77
78.PHONY: protoc-gen-go-grpc
79protoc-gen-go-grpc: $(sagefile)
80 @$(sagefile) Proto:ProtocGenGoGRPC
View as plain text