|
4 | 4 | # Image URL to use all building/pushing image targets |
5 | 5 | export IMAGE_REPO ?= quay.io/operator-framework/operator-controller |
6 | 6 | export IMAGE_TAG ?= devel |
7 | | -export GO_BUILD_TAGS ?= upstream |
8 | 7 | export CERT_MGR_VERSION ?= v1.9.0 |
9 | 8 | export CATALOGD_VERSION ?= v0.2.0 |
10 | 9 | export RUKPAK_VERSION=$(shell go list -mod=mod -m -f "{{.Version}}" github.com/operator-framework/rukpak) |
@@ -112,17 +111,26 @@ kind-load-test-artifacts: $(KIND) ## Load the e2e testdata container images into |
112 | 111 |
|
113 | 112 | ##@ Build |
114 | 113 |
|
115 | | -BUILDCMD = sh -c 'mkdir -p $(BUILDBIN) && $(GORELEASER) build ${GORELEASER_ARGS} --single-target -o $(BUILDBIN)/manager' |
116 | | -BUILDDEPS = manifests generate fmt vet $(GORELEASER) |
| 114 | +export GO_BUILD_ASMFLAGS ?= all=-trimpath=${PWD} |
| 115 | +export GO_BUILD_LDFLAGS ?= -s -w -X $(shell go list -m)/version.Version=$(VERSION) |
| 116 | +export GO_BUILD_GCFLAGS ?= all=-trimpath=${PWD} |
| 117 | +export GO_BUILD_TAGS ?= upstream |
| 118 | + |
| 119 | +BUILDCMD = go build -tags '$(GO_BUILD_TAGS)' -ldflags '$(GO_BUILD_LDFLAGS)' -gcflags '$(GO_BUILD_GCFLAGS)' -asmflags '$(GO_BUILD_ASMFLAGS)' -o $(BUILDBIN)/manager ./cmd/manager |
| 120 | + |
| 121 | +.PHONY: build-deps |
| 122 | +build-deps: manifests generate fmt vet |
117 | 123 |
|
118 | | -.PHONY: build |
119 | | -build: BUILDBIN = bin |
120 | | -build: $(BUILDDEPS) ## Build manager binary using goreleaser for current GOOS and GOARCH. |
| 124 | +.PHONY: build go-build-local |
| 125 | +build: build-deps go-build-local ## Build manager binary for current GOOS and GOARCH. |
| 126 | +go-build-local: BUILDBIN = bin |
| 127 | +go-build-local: |
121 | 128 | $(BUILDCMD) |
122 | 129 |
|
123 | | -.PHONY: build-linux |
124 | | -build-linux: BUILDBIN = bin/linux |
125 | | -build-linux: $(BUILDDEPS) ## Build manager binary using goreleaser for GOOS=linux and local GOARCH. |
| 130 | +.PHONY: build-linux go-build-linux |
| 131 | +build-linux: build-deps go-build-linux ## Build manager binary for GOOS=linux and local GOARCH. |
| 132 | +go-build-linux: BUILDBIN = bin/linux |
| 133 | +go-build-linux: |
126 | 134 | GOOS=linux $(BUILDCMD) |
127 | 135 |
|
128 | 136 | .PHONY: run |
|
0 commit comments