All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wolfram Sang <wsa@kernel.org>
To: linux-i2c@vger.kernel.org
Cc: Jean Delvare <jdelvare@suse.de>, Wolfram Sang <wsa@kernel.org>
Subject: [PATCH i2c-tools v2] allow to preset custom CFLAGS and LDFLAGS
Date: Fri,  7 Aug 2020 13:12:30 +0200	[thread overview]
Message-ID: <20200807111230.1241-1-wsa@kernel.org> (raw)

Sometimes I need to add some flags (like -static for the linker), so
allow this for all CFLAGS and LDFLAGS used in this project.

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

Changes since v1:
	* update all Module.mk, not just tools
	* add entry to CHANGES

 CHANGES          | 1 +
 eeprog/Module.mk | 6 +++---
 lib/Module.mk    | 2 +-
 tools/Module.mk  | 6 +++---
 4 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/CHANGES b/CHANGES
index e3ff3a0..f5c7d33 100644
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,7 @@ i2c-tools CHANGES
 -----------------
 
 master
+  Makefile: allow to preset all CFLAGS and LDFLAGS variables
   tools: Consistently use snprintf instead of sprintf
          Restrict addresses 0x03-0x07, too (defined by I2C standard)
   decode-dimms: Print SPD revision for DDR3 too
diff --git a/eeprog/Module.mk b/eeprog/Module.mk
index ac3a368..3f442aa 100644
--- a/eeprog/Module.mk
+++ b/eeprog/Module.mk
@@ -7,11 +7,11 @@
 
 EEPROG_DIR	:= eeprog
 
-EEPROG_CFLAGS	:= -Iinclude
+EEPROG_CFLAGS	+= -Iinclude
 ifeq ($(USE_STATIC_LIB),1)
-EEPROG_LDFLAGS	:= $(LIB_DIR)/$(LIB_STLIBNAME)
+EEPROG_LDFLAGS	+= $(LIB_DIR)/$(LIB_STLIBNAME)
 else
-EEPROG_LDFLAGS	:= -L$(LIB_DIR) -li2c
+EEPROG_LDFLAGS	+= -L$(LIB_DIR) -li2c
 endif
 
 EEPROG_TARGETS	:= eeprog
diff --git a/lib/Module.mk b/lib/Module.mk
index 46a1c91..6727de7 100644
--- a/lib/Module.mk
+++ b/lib/Module.mk
@@ -9,7 +9,7 @@
 
 LIB_DIR		:= lib
 
-LIB_CFLAGS	:= -Wstrict-prototypes -Wshadow -Wpointer-arith -Wcast-qual \
+LIB_CFLAGS	+= -Wstrict-prototypes -Wshadow -Wpointer-arith -Wcast-qual \
 		   -Wcast-align -Wwrite-strings -Wnested-externs -Winline \
 		   -W -Wundef -Wmissing-prototypes -Iinclude
 
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


             reply	other threads:[~2020-08-07 11:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-07 11:12 Wolfram Sang [this message]
2020-08-10  9:56 ` [PATCH i2c-tools v2] allow to preset custom CFLAGS and LDFLAGS Wolfram Sang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200807111230.1241-1-wsa@kernel.org \
    --to=wsa@kernel.org \
    --cc=jdelvare@suse.de \
    --cc=linux-i2c@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.