osdl.org!shemminger | aba5acd | 2004-04-15 20:56:59 +0000 | [diff] [blame] | 1 | DESTDIR= |
osdl.org!shemminger | c90d587 | 2004-06-09 21:28:11 +0000 | [diff] [blame] | 2 | SBINDIR=/usr/sbin |
osdl.org!shemminger | aba5acd | 2004-04-15 20:56:59 +0000 | [diff] [blame] | 3 | CONFDIR=/etc/iproute2 |
osdl.net!shemminger | 562fac2 | 2004-09-28 19:59:54 +0000 | [diff] [blame] | 4 | DOCDIR=/usr/share/doc/iproute2 |
osdl.net!shemminger | 06ddd50 | 2004-08-30 22:37:50 +0000 | [diff] [blame] | 5 | MANDIR=/usr/share/man |
osdl.org!shemminger | aba5acd | 2004-04-15 20:56:59 +0000 | [diff] [blame] | 6 | |
osdl.net!shemminger | d1e48c7 | 2004-06-25 21:20:20 +0000 | [diff] [blame] | 7 | # Path to db_185.h include |
| 8 | DBM_INCLUDE:=/usr/include |
| 9 | |
osdl.org!shemminger | aba5acd | 2004-04-15 20:56:59 +0000 | [diff] [blame] | 10 | DEFINES= -DRESOLVE_HOSTNAMES |
| 11 | |
| 12 | #options if you have a bind>=4.9.4 libresolv (or, maybe, glibc) |
| 13 | LDLIBS=-lresolv |
| 14 | ADDLIB= |
| 15 | |
osdl.org!shemminger | aba5acd | 2004-04-15 20:56:59 +0000 | [diff] [blame] | 16 | #options for decnet |
| 17 | ADDLIB+=dnet_ntop.o dnet_pton.o |
| 18 | |
| 19 | #options for ipx |
| 20 | ADDLIB+=ipx_ntop.o ipx_pton.o |
| 21 | |
osdl.org!shemminger | aba5acd | 2004-04-15 20:56:59 +0000 | [diff] [blame] | 22 | CC = gcc |
site!shemminger | b209eda | 2005-02-07 18:01:21 +0000 | [diff] [blame] | 23 | HOSTCC = gcc |
osdl.net!shemminger | c450ff3 | 2005-03-10 19:03:16 +0000 | [diff] [blame] | 24 | CCOPTS = -D_GNU_SOURCE -O2 -Wstrict-prototypes -Wall |
osdl.net!shemminger | 71c60c0 | 2004-08-04 17:45:52 +0000 | [diff] [blame] | 25 | CFLAGS = $(CCOPTS) -I../include $(DEFINES) |
shemminger | 9ddbb02 | 2005-06-23 17:21:46 +0000 | [diff] [blame] | 26 | YACCFLAGS = -d -t -v |
osdl.org!shemminger | aba5acd | 2004-04-15 20:56:59 +0000 | [diff] [blame] | 27 | |
| 28 | LDLIBS += -L../lib -lnetlink -lutil |
| 29 | |
Jamal Hadi Salim | 65018ae | 2006-08-08 12:13:34 -0700 | [diff] [blame] | 30 | SUBDIRS=lib ip tc misc netem genl |
osdl.org!shemminger | aba5acd | 2004-04-15 20:56:59 +0000 | [diff] [blame] | 31 | |
| 32 | LIBNETLINK=../lib/libnetlink.a ../lib/libutil.a |
| 33 | |
shemminger | 737f15f | 2005-07-08 22:08:47 +0000 | [diff] [blame] | 34 | all: Config |
Mike Frysinger | 95dd595 | 2007-03-05 17:50:49 -0800 | [diff] [blame] | 35 | @set -e; \ |
| 36 | for i in $(SUBDIRS); \ |
osdl.net!shemminger | adff36d | 2004-06-25 21:14:22 +0000 | [diff] [blame] | 37 | do $(MAKE) $(MFLAGS) -C $$i; done |
| 38 | |
| 39 | Config: |
shemminger | f35e928 | 2005-06-07 21:48:09 +0000 | [diff] [blame] | 40 | sh configure $(KERNEL_INCLUDE) |
osdl.org!shemminger | aba5acd | 2004-04-15 20:56:59 +0000 | [diff] [blame] | 41 | |
osdl.org!shemminger | aba5acd | 2004-04-15 20:56:59 +0000 | [diff] [blame] | 42 | install: all |
| 43 | install -m 0755 -d $(DESTDIR)$(SBINDIR) |
osdl.net!shemminger | e9a05e9 | 2004-07-02 17:47:15 +0000 | [diff] [blame] | 44 | install -m 0755 -d $(DESTDIR)$(CONFDIR) |
osdl.org!shemminger | aba5acd | 2004-04-15 20:56:59 +0000 | [diff] [blame] | 45 | install -m 0755 -d $(DESTDIR)$(DOCDIR)/examples |
| 46 | install -m 0755 -d $(DESTDIR)$(DOCDIR)/examples/diffserv |
osdl.net!shemminger | c72238e | 2004-12-07 23:57:50 +0000 | [diff] [blame] | 47 | install -m 0644 README.iproute2+tc $(shell find examples -maxdepth 1 -type f) \ |
osdl.net!shemminger | e9a05e9 | 2004-07-02 17:47:15 +0000 | [diff] [blame] | 48 | $(DESTDIR)$(DOCDIR)/examples |
osdl.net!shemminger | c72238e | 2004-12-07 23:57:50 +0000 | [diff] [blame] | 49 | install -m 0644 $(shell find examples/diffserv -maxdepth 1 -type f) \ |
osdl.net!shemminger | e9a05e9 | 2004-07-02 17:47:15 +0000 | [diff] [blame] | 50 | $(DESTDIR)$(DOCDIR)/examples/diffserv |
osdl.org!shemminger | aba5acd | 2004-04-15 20:56:59 +0000 | [diff] [blame] | 51 | @for i in $(SUBDIRS) doc; do $(MAKE) -C $$i install; done |
osdl.net!shemminger | c72238e | 2004-12-07 23:57:50 +0000 | [diff] [blame] | 52 | install -m 0644 $(shell find etc/iproute2 -maxdepth 1 -type f) $(DESTDIR)$(CONFDIR) |
osdl.net!shemminger | cb4d97a | 2004-09-28 19:16:48 +0000 | [diff] [blame] | 53 | install -m 0755 -d $(DESTDIR)$(MANDIR)/man8 |
osdl.net!shemminger | c72238e | 2004-12-07 23:57:50 +0000 | [diff] [blame] | 54 | install -m 0644 $(shell find man/man8 -maxdepth 1 -type f) $(DESTDIR)$(MANDIR)/man8 |
Yasuyuki KOZAKAI | 705899a | 2007-06-18 11:16:42 +0900 | [diff] [blame] | 55 | ln -sf tc-bfifo.8 $(DESTDIR)$(MANDIR)/man8/tc-pfifo.8 |
Andreas Henriksson | f7c3cef | 2007-10-12 10:56:44 +0200 | [diff] [blame] | 56 | 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!shemminger | c450ff3 | 2005-03-10 19:03:16 +0000 | [diff] [blame] | 59 | install -m 0755 -d $(DESTDIR)$(MANDIR)/man3 |
net[shemminger]!shemminger | 85ac60c | 2005-01-17 23:27:37 +0000 | [diff] [blame] | 60 | install -m 0644 $(shell find man/man3 -maxdepth 1 -type f) $(DESTDIR)$(MANDIR)/man3 |
osdl.org!shemminger | aba5acd | 2004-04-15 20:56:59 +0000 | [diff] [blame] | 61 | |
Stephen Hemminger | 235ac6a | 2007-12-21 09:53:45 -0800 | [diff] [blame] | 62 | snapshot: |
| 63 | echo "static const char SNAPSHOT[] = \""`date +%y%m%d`"\";" \ |
| 64 | > include/SNAPSHOT.h |
| 65 | |
osdl.org!shemminger | aba5acd | 2004-04-15 20:56:59 +0000 | [diff] [blame] | 66 | clean: |
shemminger | f6aa8e0 | 2005-06-23 17:31:49 +0000 | [diff] [blame] | 67 | rm -f cscope.* |
osdl.net!shemminger | adff36d | 2004-06-25 21:14:22 +0000 | [diff] [blame] | 68 | @for i in $(SUBDIRS) doc; \ |
| 69 | do $(MAKE) $(MFLAGS) -C $$i clean; done |
| 70 | |
| 71 | clobber: clean |
| 72 | rm -f Config |
| 73 | |
shemminger | 87773db | 2005-06-23 17:23:53 +0000 | [diff] [blame] | 74 | distclean: clobber |
osdl.org!shemminger | aba5acd | 2004-04-15 20:56:59 +0000 | [diff] [blame] | 75 | |
shemminger | f6aa8e0 | 2005-06-23 17:31:49 +0000 | [diff] [blame] | 76 | cscope: |
| 77 | cscope -b -q -R -Iinclude -sip -slib -smisc -snetem -stc |
| 78 | |
osdl.org!shemminger | aba5acd | 2004-04-15 20:56:59 +0000 | [diff] [blame] | 79 | .EXPORT_ALL_VARIABLES: |