forked from drone-plugins/drone-git
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
19 lines (14 loc) · 751 Bytes
/
Makefile
File metadata and controls
19 lines (14 loc) · 751 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
TAG:=`git describe --abbrev=0 --tags`
# TAG 是最新的 git tag 值
# 一般情况下 TAG == VERSION
VERSION:=0.5.0
LDFLAGS:=-X main.buildVersion=$(VERSION)
all: dist
dist-clean:
rm -rf dist
dist: dist-clean
mkdir -p dist/alpine-linux/amd64 && GOOS=linux GOARCH=amd64 go build -ldflags "$(LDFLAGS)" -a -tags netgo -installsuffix netgo -o dist/alpine-linux/amd64/drone-git
mkdir -p dist/linux/amd64 && GOOS=linux GOARCH=amd64 go build -ldflags "$(LDFLAGS)" -o dist/linux/amd64/drone-git
dist-advance:
mkdir -p dist/linux/armel && GOOS=linux GOARCH=arm GOARM=5 go build -ldflags "$(LDFLAGS)" -o dist/linux/armel/drone-git
mkdir -p dist/linux/armhf && GOOS=linux GOARCH=arm GOARM=6 go build -ldflags "$(LDFLAGS)" -o dist/linux/armhf/drone-git