From 5f418f31dfe87f6197ae0d609c90bbcd800484b4 Mon Sep 17 00:00:00 2001 From: Simon Godard Date: Wed, 1 Feb 2017 11:51:17 -0500 Subject: [PATCH] Updated the Makefile to improve the resulting zip file name --- Makefile | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 7bbf086..48afd77 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,10 @@ +VERSION := $(shell git describe --tags) +VERSION_COMMIT := $(shell git describe --always --long) +ifeq ($(VERSION),) +VERSION:=$(VERSION_COMMIT) +endif + default: build init: @@ -12,20 +18,19 @@ install: build cp ./bin/docker-machine-driver-cloudca $(GOPATH)/bin/ build-all: clean - # compile for all OS/Arch using Gox + echo $(VERSION) gox -verbose \ - -ldflags "-X main.version=${VERSION}" \ + -ldflags "-X main.version=$(VERSION)" \ -os="linux darwin windows" \ -arch="386 amd64 arm" \ -osarch="!darwin/arm !darwin/386" \ -output="dist/{{.OS}}-{{.Arch}}/docker-machine-driver-cloudca" ./bin - # zip the executables - for PLATFORM in `find ./dist -mindepth 1 -maxdepth 1 -type d` ; do \ + @for PLATFORM in `find ./dist -mindepth 1 -maxdepth 1 -type d` ; do \ OSARCH=`basename $$PLATFORM` ; \ echo "--> $$OSARCH" ; \ pushd $$PLATFORM >/dev/null 2>&1 ; \ - zip ../$$OSARCH.zip ./* ; \ + zip ../docker-machine-driver-cloudca_$(VERSION)_$$OSARCH.zip ./* ; \ popd >/dev/null 2>&1 ; \ done