Browse Source

Add windows/(386,amd64) to cross platforms list

Edited make scripts to append .exe to windows binary

Signed-off-by: Ahmet Alp Balkan <ahmetb@microsoft.com>
Ahmet Alp Balkan 10 years ago
parent
commit
b7703a992e
3 changed files with 11 additions and 5 deletions
  1. 1 0
      .gitignore
  2. 2 1
      Dockerfile
  3. 8 4
      project/make/binary

+ 1 - 0
.gitignore

@@ -4,6 +4,7 @@
 .vagrant*
 bin
 docker/docker
+*.exe
 .*.swp
 a.out
 *.orig

+ 2 - 1
Dockerfile

@@ -68,7 +68,8 @@ RUN	cd /usr/local/go/src && ./make.bash --no-clean 2>&1
 ENV	DOCKER_CROSSPLATFORMS	\
 	linux/386 linux/arm \
 	darwin/amd64 darwin/386 \
-	freebsd/amd64 freebsd/386 freebsd/arm
+	freebsd/amd64 freebsd/386 freebsd/arm \
+	windows/amd64 windows/386
 # (set an explicit GOARM of 5 for maximum compatibility)
 ENV	GOARM	5
 RUN	cd /usr/local/go/src && bash -xc 'for platform in $DOCKER_CROSSPLATFORMS; do GOOS=${platform%/*} GOARCH=${platform##*/} ./make.bash --no-clean 2>&1; done'

+ 8 - 4
project/make/binary

@@ -2,16 +2,20 @@
 set -e
 
 DEST=$1
+BINARY_NAME="docker-$VERSION"
+if [ "$(go env GOOS)" = 'windows' ]; then
+	BINARY_NAME+='.exe'
+fi
 
 go build \
-	-o "$DEST/docker-$VERSION" \
+	-o "$DEST/$BINARY_NAME" \
 	"${BUILDFLAGS[@]}" \
 	-ldflags "
 		$LDFLAGS
 		$LDFLAGS_STATIC_DOCKER
 	" \
 	./docker
-echo "Created binary: $DEST/docker-$VERSION"
-ln -sf "docker-$VERSION" "$DEST/docker"
+echo "Created binary: $DEST/$BINARY_NAME"
+ln -sf "$BINARY_NAME" "$DEST/docker"
 
-hash_files "$DEST/docker-$VERSION"
+hash_files "$DEST/$BINARY_NAME"