From dadd7358f40a5b6a925442c6559644f7bc94d660 Mon Sep 17 00:00:00 2001 From: Bhargav Ravuri Date: Wed, 30 Nov 2022 17:54:58 +0530 Subject: [PATCH] Makefile: Read GO_BUILD_FLAGS from env and prepend Build flags read from env GO_BUILD_FLAGS are prepended to flags in Makefile and sent to scripts/build.sh for building executables (etcd, etcdctl & etcdutl). Signed-off-by: Bhargav Ravuri --- CONTRIBUTING.md | 5 +++++ Makefile | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ec9687a69..05cb8f8ed 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -57,6 +57,11 @@ Setup environment: - For ubuntu and debian run `sudo apt-get install build-essentials` - Verify that everything is installed by running `make build` +Note: `make build` runs with `-v`. Other build flags can be added through env `GO_BUILD_FLAGS`, **if required**. Eg., +```console +GO_BUILD_FLAGS="-buildmode=pie" make build +``` + [file an issue]: https://github.com/etcd-io/etcd/issues/new/choose ## Implement your change diff --git a/Makefile b/Makefile index b47e58e51..1f0cfba4c 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ .PHONY: build build: - GO_BUILD_FLAGS="-v" ./scripts/build.sh + GO_BUILD_FLAGS="${GO_BUILD_FLAGS} -v" ./scripts/build.sh ./bin/etcd --version ./bin/etcdctl version ./bin/etcdutl version