File: Makefile

package info (click to toggle)
iproute 991023-2
  • links: PTS
  • area: main
  • in suites: potato
  • size: 932 kB
  • ctags: 767
  • sloc: ansic: 12,199; sh: 1,018; makefile: 172; perl: 100
file content (56 lines) | stat: -rw-r--r-- 1,557 bytes parent folder | download
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
# Path to parent kernel include files directory (default /usr/include)
#KERNEL_INCLUDE=
#KERNEL_INCLUDE=/net/minus/home/src/BH/vger3/vger-mirror-softirq/linux/include
#KERNEL_INCLUDE=/home1/root/vger-129/vger-mirror/linux/include
KERNEL_INCLUDE=/usr/src/linux/include

DEFINES= #-DRESOLVE_HOSTNAMES

#options if you have a bind>=4.9.4 libresolv (or, maybe, glibc)
LDLIBS=-lresolv
ADDLIB=

#options if you compile with libc5, and without a bind>=4.9.4 libresolv
#LDLIBS=
#ADDLIB=inet_ntop.o inet_pton.o

#options for decnet
ADDLIB+=dnet_ntop.o dnet_pton.o

ifeq (/usr/include/socketbits.h,$(wildcard /usr/include/socketbits.h))
  ifeq (/usr/include/net/if_packet.h,$(wildcard /usr/include/net/if_packet.h))
    GLIBCFIX=-I../include-glibc -include ../include-glibc/glibc-bugs.h
  endif
endif
ifeq (/usr/include/bits/socket.h,$(wildcard /usr/include/bits/socket.h))
  GLIBCFIX=-I../include-glibc -include ../include-glibc/glibc-bugs.h
endif

CC=gcc
CFLAGS=-D_GNU_SOURCE -O2 -Wstrict-prototypes -Wall -g $(GLIBCFIX) -I$(KERNEL_INCLUDE) -I../include $(DEFINES)

LDLIBS += -L../lib -lnetlink -lutil

SUBDIRS=lib ip tc

LIBNETLINK=../lib/libnetlink.a ../lib/libutil.a

all: check-kernel
	@set -e; \
	for i in $(SUBDIRS); \
	do $(MAKE) -C $$i; done

check-kernel:
ifeq ($(KERNEL_INCLUDE),)
	@echo "Please, set correct KERNEL_INCLUDE"; false
else
	@set -e; \
	if [ ! -r $(KERNEL_INCLUDE)/linux/autoconf.h ]; then \
		echo "Please, Compile the kernel first"; false; fi
endif

clean:
	for i in $(SUBDIRS) doc; \
	do $(MAKE) -C $$i clean; done

.EXPORT_ALL_VARIABLES: