hasshelper/Makefile
2022-05-07 14:26:10 -05:00

22 lines
435 B
Makefile

BIN_NAME=hasshelper
GIT_DESCRIBE=$(shell git describe --always --long --dirty)
GIT_SEMVER=$(shell go run github.com/mdomke/git-semver/v6 -guard -prefix v)
LDFLAGS="-X main.gitDescribe=${GIT_DESCRIBE} -X main.gitVersion=${GIT_SEMVER}"
default: all
all: test build
init:
go mod download
go mod tidy
build: init
go build -ldflags ${LDFLAGS} -o ${BIN_NAME}
test: init
go test ./... -ldflags ${LDFLAGS}
clean:
rm -f ${BIN_NAME}*