From 32b86a8d8b2d4483cd9b5f9425f532e4ed1fc807 Mon Sep 17 00:00:00 2001 From: Tim Zhang Date: Fri, 10 Jul 2020 19:07:11 +0800 Subject: [PATCH] agent: Add target optimize for Makefile Run `make optimize` will strip the binary. Fixes: #626 Signed-off-by: Tim Zhang --- src/agent/Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/agent/Makefile b/src/agent/Makefile index 9a53d5182d..e62ef2d032 100644 --- a/src/agent/Makefile +++ b/src/agent/Makefile @@ -91,6 +91,9 @@ $(TARGET): $(TARGET_PATH) $(TARGET_PATH): $(SOURCES) | show-summary @cargo build --target $(TRIPLE) --$(BUILD_TYPE) +optimize: $(SOURCES) | show-summary show-header + @RUSTFLAGS='-C link-arg=-s' cargo build --target $(TRIPLE) --$(BUILD_TYPE) + show-header: @printf "%s - version %s (commit %s)\n\n" "$(TARGET)" "$(VERSION)" "$(COMMIT_MSG)" @@ -140,7 +143,8 @@ help: show-summary .PHONY: \ help \ show-header \ - show-summary + show-summary \ + optimize generate-protocols: protocols/hack/update-generated-proto.sh "${PROTO_FILE}"