From b105ff5180b189f718f110a8614218958bafeda6 Mon Sep 17 00:00:00 2001 From: Greg Land Date: Tue, 13 Jun 2023 19:01:08 -0400 Subject: [PATCH] Optional symbol stripping in Makefile Packaging systems have options to handle symbol stripping. This lets the users of the software enable or disable symbol stripping based on their own preference or need. --- Makefile | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 29df14e9..7932b7e6 100644 --- a/Makefile +++ b/Makefile @@ -19,6 +19,8 @@ LEDCFG := aura_support.ron SRC := Cargo.toml Cargo.lock Makefile $(shell find -type f -wholename '**/src/*.rs') +STRIP_BINARIES ?= 0 + DEBUG ?= 0 ifeq ($(DEBUG),0) ARGS += --release @@ -119,9 +121,12 @@ ifeq ($(VENDORED),1) tar pxf vendor_asusctl_$(VERSION).tar.xz endif cargo build $(ARGS) - strip -s ./target/release/$(BIN_C) - strip -s ./target/release/$(BIN_D) - strip -s ./target/release/$(BIN_U) - strip -s ./target/release/$(BIN_ROG) +ifneq ($(STRIP_BINARIES),0) + strip -s ./target/$(TARGET)/$(BIN_C) + strip -s ./target/$(TARGET)/$(BIN_D) + strip -s ./target/$(TARGET)/$(BIN_U) + strip -s ./target/$(TARGET)/$(BIN_ROG) +endif + .PHONY: all clean distclean install uninstall update build