File: binary

package info (click to toggle)
docker.io 26.1.5%2Bdfsg1-9
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 68,576 kB
  • sloc: sh: 5,748; makefile: 912; ansic: 664; asm: 228; python: 162
file content (29 lines) | stat: -rwxr-xr-x 729 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/usr/bin/env sh
#
# Build a static binary for the host OS/ARCH
#

set -eu

. ./scripts/build/.variables

if [ "$CGO_ENABLED" = "1" ] && [ "$(go env GOOS)" != "windows" ]; then
  GO_BUILDTAGS="$GO_BUILDTAGS pkcs11"
fi

echo "Building $GO_LINKMODE $(basename "${TARGET}")"

export GO111MODULE=auto

if [ "$(go env GOOS)" = "windows" ]; then
  if [ ! -x "$(command -v goversioninfo)" ]; then
    >&2 echo "goversioninfo not found, skipping manifesting binary"
  else
    ./scripts/build/mkversioninfo
    (set -x ; go generate -v "${SOURCE}")
  fi
fi

(set -x ; go build -o "${TARGET}" -tags "${GO_BUILDTAGS}" -ldflags "${GO_LDFLAGS}" ${GO_BUILDMODE} "${SOURCE}")

ln -sf "$(basename "${TARGET}")" "$(dirname "${TARGET}")/docker"