22 lines
612 B
Makefile
22 lines
612 B
Makefile
PREFIX ?= /usr/local
|
|
|
|
GOARCH ?= amd64
|
|
GOFLAGS ?= -v -ldflags "-w -X `go list`.Version=$(VERSION) -X `go list`.Commit=$(COMMIT) -X `go list`.Build=$(BUILD)" -tags "static_build"
|
|
GOOS ?= linux
|
|
|
|
BRANCH = `git rev-parse --abbrev-ref HEAD`
|
|
BUILD = `git show -s --pretty=format:%cI`
|
|
COMMIT = `git rev-parse --short HEAD || echo "$COMMIT"`
|
|
VERSION = `git describe --abbrev=0 --tags 2>/dev/null || echo "$VERSION"`
|
|
|
|
build:
|
|
go build $(GOFLAGS) ./cmd/stcli
|
|
strip stcli
|
|
clean:
|
|
rm -f stcli
|
|
install:
|
|
install -Dm0755 stcli ${PREFIX}/bin/stcli
|
|
uninstall:
|
|
rm -f ${PREFIX}/bin/stcli
|
|
rm -f ${PREFIX}/share/man/man1/stcli.1
|