1
0
mirror of https://github.com/MontFerret/ferret.git synced 2025-01-30 04:30:51 +02:00
ferret/Makefile

43 lines
808 B
Makefile
Raw Normal View History

2018-09-18 16:42:38 -04:00
.PHONY: build install test doc fmt lint vet
export GOPATH
VERSION ?= $(shell git describe --tags --always --dirty)
DIR_BIN = ./bin
DIR_PKG = ./pkg
2018-10-04 22:13:52 -04:00
DIR_CLI = ./cli
2018-09-18 16:42:38 -04:00
default: build
build: install vet generate test compile
2018-09-25 21:49:42 -04:00
compile:
2018-09-18 16:42:38 -04:00
go build -v -o ${DIR_BIN}/ferret \
-ldflags "-X main.Version=${VERSION}" \
2018-10-04 22:13:52 -04:00
./main.go
2018-09-18 16:42:38 -04:00
install:
dep ensure
test:
go test ${DIR_PKG}/...
generate:
2018-09-27 17:03:49 -04:00
go generate ${DIR_PKG}/...
2018-09-18 16:42:38 -04:00
doc:
godoc -http=:6060 -index
# http://golang.org/cmd/go/#hdr-Run_gofmt_on_package_sources
fmt:
2018-10-04 22:13:52 -04:00
go fmt ${DIR_CLI}/... ${DIR_PKG}/...
2018-09-18 16:42:38 -04:00
# https://github.com/golang/lint
# go get github.com/golang/lint/golint
lint:
2018-10-04 22:13:52 -04:00
golint ${DIR_CLI}/... ${DIR_PKG}/...
2018-09-18 16:42:38 -04:00
# http://godoc.org/code.google.com/p/go.tools/cmd/vet
# go get code.google.com/p/go.tools/cmd/vet
vet:
2018-10-04 22:13:52 -04:00
go vet ${DIR_CLI}/... ${DIR_PKG}/...