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