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