github.com/eikeon/docker@v1.5.0-rc4/project/make/binary (about)

     1  #!/bin/bash
     2  set -e
     3  
     4  DEST=$1
     5  BINARY_NAME="docker-$VERSION"
     6  BINARY_EXTENSION="$(binary_extension)"
     7  BINARY_FULLNAME="$BINARY_NAME$BINARY_EXTENSION"
     8  
     9  # Cygdrive paths don't play well with go build -o.
    10  if [[ "$(uname -s)" == CYGWIN* ]]; then
    11  	DEST=$(cygpath -mw $DEST)
    12  fi
    13  
    14  go build \
    15  	-o "$DEST/$BINARY_FULLNAME" \
    16  	"${BUILDFLAGS[@]}" \
    17  	-ldflags "
    18  		$LDFLAGS
    19  		$LDFLAGS_STATIC_DOCKER
    20  	" \
    21  	./docker
    22  echo "Created binary: $DEST/$BINARY_FULLNAME"
    23  ln -sf "$BINARY_FULLNAME" "$DEST/docker$BINARY_EXTENSION"
    24  
    25  hash_files "$DEST/$BINARY_FULLNAME"