diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..8febaad0 --- /dev/null +++ b/Makefile @@ -0,0 +1,10 @@ +COMMIT=$(shell git rev-parse HEAD) +VERSION=$(shell git describe --tags --exact-match --always) +DATE=$(shell date +'%FT%TZ%z') + +vegeta: vendor + go build -v -a -tags=netgo \ + -ldflags '-s -w -extldflags "-static" -X main.Version=$(VERSION) -X main.Commit=$(COMMIT) -X main.Date=$(DATE)' + +vendor: + dep ensure -v diff --git a/main.go b/main.go index 20dd840f..ee31a2a9 100644 --- a/main.go +++ b/main.go @@ -36,7 +36,14 @@ func main() { fs.Parse(os.Args[1:]) if *version { - fmt.Printf("Version: %s\nCommit: %s\nGo version: %s\nDate: %s\n", Version, Commit, runtime.Version(), Date) + fmt.Printf("Version: %s\nCommit: %s\nRuntime: %s %s/%s\nDate: %s\n", + Version, + Commit, + runtime.Version(), + runtime.GOOS, + runtime.GOARCH, + Date, + ) return }