[PATCH i2c-tools] tools: allow to preset TOOLS_CFLAGS and TOOLS_LDFLAGS

Wolfram Sang
2020-08-05T22:06:05Z

Sometimes I need to add some flags (like -static for the linker), so
allow this.

Signed-off-by: Wolfram Sang <wsa@kernel.org>
---

Jean, what do you think?

tools/Module.mk | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/Module.mk b/tools/Module.mk
index 693102f..f5b133d 100644
--- a/tools/Module.mk
+++ b/tools/Module.mk
@@ -9,13 +9,13 @@

TOOLS_DIR := tools

-TOOLS_CFLAGS := -Wstrict-prototypes -Wshadow -Wpointer-arith -Wcast-qual \
+TOOLS_CFLAGS += -Wstrict-prototypes -Wshadow -Wpointer-arith -Wcast-qual \
-Wcast-align -Wwrite-strings -Wnested-externs -Winline \
-W -Wundef -Wmissing-prototypes -Iinclude
ifeq ($(USE_STATIC_LIB),1)
-TOOLS_LDFLAGS := $(LIB_DIR)/$(LIB_STLIBNAME)
+TOOLS_LDFLAGS += $(LIB_DIR)/$(LIB_STLIBNAME)
else
-TOOLS_LDFLAGS := -L$(LIB_DIR) -li2c
+TOOLS_LDFLAGS += -L$(LIB_DIR) -li2c
endif

TOOLS_TARGETS := i2cdetect i2cdump i2cset i2cget i2ctransfer
--
2.27.0