build: Versioning now populated through ldflags

This commit is contained in:
Harshavardhana
2015-11-02 02:11:34 -08:00
parent ef04507bc4
commit 7845515f36
6 changed files with 36 additions and 65 deletions

View File

@@ -1,3 +1,5 @@
LDFLAGS = $(shell go run buildscripts/gen-ldflags.go)
all: install
checkdeps:
@@ -7,6 +9,7 @@ checkdeps:
checkgopath:
@echo "Checking if project is at ${GOPATH}"
@for miniopath in $(echo ${GOPATH} | sed 's/:/\n/g'); do if [ ! -d ${miniopath}/src/github.com/minio/minio ]; then echo "Project not found in ${miniopath}, please follow instructions provided at https://github.com/minio/minio/blob/master/CONTRIBUTING.md#setup-your-minio-github-repository" && exit 1; fi done
@echo "Setting LDFLAGS: ${LDFLAGS}"
getdeps: checkdeps checkgopath
@go get -u github.com/golang/lint/golint && echo "Installed golint:"
@@ -38,7 +41,7 @@ cyclo:
@GO15VENDOREXPERIMENT=1 gocyclo -over 65 *.go
@GO15VENDOREXPERIMENT=1 gocyclo -over 65 pkg
build: constants getdeps verifiers
build: getdeps verifiers
@echo "Installing minio:"
deadcode:
@@ -50,11 +53,7 @@ test: build
@GO15VENDOREXPERIMENT=1 go test $(GOFLAGS) github.com/minio/minio/pkg...
gomake-all: build
@GO15VENDOREXPERIMENT=1 go install github.com/minio/minio
constants:
@echo "Generating new build-constants.go"
@GO15VENDOREXPERIMENT=1 go run buildscripts/gen-constants.go
@GO15VENDOREXPERIMENT=1 go build -ldflags $(LDFLAGS) -o $(GOPATH)/bin/minio
pkg-add:
@GO15VENDOREXPERIMENT=1 govendor add $(PKG)
@@ -69,7 +68,6 @@ install: gomake-all
clean:
@echo "Cleaning up all the generated files:"
@rm -fv build-constants.go
@rm -fv cover.out
@rm -fv minio
@rm -fv minio.test