Leaving a variable with a generic name such as TARGETS undefined would lead
to Make picking up its value from the environment. Avoid this by always
defining TARGETS in the Makefiles.

Signed-off-by: Matthias Schiffer <mschif...@universe-factory.net>
---

I also noticed that many Makefiles refer to a variable LIBS, which is
neither defined nor documented to be passed from the outside. Is this
intentional?


 devlink/Makefile | 4 +++-
 rdma/Makefile    | 4 +++-
 tipc/Makefile    | 4 +++-
 3 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/devlink/Makefile b/devlink/Makefile
index 3afda65e..ace34c7b 100644
--- a/devlink/Makefile
+++ b/devlink/Makefile
@@ -1,10 +1,12 @@
 # SPDX-License-Identifier: GPL-2.0
 include ../config.mk
 
+TARGETS :=
+
 ifeq ($(HAVE_MNL),y)
 
 DEVLINKOBJ = devlink.o mnlg.o
-TARGETS=devlink
+TARGETS += devlink
 
 CFLAGS += $(shell $(PKG_CONFIG) libmnl --cflags)
 LDLIBS += $(shell $(PKG_CONFIG) libmnl --libs)
diff --git a/rdma/Makefile b/rdma/Makefile
index c8966bfd..454f25f8 100644
--- a/rdma/Makefile
+++ b/rdma/Makefile
@@ -1,11 +1,13 @@
 # SPDX-License-Identifier: GPL-2.0
 include ../config.mk
 
+TARGETS :=
+
 ifeq ($(HAVE_MNL),y)
 
 RDMA_OBJ = rdma.o utils.o dev.o link.o
 
-TARGETS=rdma
+TARGETS += rdma
 endif
 
 all:   $(TARGETS) $(LIBS)
diff --git a/tipc/Makefile b/tipc/Makefile
index abd33ab0..fdb18d39 100644
--- a/tipc/Makefile
+++ b/tipc/Makefile
@@ -1,6 +1,8 @@
 # SPDX-License-Identifier: GPL-2.0
 include ../config.mk
 
+TARGETS :=
+
 ifeq ($(HAVE_MNL),y)
 
 TIPCOBJ=bearer.o \
@@ -10,7 +12,7 @@ TIPCOBJ=bearer.o \
     node.o socket.o \
     peer.o tipc.o
 
-TARGETS=tipc
+TARGETS += tipc
 
 endif
 
-- 
2.15.1

Reply via email to