summaryrefslogtreecommitdiff
blob: dee72895c2002c1b2fa0da9db00cd980cd0f73a0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
diff -Nuar --exclude '*.spec' ipvsadm-1.25.orig/libipvs/Makefile ipvsadm-1.25/libipvs/Makefile
--- ipvsadm-1.25.orig/libipvs/Makefile	2008-09-21 10:02:03.000000000 +0000
+++ ipvsadm-1.25/libipvs/Makefile	2009-10-10 17:28:48.000000000 +0000
@@ -1,14 +1,14 @@
 # Makefile for libipvs
 
 CC		= gcc
-CFLAGS		= -Wall -Wunused -Wstrict-prototypes -g -fPIC
+OPTFLAGS = -Wall -Wunused -Wstrict-prototypes -fPIC
 ifneq (0,$(HAVE_NL))
-CFLAGS		+= -DLIBIPVS_USE_NL
+DEFINES += -DLIBIPVS_USE_NL
 endif
 
 INCLUDE		+= $(shell if [ -f ../../ip_vs.h ]; then	\
 		     echo "-I../../."; fi;)
-DEFINES		= $(shell if [ ! -f ../../ip_vs.h ]; then	\
+DEFINES		+= $(shell if [ ! -f ../../ip_vs.h ]; then	\
 		    echo "-DHAVE_NET_IP_VS_H"; fi;)
 
 .PHONY		= all clean install dist distclean rpm rpms
@@ -24,7 +24,7 @@
 		$(CC) -shared -Wl,-soname,$@ -o $@ $^
 
 %.o:		%.c
-		$(CC) $(CFLAGS) $(INCLUDE) $(DEFINES) -c -o $@ $<
+		$(CC) $(OPTFLAGS) $(CFLAGS) $(INCLUDE) $(DEFINES) -c -o $@ $<
 
 clean:
 		rm -f *.[ao] *~ *.orig *.rej core *.so
diff -Nuar --exclude '*.spec' ipvsadm-1.25.orig/Makefile ipvsadm-1.25/Makefile
--- ipvsadm-1.25.orig/Makefile	2008-09-23 16:14:46.000000000 +0000
+++ ipvsadm-1.25/Makefile	2009-10-10 17:33:55.000000000 +0000
@@ -45,11 +45,11 @@
 STATIC_LIBS	= libipvs/libipvs.a
 
 ifeq "${ARCH}" "sparc64"
-    CFLAGS = -Wall -Wunused -Wstrict-prototypes -g -m64 -pipe -mcpu=ultrasparc -mcmodel=medlow
+    CFLAGS := -g -m64 -pipe -mcpu=ultrasparc -mcmodel=medlow
 else
-    CFLAGS = -Wall -Wunused -Wstrict-prototypes -g
+    CFLAGS := -g
 endif
-
+OPTFLAGS += -Wall -Wunused -Wstrict-prototypes
 
 #####################################
 # No servicable parts below this line
@@ -92,10 +92,12 @@
 all:            libs ipvsadm
 
 libs:
-		make -C libipvs
+		$(MAKE) -C libipvs
+
+$(STATIC_LIBS): libs
 
 ipvsadm:	$(OBJS) $(STATIC_LIBS)
-		$(CC) $(CFLAGS) -o $@ $^ $(LIBS)
+		$(CC) $(OPTFLAGS) $(CFLAGS) -o $@ $^ $(LIBS)
 
 install:        all
 		if [ ! -d $(SBIN) ]; then $(MKDIR) -p $(SBIN); fi
@@ -115,7 +117,7 @@
 		rm -rf debian/tmp
 		find . -name '*.[ao]' -o -name "*~" -o -name "*.orig" \
 		  -o -name "*.rej" -o -name core | xargs rm -f
-		make -C libipvs clean
+		$(MAKE) -C libipvs clean
 
 distclean:	clean
 
@@ -148,4 +150,4 @@
 		dpkg-buildpackage
 
 %.o:	%.c
-		$(CC) $(CFLAGS) $(INCLUDE) $(DEFINES) -c -o $@ $<
+		$(CC) $(OPTFLAGS) $(CFLAGS) $(INCLUDE) $(DEFINES) -c -o $@ $<