blob: de04176dcacdf0e195381e649c9272fb2b8b125a [file] [log] [blame]
osdl.org!shemmingeraba5acd2004-04-15 20:56:59 +00001DESTDIR=
osdl.org!shemmingerc90d5872004-06-09 21:28:11 +00002SBINDIR=/usr/sbin
osdl.org!shemmingeraba5acd2004-04-15 20:56:59 +00003CONFDIR=/etc/iproute2
osdl.net!shemminger562fac22004-09-28 19:59:54 +00004DOCDIR=/usr/share/doc/iproute2
osdl.net!shemminger06ddd502004-08-30 22:37:50 +00005MANDIR=/usr/share/man
osdl.org!shemmingeraba5acd2004-04-15 20:56:59 +00006
osdl.net!shemmingerd1e48c72004-06-25 21:20:20 +00007# Path to db_185.h include
8DBM_INCLUDE:=/usr/include
9
osdl.org!shemmingeraba5acd2004-04-15 20:56:59 +000010DEFINES= -DRESOLVE_HOSTNAMES
11
12#options if you have a bind>=4.9.4 libresolv (or, maybe, glibc)
13LDLIBS=-lresolv
14ADDLIB=
15
osdl.org!shemmingeraba5acd2004-04-15 20:56:59 +000016#options for decnet
17ADDLIB+=dnet_ntop.o dnet_pton.o
18
19#options for ipx
20ADDLIB+=ipx_ntop.o ipx_pton.o
21
osdl.org!shemmingeraba5acd2004-04-15 20:56:59 +000022CC = gcc
site!shemmingerb209eda2005-02-07 18:01:21 +000023HOSTCC = gcc
osdl.net!shemmingerc450ff32005-03-10 19:03:16 +000024CCOPTS = -D_GNU_SOURCE -O2 -Wstrict-prototypes -Wall
osdl.net!shemminger71c60c02004-08-04 17:45:52 +000025CFLAGS = $(CCOPTS) -I../include $(DEFINES)
shemminger9ddbb022005-06-23 17:21:46 +000026YACCFLAGS = -d -t -v
osdl.org!shemmingeraba5acd2004-04-15 20:56:59 +000027
28LDLIBS += -L../lib -lnetlink -lutil
29
Jamal Hadi Salim65018ae2006-08-08 12:13:34 -070030SUBDIRS=lib ip tc misc netem genl
osdl.org!shemmingeraba5acd2004-04-15 20:56:59 +000031
32LIBNETLINK=../lib/libnetlink.a ../lib/libutil.a
33
shemminger737f15f2005-07-08 22:08:47 +000034all: Config
Mike Frysinger95dd5952007-03-05 17:50:49 -080035 @set -e; \
36 for i in $(SUBDIRS); \
osdl.net!shemmingeradff36d2004-06-25 21:14:22 +000037 do $(MAKE) $(MFLAGS) -C $$i; done
38
39Config:
shemmingerf35e9282005-06-07 21:48:09 +000040 sh configure $(KERNEL_INCLUDE)
osdl.org!shemmingeraba5acd2004-04-15 20:56:59 +000041
osdl.org!shemmingeraba5acd2004-04-15 20:56:59 +000042install: all
43 install -m 0755 -d $(DESTDIR)$(SBINDIR)
osdl.net!shemmingere9a05e92004-07-02 17:47:15 +000044 install -m 0755 -d $(DESTDIR)$(CONFDIR)
osdl.org!shemmingeraba5acd2004-04-15 20:56:59 +000045 install -m 0755 -d $(DESTDIR)$(DOCDIR)/examples
46 install -m 0755 -d $(DESTDIR)$(DOCDIR)/examples/diffserv
osdl.net!shemmingerc72238e2004-12-07 23:57:50 +000047 install -m 0644 README.iproute2+tc $(shell find examples -maxdepth 1 -type f) \
osdl.net!shemmingere9a05e92004-07-02 17:47:15 +000048 $(DESTDIR)$(DOCDIR)/examples
osdl.net!shemmingerc72238e2004-12-07 23:57:50 +000049 install -m 0644 $(shell find examples/diffserv -maxdepth 1 -type f) \
osdl.net!shemmingere9a05e92004-07-02 17:47:15 +000050 $(DESTDIR)$(DOCDIR)/examples/diffserv
osdl.org!shemmingeraba5acd2004-04-15 20:56:59 +000051 @for i in $(SUBDIRS) doc; do $(MAKE) -C $$i install; done
osdl.net!shemmingerc72238e2004-12-07 23:57:50 +000052 install -m 0644 $(shell find etc/iproute2 -maxdepth 1 -type f) $(DESTDIR)$(CONFDIR)
osdl.net!shemmingercb4d97a2004-09-28 19:16:48 +000053 install -m 0755 -d $(DESTDIR)$(MANDIR)/man8
osdl.net!shemmingerc72238e2004-12-07 23:57:50 +000054 install -m 0644 $(shell find man/man8 -maxdepth 1 -type f) $(DESTDIR)$(MANDIR)/man8
Yasuyuki KOZAKAI705899a2007-06-18 11:16:42 +090055 ln -sf tc-bfifo.8 $(DESTDIR)$(MANDIR)/man8/tc-pfifo.8
Andreas Henrikssonf7c3cef2007-10-12 10:56:44 +020056 ln -sf lnstat.8 $(DESTDIR)$(MANDIR)/man8/rtstat.8
57 ln -sf lnstat.8 $(DESTDIR)$(MANDIR)/man8/ctstat.8
58 ln -sf rtacct.8 $(DESTDIR)$(MANDIR)/man8/nstat.8
osdl.net!shemmingerc450ff32005-03-10 19:03:16 +000059 install -m 0755 -d $(DESTDIR)$(MANDIR)/man3
net[shemminger]!shemminger85ac60c2005-01-17 23:27:37 +000060 install -m 0644 $(shell find man/man3 -maxdepth 1 -type f) $(DESTDIR)$(MANDIR)/man3
osdl.org!shemmingeraba5acd2004-04-15 20:56:59 +000061
Stephen Hemminger235ac6a2007-12-21 09:53:45 -080062snapshot:
63 echo "static const char SNAPSHOT[] = \""`date +%y%m%d`"\";" \
64 > include/SNAPSHOT.h
65
osdl.org!shemmingeraba5acd2004-04-15 20:56:59 +000066clean:
shemmingerf6aa8e02005-06-23 17:31:49 +000067 rm -f cscope.*
osdl.net!shemmingeradff36d2004-06-25 21:14:22 +000068 @for i in $(SUBDIRS) doc; \
69 do $(MAKE) $(MFLAGS) -C $$i clean; done
70
71clobber: clean
72 rm -f Config
73
shemminger87773db2005-06-23 17:23:53 +000074distclean: clobber
osdl.org!shemmingeraba5acd2004-04-15 20:56:59 +000075
shemmingerf6aa8e02005-06-23 17:31:49 +000076cscope:
77 cscope -b -q -R -Iinclude -sip -slib -smisc -snetem -stc
78
osdl.org!shemmingeraba5acd2004-04-15 20:56:59 +000079.EXPORT_ALL_VARIABLES: