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