-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
21 lines (17 loc) · 833 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# Makefile for FlapAlerted
BINARY=FlapAlerted
MODULES=
VERSION=`git describe --tags`
LDFLAGS=-ldflags "-X main.Version=${VERSION} -s -w"
BUILDFLAGS=-trimpath
build:
go build -tags=${MODULES} ${BUILDFLAGS} ${LDFLAGS} -o bin/${BINARY} .
release:
CGO_ENABLED=0 go build -tags=${MODULES} ${BUILDFLAGS} ${LDFLAGS} -o bin/${BINARY} .
release-all:
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -tags=${MODULES} ${BUILDFLAGS} ${LDFLAGS} -o bin/${BINARY}_${VERSION}_linux_amd64
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -tags=${MODULES} ${BUILDFLAGS} ${LDFLAGS} -o bin/${BINARY}_${VERSION}_linux_arm64
CGO_ENABLED=0 GOOS=linux GOARCH=arm go build -tags=${MODULES} ${BUILDFLAGS} ${LDFLAGS} -o bin/${BINARY}_${VERSION}_linux_arm
clean:
if [ -d "bin/" ]; then find bin/ -type f -delete ;fi
if [ -d "bin/" ]; then rm -d bin/ ;fi