Files
sealos/scripts/make-rules/tools.mk
T

68 lines
2.0 KiB
Makefile

# Copyright © 2022 sealos.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
BUILD_TOOLS ?= golangci-lint goimports addlicense deepcopy-gen conversion-gen
RELEASE_TOOLS ?= goreleaser ossutil upx nfpm
.PHONY: tools.install
tools.install: $(addprefix tools.install., $(BUILD_TOOLS) $(RELEASE_TOOLS))
.PHONY: tools.install.%
tools.install.%:
@echo "===========> Installing $*"
@$(MAKE) install.$*
.PHONY: tools.verify.%
tools.verify.%:
@if ! which $* &>/dev/null; then $(MAKE) tools.install.$*; fi
.PHONY: install.golangci-lint
install.golangci-lint:
@$(GO) install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
.PHONY: install.goimports
install.goimports:
@$(GO) install golang.org/x/tools/cmd/goimports@latest
.PHONY: install.addlicense
install.addlicense:
@$(GO) install github.com/google/addlicense@latest
.PHONY: install.deepcopy-gen
install.deepcopy-gen:
@$(GO) install k8s.io/code-generator/cmd/deepcopy-gen@latest
.PHONY: install.conversion-gen
install.conversion-gen:
@$(GO) install k8s.io/code-generator/cmd/conversion-gen@latest
.PHONY: install.goreleaser
install.goreleaser:
@$(GO) install github.com/goreleaser/goreleaser@v1.6.3
.PHONY: install.ossutil
install.ossutil:
@$(GO) install github.com/aliyun/ossutil@latest
.PHONY: install.upx
install.upx:
@wget https://github.com/upx/upx/releases/download/v3.96/upx-3.96-amd64_linux.tar.xz
@tar xf upx*.tar.xz
@sudo cp upx*/upx /usr/local/bin
@rm -rf upx*
.PHONY: install.nfpm
install.nfpm:
@$(GO) install github.com/goreleaser/nfpm/v2/cmd/nfpm@latest