File: Makefile

package info (click to toggle)
ipvsadm 1%3A1.29-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 472 kB
  • sloc: ansic: 3,730; sh: 288; makefile: 135
file content (44 lines) | stat: -rw-r--r-- 1,248 bytes parent folder | download | duplicates (4)
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
# Makefile for libipvs

CC		= gcc
CFLAGS		= -Wall -Wunused -Wstrict-prototypes -g -fPIC
ifneq (0,$(HAVE_NL))
CFLAGS		+= -DLIBIPVS_USE_NL
CFLAGS		+= $(shell \
		if which pkg-config > /dev/null 2>&1; then \
		  if   pkg-config --cflags libnl-3.0  2> /dev/null; then :; \
		  elif pkg-config --cflags libnl-2.0  2> /dev/null; then :; \
		  elif pkg-config --cflags libnl-1    2> /dev/null; then :; \
		  fi; \
		fi)
endif

INCLUDE		+= $(shell if [ -f ../../ip_vs.h ]; then	\
		     echo "-I../../."; fi;)
DEFINES		= $(shell if [ ! -f ../../ip_vs.h ]; then	\
		    echo "-DHAVE_NET_IP_VS_H"; fi;)
DEFINES		+= $(shell if which pkg-config > /dev/null 2>&1; then \
			 if   pkg-config --exists libnl-3.0; then :; \
			 elif pkg-config --exists libnl-2.0; then :; \
			 elif pkg-config --exists libnl-1; \
			 then echo "-DFALLBACK_LIBNL1"; fi; fi)

.PHONY		= all clean install dist distclean rpm rpms
STATIC_LIB	= libipvs.a
SHARED_LIB	= libipvs.so

all:		$(STATIC_LIB) $(SHARED_LIB)

$(STATIC_LIB):	libipvs.o ip_vs_nl_policy.o
		ar rv $@ $^

$(SHARED_LIB):	libipvs.o ip_vs_nl_policy.o
		$(CC) -shared -Wl,-soname,$@ -o $@ $^

%.o:		%.c
		$(CC) $(CFLAGS) $(INCLUDE) $(DEFINES) -c -o $@ $<

clean:
		rm -f *.[ao] *~ *.orig *.rej core *.so

distclean:	clean