Merge pull request #526 from thockin/master

Fix Makefile to run tools on host OS/ARCH (v4)
This commit is contained in:
Kubernetes Prow Robot 2022-06-06 15:12:23 -07:00 committed by GitHub
commit 3fcb46ef00
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 46 additions and 44 deletions

View File

@ -122,8 +122,10 @@ DOTFILE_IMAGE = $(subst /,_,$(IMAGE))-$(TAG)
LICENSES = .licenses
$(LICENSES): bin/$(shell go env GOOS)_$(shell go env GOARCH)/$(BIN)
@go build -o ./bin/tools github.com/google/go-licenses
$(LICENSES):
@GOOS=$(shell go env GOHOSTOS) \
GOARCH=$(shell go env GOHOSTARCH) \
go build -o ./bin/tools github.com/google/go-licenses
@rm -rf $(LICENSES)
@./bin/tools/go-licenses save ./... --save_path=$(LICENSES)
@chmod -R a+rx $(LICENSES)