]> git.ipfire.org Git - thirdparty/iw.git/commitdiff
iw: allow specifying CFLAGS/LIBS externally
authorJohannes Berg <johannes.berg@intel.com>
Mon, 16 Nov 2020 09:43:12 +0000 (10:43 +0100)
committerJohannes Berg <johannes.berg@intel.com>
Fri, 16 Apr 2021 09:31:41 +0000 (11:31 +0200)
If CFLAGS or LIBS are specified on the make command line,
then the += doesn't do anything. Add "override" directives
to still add the necessary libnl flags/libs.

Change-Id: Icdc3d14ae3a6f01b827c76e753c93fe8eb8fcec2
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Makefile

index 8bd5457279df4332b8a392492bb1cb0f611e974c..2fb8db89c556865709f2531b82e1e59c7298bf46 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -45,30 +45,30 @@ NLLIBNAME = libnl-1
 endif
 
 ifeq ($(NL2FOUND),Y)
-CFLAGS += -DCONFIG_LIBNL20
-LIBS += -lnl-genl
+override CFLAGS += -DCONFIG_LIBNL20
+override LIBS += -lnl-genl
 NLLIBNAME = libnl-2.0
 endif
 
 ifeq ($(NL3xFOUND),Y)
 # libnl 3.2 might be found as 3.2 and 3.0
 NL3FOUND = N
-CFLAGS += -DCONFIG_LIBNL30
-LIBS += -lnl-genl-3
+override CFLAGS += -DCONFIG_LIBNL30
+override LIBS += -lnl-genl-3
 NLLIBNAME = libnl-3.0
 endif
 
 ifeq ($(NL3FOUND),Y)
-CFLAGS += -DCONFIG_LIBNL30
-LIBS += -lnl-genl
+override CFLAGS += -DCONFIG_LIBNL30
+override LIBS += -lnl-genl
 NLLIBNAME = libnl-3.0
 endif
 
 # nl-3.1 has a broken libnl-gnl-3.1.pc file
 # as show by pkg-config --debug --libs --cflags --exact-version=3.1 libnl-genl-3.1;echo $?
 ifeq ($(NL31FOUND),Y)
-CFLAGS += -DCONFIG_LIBNL30
-LIBS += -lnl-genl
+override CFLAGS += -DCONFIG_LIBNL30
+override LIBS += -lnl-genl
 NLLIBNAME = libnl-3.1
 endif
 
@@ -76,8 +76,8 @@ ifeq ($(NLLIBNAME),)
 $(error Cannot find development files for any supported version of libnl)
 endif
 
-LIBS += $(shell $(PKG_CONFIG) --libs $(NLLIBNAME))
-CFLAGS += $(shell $(PKG_CONFIG) --cflags $(NLLIBNAME))
+override LIBS += $(shell $(PKG_CONFIG) --libs $(NLLIBNAME))
+override CFLAGS += $(shell $(PKG_CONFIG) --cflags $(NLLIBNAME))
 endif # NO_PKG_CONFIG
 
 ifeq ($(V),1)