github.com/lafolle/docker@v1.6.0/hack/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  source "$(dirname "$BASH_SOURCE")/.go-autogen"
    15  
    16  go build \
    17  	-o "$DEST/$BINARY_FULLNAME" \
    18  	"${BUILDFLAGS[@]}" \
    19  	-ldflags "
    20  		$LDFLAGS
    21  		$LDFLAGS_STATIC_DOCKER
    22  	" \
    23  	./docker
    24  
    25  echo "Created binary: $DEST/$BINARY_FULLNAME"
    26  ln -sf "$BINARY_FULLNAME" "$DEST/docker$BINARY_EXTENSION"
    27  
    28  hash_files "$DEST/$BINARY_FULLNAME"