diff mbox

[RFC] i2c-tools: allow linker and compile flags from command line

Message ID 1434705872-2866-1-git-send-email-wsa@the-dreams.de
State Rejected
Headers show

Commit Message

Wolfram Sang June 19, 2015, 9:24 a.m. UTC
Mainly for debugging, so one can pass stuff like -O0 or -static.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
---
 tools/Module.mk | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Jean Delvare July 7, 2015, 7:08 p.m. UTC | #1
Hi Wolfram,

On Fri, 19 Jun 2015 11:24:32 +0200, Wolfram Sang wrote:
> Mainly for debugging, so one can pass stuff like -O0 or -static.
> 
> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
> ---
>  tools/Module.mk | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/tools/Module.mk b/tools/Module.mk
> index 8efddbb..641ac81 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	:= -Llib -li2c
> +TOOLS_LDFLAGS	+= -Llib -li2c

Note that -Llib has become -L$(LIB_DIR) meanwhile.

>  endif
>  
>  TOOLS_TARGETS	:= i2cdetect i2cdump i2cset i2cget

You can already overwrite CFLAGS and LDFLAGS on the command line, and
this works for the whole package. Do you really need to set different
CFLAGS (or LDFLAGS) for different parts of i2c-tools? Seems overkill to
me.

If you really need that then this should be done consistently for all
"modules": not just tools but also lib and now eeprog.
Wolfram Sang July 9, 2015, 4:50 p.m. UTC | #2
> You can already overwrite CFLAGS and LDFLAGS on the command line, and
> this works for the whole package. Do you really need to set different
> CFLAGS (or LDFLAGS) for different parts of i2c-tools? Seems overkill to
> me.

I agree, not really needed now. Let's skip this one.

Thanks,

   Wolfram
diff mbox

Patch

diff --git a/tools/Module.mk b/tools/Module.mk
index 8efddbb..641ac81 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	:= -Llib -li2c
+TOOLS_LDFLAGS	+= -Llib -li2c
 endif
 
 TOOLS_TARGETS	:= i2cdetect i2cdump i2cset i2cget