2022-08-17 13:16:53 +02:00
|
|
|
#!/bin/sh
|
|
|
|
set -euxo pipefail
|
2022-08-29 15:45:41 +02:00
|
|
|
# Some of the following exports are redundant but are however
|
2022-08-17 13:16:53 +02:00
|
|
|
# useful because they provide explicit logging
|
|
|
|
export CGO_ENABLED=1
|
|
|
|
export GOARM=$GOARM
|
2022-08-30 21:13:33 +02:00
|
|
|
export GOCACHE=$GOCACHE
|
|
|
|
export GOMODCACHE=$GOMODCACHE
|
2022-08-17 13:16:53 +02:00
|
|
|
export GOOS=$GOOS
|
|
|
|
export GOARCH=$GOARCH
|
2022-10-03 11:55:47 +02:00
|
|
|
export OONI_PSIPHON_TAGS=${OONI_PSIPHON_TAGS:-}
|
2022-08-30 11:36:59 +02:00
|
|
|
for PACKAGE in $@; do
|
|
|
|
PRODUCT=$(basename $PACKAGE)
|
|
|
|
go build -o ./CLI/$PRODUCT-$GOOS-$OONIARCH \
|
2022-10-03 11:55:47 +02:00
|
|
|
-tags=$OONI_PSIPHON_TAGS \
|
2022-08-30 11:36:59 +02:00
|
|
|
-ldflags='-s -w -extldflags "-static"' \
|
|
|
|
$GOLANG_EXTRA_FLAGS $PACKAGE
|
|
|
|
done
|