From 801224257015788d3aff026bf2ae1cd8531d4fcc Mon Sep 17 00:00:00 2001
From: Changqing Li <changqing.li@windriver.com>
Date: Wed, 25 Jul 2018 13:12:04 +0800
Subject: [PATCH] Modify the Makefile for cross compile.

Upstream-Status: Inappropriate [embedded specific]

Signed-off-by: Jianchuan Wang <jianchuan.wang@windriver.com>

update to version 1.29

Signed-off-by: Changqing Li <changqing.li@windriver.com>
---
 Makefile         | 9 ++++-----
 libipvs/Makefile |  3 +--
 2 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/Makefile b/Makefile
index 91a2991..906086d 100644
--- a/Makefile
+++ b/Makefile
@@ -35,10 +35,9 @@ ARCH		= $(shell uname -m)
 RPMSOURCEDIR	= $(shell rpm --eval '%_sourcedir')
 RPMSPECDIR	= $(shell rpm --eval '%_specdir')
 
-CC		= gcc
 INCLUDE		=
 SBIN		= $(BUILD_ROOT)/sbin
-MANDIR		= usr/man
+MANDIR          = usr/share/man
 MAN		= $(BUILD_ROOT)/$(MANDIR)/man8
 INIT		= $(BUILD_ROOT)/etc/rc.d/init.d
 MKDIR		= mkdir
@@ -81,13 +80,13 @@ DEFINES		+= $(shell if [ ! -f ../ip_vs.h ]; then	\
 
 .PHONY	= all clean install dist distclean rpm rpms
 
-all:            libs ipvsadm
+all:            ipvsadm
 
 libs:
 		make -C libipvs
 
-ipvsadm:	$(OBJS) $(STATIC_LIBS)
-		$(CC) $(CFLAGS) -o $@ $^ $(LIBS)
+ipvsadm:       $(OBJS) libs
+		$(CC) $(CFLAGS) -o $@ $(OBJS) $(STATIC_LIBS) $(LIBS)
 
 install:        all
 		if [ ! -d $(SBIN) ]; then $(MKDIR) -p $(SBIN); fi
diff --git a/libipvs/Makefile b/libipvs/Makefile
index f845c8b..dafab30 100644
--- a/libipvs/Makefile
+++ b/libipvs/Makefile
@@ -1,6 +1,5 @@
 # Makefile for libipvs
 
-CC		= gcc
 CFLAGS		= -Wall -Wunused -Wstrict-prototypes -g -fPIC
 ifneq (0,$(HAVE_NL))
 CFLAGS		+= -DLIBIPVS_USE_NL
@@ -30,7 +29,7 @@ SHARED_LIB	= libipvs.so
 all:		$(STATIC_LIB) $(SHARED_LIB)
 
 $(STATIC_LIB):	libipvs.o ip_vs_nl_policy.o
-		ar rv $@ $^
+		$(AR) rv $@ $^
 
 $(SHARED_LIB):	libipvs.o ip_vs_nl_policy.o
 		$(CC) -shared -Wl,-soname,$@ -o $@ $^
-- 
2.7.4

