[PATCH ipvsadm v3 5/5] Make sure libipvs.a is built before ipvsadm

Jeremy Sowden <[email protected]>
Newsgroups org.kernel.vger.lvs-devel
Message-ID <[email protected]>
There is no explicit rule in the top-level Makefile to build libipvs.a.  It
is built by the phony target `libs`.  However, there is no guarantee of the
order in which the prerequisites of the `all` target are built, so make may
attempt to link ipvsadm to libipvs.a before it has finished building
libipvs.a.

Add a rule to express the dependency of `$(STATIC_LIBS)` on `libs`.

Signed-off-by: Jeremy Sowden <[email protected]>
---
 Makefile | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Makefile b/Makefile
index d79f72496000..2dda19072365 100644
--- a/Makefile
+++ b/Makefile
@@ -90,6 +90,8 @@ libs:
 ipvsadm:	$(OBJS) $(STATIC_LIBS)
 		$(CC) $(DEFAULT_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS)
 
+$(STATIC_LIBS): libs
+
 install:        all
 		if [ ! -d $(SBIN) ]; then $(MKDIR) -p $(SBIN); fi
 		$(INSTALL) -m 0755 ipvsadm $(SBIN)
-- 
2.45.2
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.