Browse code

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 authored on 2014/10/28 14:05:57
Showing 3 changed files
... ...
@@ -4,6 +4,7 @@
4 4
 .vagrant*
5 5
 bin
6 6
 docker/docker
7
+*.exe
7 8
 .*.swp
8 9
 a.out
9 10
 *.orig
... ...
@@ -68,7 +68,8 @@ RUN	cd /usr/local/go/src && ./make.bash --no-clean 2>&1
68 68
 ENV	DOCKER_CROSSPLATFORMS	\
69 69
 	linux/386 linux/arm \
70 70
 	darwin/amd64 darwin/386 \
71
-	freebsd/amd64 freebsd/386 freebsd/arm
71
+	freebsd/amd64 freebsd/386 freebsd/arm \
72
+	windows/amd64 windows/386
72 73
 # (set an explicit GOARM of 5 for maximum compatibility)
73 74
 ENV	GOARM	5
74 75
 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'
... ...
@@ -2,16 +2,20 @@
2 2
 set -e
3 3
 
4 4
 DEST=$1
5
+BINARY_NAME="docker-$VERSION"
6
+if [ "$(go env GOOS)" = 'windows' ]; then
7
+	BINARY_NAME+='.exe'
8
+fi
5 9
 
6 10
 go build \
7
-	-o "$DEST/docker-$VERSION" \
11
+	-o "$DEST/$BINARY_NAME" \
8 12
 	"${BUILDFLAGS[@]}" \
9 13
 	-ldflags "
10 14
 		$LDFLAGS
11 15
 		$LDFLAGS_STATIC_DOCKER
12 16
 	" \
13 17
 	./docker
14
-echo "Created binary: $DEST/docker-$VERSION"
15
-ln -sf "docker-$VERSION" "$DEST/docker"
18
+echo "Created binary: $DEST/$BINARY_NAME"
19
+ln -sf "$BINARY_NAME" "$DEST/docker"
16 20
 
17
-hash_files "$DEST/docker-$VERSION"
21
+hash_files "$DEST/$BINARY_NAME"