LVS
lvs-devel
Google
 
Web LinuxVirtualServer.org

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

To: LVS Devel <lvs-devel@xxxxxxxxxxxxxxx>
Subject: [PATCH ipvsadm v2 5/5] Make sure libipvs.a is built before ipvsadm
From: Jeremy Sowden <azazel@xxxxxxxxxx>
Date: Mon, 13 Jan 2025 19:24:50 +0000
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 <azazel@xxxxxxxxxx>
---
 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



<Prev in Thread] Current Thread [Next in Thread>