forked from k8sgateway/k8sgateway
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.ci
44 lines (34 loc) · 2.18 KB
/
Makefile.ci
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
# This make file contains targets that are used in CI
# No other targets should be comingled.
#----------------------------------------------------------------------------------
# glooctl
#----------------------------------------------------------------------------------
CLI_DIR=projects/gloo/cli
$(OUTPUT_DIR)/glooctl: $(SOURCES)
GO111MODULE=on go build -ldflags=$(LDFLAGS) -gcflags=$(GCFLAGS) -o $@ $(CLI_DIR)/cmd/main.go $(STDERR_SILENCE_REDIRECT)
$(OUTPUT_DIR)/glooctl-linux-amd64: $(SOURCES)
$(GO_BUILD_FLAGS) GOOS=linux GOARCH=amd64 go build -ldflags=$(LDFLAGS) -gcflags=$(GCFLAGS) -o $@ $(CLI_DIR)/cmd/main.go $(STDERR_SILENCE_REDIRECT)
$(OUTPUT_DIR)/glooctl-linux-arm64: $(SOURCES)
$(GO_BUILD_FLAGS) GOOS=linux GOARCH=arm64 go build -ldflags=$(LDFLAGS) -gcflags=$(GCFLAGS) -o $@ $(CLI_DIR)/cmd/main.go $(STDERR_SILENCE_REDIRECT)
$(OUTPUT_DIR)/glooctl-darwin-amd64: $(SOURCES)
$(GO_BUILD_FLAGS) GOOS=darwin GOARCH=amd64 go build -ldflags=$(LDFLAGS) -gcflags=$(GCFLAGS) -o $@ $(CLI_DIR)/cmd/main.go $(STDERR_SILENCE_REDIRECT)
$(OUTPUT_DIR)/glooctl-darwin-arm64: $(SOURCES)
$(GO_BUILD_FLAGS) GOOS=darwin GOARCH=arm64 go build -ldflags=$(LDFLAGS) -gcflags=$(GCFLAGS) -o $@ $(CLI_DIR)/cmd/main.go $(STDERR_SILENCE_REDIRECT)
$(OUTPUT_DIR)/glooctl-windows-$(GOARCH).exe: $(SOURCES)
$(GO_BUILD_FLAGS) GOOS=windows GOARCH=$(GOARCH) go build -ldflags=$(LDFLAGS) -gcflags=$(GCFLAGS) -o $@ $(CLI_DIR)/cmd/main.go $(STDERR_SILENCE_REDIRECT)
.PHONY: glooctl
glooctl: $(OUTPUT_DIR)/glooctl ## Builds the command line tool
.PHONY: glooctl-linux-amd64
glooctl-linux-amd64: $(OUTPUT_DIR)/glooctl-linux-amd64
.PHONY: glooctl-linux-arm64
glooctl-linux-arm64: $(OUTPUT_DIR)/glooctl-linux-arm64
.PHONY: glooctl-darwin-amd64
glooctl-darwin-amd64: $(OUTPUT_DIR)/glooctl-darwin-amd64
.PHONY: glooctl-darwin-arm64
glooctl-darwin-arm64: $(OUTPUT_DIR)/glooctl-darwin-arm64
.PHONY: glooctl-windows-$(GOARCH)
glooctl-windows-$(GOARCH): $(OUTPUT_DIR)/glooctl-windows-$(GOARCH).exe
.PHONY: build-cli-local
build-cli-local: glooctl-$(GOOS)-$(GOARCH) ## Build the CLI according to your local GOOS and GOARCH
.PHONY: build-cli
build-cli: glooctl-linux-amd64 glooctl-linux-arm64 glooctl-darwin-amd64 glooctl-darwin-arm64 glooctl-windows-$(GOARCH)