summaryrefslogtreecommitdiffhomepage
path: root/tools
diff options
context:
space:
mode:
authorAndrei Vagin <avagin@gmail.com>2020-06-02 11:30:26 -0700
committerAndrei Vagin <avagin@gmail.com>2020-06-02 11:30:26 -0700
commit5e4d7072a657be4a8ef1f7fb86c77c09651315e7 (patch)
tree1ca5e06344441b480897b9ab01ee7dce8647fe30 /tools
parent16100d18cbe27f01e1f0c147f91a694518ddc160 (diff)
make: Allow to specify bazel startup options.
And don't parse binary paths for the build target. Signed-off-by: Andrei Vagin <avagin@gmail.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/bazel.mk12
1 files changed, 7 insertions, 5 deletions
diff --git a/tools/bazel.mk b/tools/bazel.mk
index b774c8fab..9f4a40669 100644
--- a/tools/bazel.mk
+++ b/tools/bazel.mk
@@ -93,14 +93,16 @@ bazel-server: ## Ensures that the server exists. Used as an internal target.
@docker exec $(DOCKER_NAME) true || $(MAKE) bazel-server-start
.PHONY: bazel-server
-build_paths = docker exec --user $(UID):$(GID) -i $(DOCKER_NAME) sh -o pipefail -c 'bazel build $(OPTIONS) $(TARGETS) 2>&1 \
- | tee /dev/fd/2 \
+build_cmd = docker exec --user $(UID):$(GID) -i $(DOCKER_NAME) sh -o pipefail -c 'bazel $(STARTUP_OPTIONS) build $(OPTIONS) $(TARGETS)'
+
+build_paths = $(build_cmd) 2>&1 \
+ | tee /proc/self/fd/2 \
| grep -E "^ bazel-bin/" \
- | awk "{print $$1;}"' \
+ | awk "{print $$1;}" \
| xargs -n 1 -I {} sh -c "$(1)"
build: bazel-server
- @$(call build_paths,echo {})
+ @$(call build_cmd)
.PHONY: build
copy: bazel-server
@@ -118,5 +120,5 @@ sudo: bazel-server
.PHONY: sudo
test: bazel-server
- @docker exec --user $(UID):$(GID) -i $(DOCKER_NAME) bazel test $(OPTIONS) $(TARGETS)
+ @docker exec --user $(UID):$(GID) -i $(DOCKER_NAME) bazel $(STARTUP_OPTIONS) test $(OPTIONS) $(TARGETS)
.PHONY: test