2016-09-05 02:32:57 +00:00
|
|
|
.PHONY: build doc fmt lint run test vendor_clean vendor_get vendor_update vet
|
|
|
|
|
|
|
|
# Prepend our _vendor directory to the system GOPATH
|
|
|
|
# so that import path resolution will prioritize
|
|
|
|
# our third party snapshots.
|
2016-10-05 16:04:16 +00:00
|
|
|
VERSION := $(shell git rev-list --count master)
|
|
|
|
LDFLAGS=-ldflags "-s -w -X main.version=${VERSION}"
|
|
|
|
GOFILES := $(shell ls *.go | grep -v /vendor/)
|
2016-09-05 02:32:57 +00:00
|
|
|
BINARY=./bin/yay
|
|
|
|
|
|
|
|
default: build
|
|
|
|
|
2016-10-05 16:04:16 +00:00
|
|
|
install:
|
|
|
|
go install -v ${LDFLAGS} ${GO_FILES}
|
|
|
|
|
2016-09-05 02:32:57 +00:00
|
|
|
build:
|
2016-10-05 16:04:16 +00:00
|
|
|
go build -v -o ${BINARY} ${LDFLAGS} ${GO_FILES}
|
2016-09-05 02:32:57 +00:00
|
|
|
release:
|
|
|
|
go build -v -o ${BINARY} ./src/main.go
|
|
|
|
|
|
|
|
run: build
|
|
|
|
${BINARY}
|
|
|
|
|
|
|
|
clean:
|
|
|
|
go clean
|
|
|
|
|