]> git.proxmox.com Git - mirror_iproute2.git/blame - Makefile
devlink: add manpage for shared buffer
[mirror_iproute2.git] / Makefile
CommitLineData
06ec9039
1PREFIX?=/usr
2LIBDIR?=$(PREFIX)/lib
3SBINDIR?=/sbin
4CONFDIR?=/etc/iproute2
5DATADIR?=$(PREFIX)/share
6DOCDIR?=$(DATADIR)/doc/iproute2
7MANDIR?=$(DATADIR)/man
8ARPDDIR?=/var/lib/arpd
9KERNEL_INCLUDE?=/usr/include
aba5acdf 10
d1e48c7e 11# Path to db_185.h include
06ec9039 12DBM_INCLUDE:=$(DESTDIR)/usr/include
d1e48c7e 13
f2e27cfb
MF
14SHARED_LIBS = y
15
5e3bb534 16DEFINES= -DRESOLVE_HOSTNAMES -DLIBDIR=\"$(LIBDIR)\"
f2e27cfb
MF
17ifneq ($(SHARED_LIBS),y)
18DEFINES+= -DNO_SHARED_LIBS
19endif
aba5acdf 20
5c434a9e
CT
21DEFINES+=-DCONFDIR=\"$(CONFDIR)\"
22
aba5acdf
SH
23#options for decnet
24ADDLIB+=dnet_ntop.o dnet_pton.o
25
26#options for ipx
27ADDLIB+=ipx_ntop.o ipx_pton.o
28
dacc5d41
EB
29#options for mpls
30ADDLIB+=mpls_ntop.o mpls_pton.o
31
aba5acdf 32CC = gcc
b209eda9 33HOSTCC = gcc
c8610020 34DEFINES += -D_GNU_SOURCE
232aaf4f
MF
35# Turn on transparent support for LFS
36DEFINES += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
c8610020 37CCOPTS = -O2
3140e9a3 38WFLAGS := -Wall -Wstrict-prototypes -Wmissing-prototypes
4ec0ffde 39WFLAGS += -Wmissing-declarations -Wold-style-definition -Wformat=2
6398d3a6 40
06ec9039 41CFLAGS := $(WFLAGS) $(CCOPTS) -I../include $(DEFINES) $(CFLAGS)
9ddbb02e 42YACCFLAGS = -d -t -v
aba5acdf 43
a3c4b484 44SUBDIRS=lib ip tc bridge misc netem genl tipc devlink man
aba5acdf
SH
45
46LIBNETLINK=../lib/libnetlink.a ../lib/libutil.a
2230ac1d 47LDLIBS += $(LIBNETLINK)
aba5acdf 48
737f15f6 49all: Config
95dd5950
MF
50 @set -e; \
51 for i in $(SUBDIRS); \
adff36d7
SH
52 do $(MAKE) $(MFLAGS) -C $$i; done
53
54Config:
f35e9289 55 sh configure $(KERNEL_INCLUDE)
aba5acdf 56
aba5acdf
SH
57install: all
58 install -m 0755 -d $(DESTDIR)$(SBINDIR)
e9a05e96 59 install -m 0755 -d $(DESTDIR)$(CONFDIR)
e48f73d6 60 install -m 0755 -d $(DESTDIR)$(ARPDDIR)
aba5acdf
SH
61 install -m 0755 -d $(DESTDIR)$(DOCDIR)/examples
62 install -m 0755 -d $(DESTDIR)$(DOCDIR)/examples/diffserv
c72238e4 63 install -m 0644 README.iproute2+tc $(shell find examples -maxdepth 1 -type f) \
e9a05e96 64 $(DESTDIR)$(DOCDIR)/examples
c72238e4 65 install -m 0644 $(shell find examples/diffserv -maxdepth 1 -type f) \
e9a05e96 66 $(DESTDIR)$(DOCDIR)/examples/diffserv
aba5acdf 67 @for i in $(SUBDIRS) doc; do $(MAKE) -C $$i install; done
c72238e4 68 install -m 0644 $(shell find etc/iproute2 -maxdepth 1 -type f) $(DESTDIR)$(CONFDIR)
aba5acdf 69
235ac6a4
SH
70snapshot:
71 echo "static const char SNAPSHOT[] = \""`date +%y%m%d`"\";" \
72 > include/SNAPSHOT.h
73
aba5acdf 74clean:
adff36d7
SH
75 @for i in $(SUBDIRS) doc; \
76 do $(MAKE) $(MFLAGS) -C $$i clean; done
77
82408fc1
SH
78clobber:
79 touch Config
80 $(MAKE) $(MFLAGS) clean
a6ddc206 81 rm -f Config cscope.*
adff36d7 82
87773db5 83distclean: clobber
aba5acdf 84
f6aa8e00
SH
85cscope:
86 cscope -b -q -R -Iinclude -sip -slib -smisc -snetem -stc
87
aba5acdf 88.EXPORT_ALL_VARIABLES: