reflector.go/Makefile

28 lines
639 B
Makefile
Raw Normal View History

BINARY=prism-bin
2018-03-01 22:28:06 +01:00
DIR = $(shell cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd)
VENDOR_DIR = vendor
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)
LDFLAGS = -ldflags "-X ${IMPORT_PATH}/meta.Version=${VERSION}"
2018-03-01 22:28:06 +01:00
.PHONY: build dep clean test
.DEFAULT_GOAL: build
build: dep
CGO_ENABLED=0 go build ${LDFLAGS} -asmflags -trimpath=${DIR} -o ${DIR}/${BINARY} main.go
dep: | $(VENDOR_DIR)
$(VENDOR_DIR):
go get github.com/golang/dep/cmd/dep && dep ensure
clean:
if [ -f ${DIR}/${BINARY} ]; then rm ${DIR}/${BINARY}; fi
2018-02-07 21:21:20 +01:00
test:
go test ./... -v -cover