build: -s -w should be added by gen-ldflags.go (#4172)

master
Harshavardhana 8 years ago committed by GitHub
parent 3b1626216d
commit dc365bca44
  1. 2
      Makefile
  2. 4
      buildscripts/gen-ldflags.go

@ -1,7 +1,7 @@
LDFLAGS := $(shell go run buildscripts/gen-ldflags.go) LDFLAGS := $(shell go run buildscripts/gen-ldflags.go)
PWD := $(shell pwd) PWD := $(shell pwd)
GOPATH := $(shell go env GOPATH) GOPATH := $(shell go env GOPATH)
BUILD_LDFLAGS := '$(LDFLAGS) -s -w' BUILD_LDFLAGS := '$(LDFLAGS)'
TAG := latest TAG := latest
HOST ?= $(shell uname) HOST ?= $(shell uname)

@ -27,8 +27,8 @@ import (
) )
func genLDFlags(version string) string { func genLDFlags(version string) string {
var ldflagsStr string ldflagsStr := "-s -w"
ldflagsStr = "-X github.com/minio/minio/cmd.Version=" + version ldflagsStr += " -X github.com/minio/minio/cmd.Version=" + version
ldflagsStr += " -X github.com/minio/minio/cmd.ReleaseTag=" + releaseTag(version) ldflagsStr += " -X github.com/minio/minio/cmd.ReleaseTag=" + releaseTag(version)
ldflagsStr += " -X github.com/minio/minio/cmd.CommitID=" + commitID() ldflagsStr += " -X github.com/minio/minio/cmd.CommitID=" + commitID()
ldflagsStr += " -X github.com/minio/minio/cmd.ShortCommitID=" + commitID()[:12] ldflagsStr += " -X github.com/minio/minio/cmd.ShortCommitID=" + commitID()[:12]

Loading…
Cancel
Save