mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2025-04-28 22:25:07 +03:00
statically linked executable
This commit is contained in:
parent
83d6442d2d
commit
91c904cc2f
1 changed files with 13 additions and 2 deletions
15
build
15
build
|
@ -25,7 +25,7 @@ do
|
|||
o) ARGS="$ARGS -o $OPTARG";;
|
||||
p) ARGS="$ARGS -buildmode=pie";;
|
||||
# statically linked executable
|
||||
s) LDFLAGS="$LDFLAGS -linkmode external -extldflags=-static";;
|
||||
s) STATIC=" -linkmode external -extldflags=-static";;
|
||||
esac
|
||||
done
|
||||
|
||||
|
@ -33,7 +33,18 @@ if [ -z $TABLES ] && [ -z $DEBUG ]; then
|
|||
LDFLAGS="$LDFLAGS -s -w"
|
||||
fi
|
||||
|
||||
for CMD in ./cmd/mesh ./cmd/meshctl ./contrib/ui/mesh-ui ; do
|
||||
#could be static
|
||||
for CMD in ./cmd/mesh ./cmd/meshctl ; do
|
||||
echo "Building: $CMD"
|
||||
go build $ARGS -ldflags "${LDFLAGS}${STATIC}" -gcflags "$GCFLAGS" $CMD
|
||||
|
||||
if [ $UPX ]; then
|
||||
upx --brute $CMD
|
||||
fi
|
||||
done
|
||||
|
||||
#dynamic only
|
||||
for CMD in ./contrib/ui/mesh-ui ; do
|
||||
echo "Building: $CMD"
|
||||
go build $ARGS -ldflags "$LDFLAGS" -gcflags "$GCFLAGS" $CMD
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue