mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
use code generation for GITCOMMIT/VERSION too
Signed-off-by: Michael Hudson-Doyle <michael.hudson@linaro.org>
This commit is contained in:
parent
3e10b93106
commit
85744a35de
2 changed files with 12 additions and 6 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -28,3 +28,4 @@ docs/GIT_BRANCH
|
||||||
docs/VERSION
|
docs/VERSION
|
||||||
docs/GITCOMMIT
|
docs/GITCOMMIT
|
||||||
dockerversion/static.go
|
dockerversion/static.go
|
||||||
|
dockerversion/details.go
|
||||||
|
|
17
hack/make.sh
17
hack/make.sh
|
@ -94,14 +94,19 @@ if [ -z "$DOCKER_CLIENTONLY" ]; then
|
||||||
DOCKER_BUILDTAGS+=" daemon"
|
DOCKER_BUILDTAGS+=" daemon"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
rm -f dockerversion/static.go
|
rm -f dockerversion/static.go dockerversion/details.go
|
||||||
|
cat > dockerversion/details.go <<EOF
|
||||||
|
// AUTOGENERATED FILE; see hack/make.sh
|
||||||
|
package dockerversion
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
GITCOMMIT = "$GITCOMMIT"
|
||||||
|
VERSION = "$VERSION"
|
||||||
|
}
|
||||||
|
EOF
|
||||||
|
|
||||||
# Use these flags when compiling the tests and final binary
|
# Use these flags when compiling the tests and final binary
|
||||||
LDFLAGS='
|
LDFLAGS='-w'
|
||||||
-w
|
|
||||||
-X '$DOCKER_PKG'/dockerversion.GITCOMMIT "'$GITCOMMIT'"
|
|
||||||
-X '$DOCKER_PKG'/dockerversion.VERSION "'$VERSION'"
|
|
||||||
'
|
|
||||||
LDFLAGS_STATIC='-linkmode external'
|
LDFLAGS_STATIC='-linkmode external'
|
||||||
EXTLDFLAGS_STATIC='-static'
|
EXTLDFLAGS_STATIC='-static'
|
||||||
# ORIG_BUILDFLAGS is necessary for the cross target which cannot always build
|
# ORIG_BUILDFLAGS is necessary for the cross target which cannot always build
|
||||||
|
|
Loading…
Reference in a new issue