Skip to content

Commit

Permalink
Updated the Makefile to improve the resulting zip file name
Browse files Browse the repository at this point in the history
  • Loading branch information
simongodard committed Feb 1, 2017
1 parent dd01b62 commit 5f418f3
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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

Expand Down

0 comments on commit 5f418f3

Please sign in to comment.