refactor(mk): move build rules into separate scripts (#855)

See https://github.com/ooni/probe/issues/2218
This commit is contained in:
Simone Basso 2022-08-17 13:16:53 +02:00 committed by GitHub
commit 5c0368c862
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 539 additions and 273 deletions

14
CLI/go-build-alpine Executable file
View file

@ -0,0 +1,14 @@
#!/bin/sh
set -euxo pipefail
apk update
apk upgrade
apk add --no-progress gcc git linux-headers musl-dev
# some of the following exports are redundant but are however
# useful because they provide explicit logging
export CGO_ENABLED=1
export GOARM=$GOARM
export GOOS=$GOOS
export GOARCH=$GOARCH
go build -o ./CLI/$PRODUCT-$GOOS-$OONIARCH \
-ldflags='-s -w -extldflags "-static"' \
$GOLANG_EXTRA_FLAGS $PACKAGE