Skip to contentSkip to conversation

tools: allow to preset TOOLS_CFLAGS and TOOLS_LDFLAGS

PATCH In review Wolfram Sang 2 participants 4 messages Aug 5, 2020 – Aug 7, 2020 I2C subsystem host drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tools: allow to preset TOOLS_CFLAGS and TOOLS_LDFLAGS

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

---

Jean, what do you think?

 tools/Module.mk | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
tools/Module.mk +3 -3
index 693102f..f5b133d 100644
@@ -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
Signature · 1 line
2.27.0
#1 lore raw
Quoted 2 lines · Wolfram Sang

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

Does USE_STATIC_LIB=1 not work for you?

Quoted 5 lines

---

Jean, what do you think?

Fine with me. However for consistency I think it would make sense to do the same in eeprog/Module.mk and lib/Module.mk?

Signature · 2 lines
Jean Delvare
SUSE L3 Support
#2 lore raw
Quoted 5 lines
Quoted 3 lines

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

Does USE_STATIC_LIB=1 not work for you?

For some embedded devices, I need full static because they use a libc I don't have at hand.

Quoted 4 lines
Quoted 1 line

Jean, what do you think?

Fine with me. However for consistency I think it would make sense to do the same in eeprog/Module.mk and lib/Module.mk?

Sure, will add it.

Thanks!

#3 lore raw
Quoted 7 lines · Wolfram Sang
Quoted 4 lines
Quoted 2 lines

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

Does USE_STATIC_LIB=1 not work for you?

For some embedded devices, I need full static because they use a libc I don't have at hand.

OK, if you think there are more people interested, feel free to introduce another Makefile variable (STATIC_BUILD=1 for example) and use that. Whatever makes your life easier really.

Signature · 2 lines
Jean Delvare
SUSE L3 Support