reflector.go/Makefile

25 lines
725 B
Makefile
Raw Permalink Normal View History

BINARY=prism-bin
2018-03-01 22:28:06 +01:00
DIR = $(shell cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd)
2018-08-31 01:52:29 +02:00
BIN_DIR = ${DIR}/bin
2018-08-15 16:34:50 +02:00
IMPORT_PATH = github.com/lbryio/reflector.go
2018-03-01 22:28:06 +01:00
2018-08-15 16:34:50 +02:00
VERSION = $(shell git --git-dir=${DIR}/.git describe --dirty --always --long --abbrev=7)
2018-08-30 20:41:50 +02:00
LDFLAGS = -ldflags "-X ${IMPORT_PATH}/meta.Version=${VERSION} -X ${IMPORT_PATH}/meta.Time=$(shell date +%s)"
2018-03-01 22:28:06 +01:00
.PHONY: build clean test lint
2018-03-01 22:28:06 +01:00
.DEFAULT_GOAL: build
build:
2018-08-31 01:52:29 +02:00
mkdir -p ${BIN_DIR} && CGO_ENABLED=0 go build ${LDFLAGS} -asmflags -trimpath=${DIR} -o ${BIN_DIR}/${BINARY} main.go
2018-03-01 22:28:06 +01:00
clean:
if [ -f ${BIN_DIR}/${BINARY} ]; then rm ${BIN_DIR}/${BINARY}; fi
2018-02-07 21:21:20 +01:00
test:
go test ./... -v -cover
2018-08-31 01:52:29 +02:00
lint:
go get github.com/alecthomas/gometalinter && gometalinter --install && gometalinter ./...