1 Star 0 Fork 34

tenngo/git-repo-clean

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
Makefile 2.83 KB
一键复制 编辑 原始数据 按行查看 历史
Li Linchao 提交于 2021-12-02 16:09 . bump version string to 1.0.4
TARGET := git-repo-clean
VERSION := 1.0.4
GO_VERSION := $(subst go version go,,$(shell go version))
BUILD_VERSION := $(shell git describe --tags --always)
GO_LDFLAGS := -X 'main.GoVersion=$(GO_VERSION)' -X 'main.BuildVersion=$(BUILD_VERSION)'
GOFLAGS := -ldflags "$(GO_LDFLAGS)"
.PHONY: all
all:
go build -o bin/${TARGET} $(GOFLAGS)
.PHONY: release
release: Linux MacOS Windows
Linux: Linux-64 Linux-32
Linux-64:
mkdir -p releases/$(VERSION)/Linux-64/
cp -r docs releases/$(VERSION)/Linux-64/
cp LICENSE releases/$(VERSION)/Linux-64/
cp README.md releases/$(VERSION)/Linux-64/
$(call RELEASE_BUILD,linux,amd64)
cp ./releases/git-repo-clean releases/$(VERSION)/Linux-64/
tar -cf releases/git-repo-clean-$(VERSION)-Linux-64.tar releases/$(VERSION)/Linux-64/
rm releases/git-repo-clean
rm -rf releases/$(VERSION)/Linux-64
Linux-32:
mkdir -p releases/$(VERSION)/Linux-32/
cp -r docs releases/$(VERSION)/Linux-32/
cp LICENSE releases/$(VERSION)/Linux-32/
cp README.md releases/$(VERSION)/Linux-32/
$(call RELEASE_BUILD,linux,386)
cp ./releases/git-repo-clean releases/$(VERSION)/Linux-32/
tar -cf releases/git-repo-clean-$(VERSION)-Linux-32.tar releases/$(VERSION)/Linux-32/
rm releases/git-repo-clean
rm -rf releases/$(VERSION)/Linux-32/
MacOS: macOS-64
macOS-64:
mkdir -p releases/$(VERSION)/macOS-64/
cp -r docs releases/$(VERSION)/macOS-64/
cp LICENSE releases/$(VERSION)/macOS-64/
cp README.md releases/$(VERSION)/macOS-64/
$(call RELEASE_BUILD,darwin,amd64)
cp ./releases/git-repo-clean releases/$(VERSION)/macOS-64/
tar -cf releases/git-repo-clean-$(VERSION)-macOS-64.tar releases/$(VERSION)/macOS-64/
rm releases/git-repo-clean
rm -rf releases/$(VERSION)/macOS-64/
Windows: Windows-64 Windows-32
Windows-64:
mkdir -p releases/$(VERSION)/Windows-64/
cp -r docs releases/$(VERSION)/Windows-64/
cp LICENSE releases/$(VERSION)/Windows-64/
cp README.md releases/$(VERSION)/Windows-64/
$(call RELEASE_BUILD,windows,amd64,.exe)
cp ./releases/git-repo-clean.exe releases/$(VERSION)/Windows-64/
zip -r releases/git-repo-clean-$(VERSION)-Windows-64.zip releases/$(VERSION)/Windows-64/
rm releases/git-repo-clean.exe
rm -rf releases/$(VERSION)/Windows-64/
Windows-32:
mkdir -p releases/$(VERSION)/Windows-32/
cp -r docs releases/$(VERSION)/Windows-32/
cp LICENSE releases/$(VERSION)/Windows-32/
cp README.md releases/$(VERSION)/Windows-32/
$(call RELEASE_BUILD,windows,386,.exe)
cp ./releases/git-repo-clean.exe releases/$(VERSION)/Windows-32/
zip -r releases/git-repo-clean-$(VERSION)-Windows-32.zip releases/$(VERSION)/Windows-32/
rm releases/git-repo-clean.exe
rm -rf releases/$(VERSION)/Windows-32/
RELEASE_BUILD = GOOS=$(1) GOARCH=$(2) \
go build \
$(GOFLAGS) \
-o ./releases/git-repo-clean$(3)
.PHONY: clean
clean:
rm -f bin/git-repo-clean
rm -rf releases/*
.PHONY: install
install:
cp bin/git-repo-clean $(shell git --exec-path)
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/tenngoxars/git-repo-clean.git
git@gitee.com:tenngoxars/git-repo-clean.git
tenngoxars
git-repo-clean
git-repo-clean
main

搜索帮助