Wolfgang Grandegger | ed1af7e | 2009-05-12 11:42:49 +0200 | [diff] [blame] | 1 | ROOTDIR=$(DESTDIR) |
Christoph J. Thompson | 5c434a9 | 2012-03-01 17:46:26 +0100 | [diff] [blame] | 2 | PREFIX=/usr |
| 3 | LIBDIR=$(PREFIX)/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 |
Christoph J. Thompson | 5c434a9 | 2012-03-01 17:46:26 +0100 | [diff] [blame] | 6 | DATADIR=$(PREFIX)/share |
| 7 | DOCDIR=$(DATADIR)/doc/iproute2 |
| 8 | MANDIR=$(DATADIR)/man |
Olaf Rempel | e48f73d | 2005-11-09 15:25:40 +0100 | [diff] [blame] | 9 | ARPDDIR=/var/lib/arpd |
osdl.org!shemminger | aba5acd | 2004-04-15 20:56:59 +0000 | [diff] [blame] | 10 | |
osdl.net!shemminger | d1e48c7 | 2004-06-25 21:20:20 +0000 | [diff] [blame] | 11 | # Path to db_185.h include |
Wolfgang Grandegger | ed1af7e | 2009-05-12 11:42:49 +0200 | [diff] [blame] | 12 | DBM_INCLUDE:=$(ROOTDIR)/usr/include |
osdl.net!shemminger | d1e48c7 | 2004-06-25 21:20:20 +0000 | [diff] [blame] | 13 | |
Mike Frysinger | f2e27cf | 2009-11-06 06:09:22 -0500 | [diff] [blame] | 14 | SHARED_LIBS = y |
| 15 | |
Andreas Henriksson | 5e3bb53 | 2008-08-22 16:54:12 +0200 | [diff] [blame] | 16 | DEFINES= -DRESOLVE_HOSTNAMES -DLIBDIR=\"$(LIBDIR)\" |
Mike Frysinger | f2e27cf | 2009-11-06 06:09:22 -0500 | [diff] [blame] | 17 | ifneq ($(SHARED_LIBS),y) |
| 18 | DEFINES+= -DNO_SHARED_LIBS |
| 19 | endif |
osdl.org!shemminger | aba5acd | 2004-04-15 20:56:59 +0000 | [diff] [blame] | 20 | |
Christoph J. Thompson | 5c434a9 | 2012-03-01 17:46:26 +0100 | [diff] [blame] | 21 | DEFINES+=-DCONFDIR=\"$(CONFDIR)\" |
| 22 | |
osdl.org!shemminger | aba5acd | 2004-04-15 20:56:59 +0000 | [diff] [blame] | 23 | #options for decnet |
| 24 | ADDLIB+=dnet_ntop.o dnet_pton.o |
| 25 | |
| 26 | #options for ipx |
| 27 | ADDLIB+=ipx_ntop.o ipx_pton.o |
| 28 | |
osdl.org!shemminger | aba5acd | 2004-04-15 20:56:59 +0000 | [diff] [blame] | 29 | CC = gcc |
site!shemminger | b209eda | 2005-02-07 18:01:21 +0000 | [diff] [blame] | 30 | HOSTCC = gcc |
Christoph J. Thompson | c861002 | 2012-03-01 06:45:17 +0000 | [diff] [blame] | 31 | DEFINES += -D_GNU_SOURCE |
| 32 | CCOPTS = -O2 |
Stephen Hemminger | 3140e9a | 2013-07-31 17:42:39 -0700 | [diff] [blame] | 33 | WFLAGS := -Wall -Wstrict-prototypes -Wmissing-prototypes |
Stephen Hemminger | 6398d3a | 2013-02-12 11:39:32 -0800 | [diff] [blame] | 34 | WFLAGS += -Wmissing-declarations -Wold-style-definition |
| 35 | |
Christoph J. Thompson | c861002 | 2012-03-01 06:45:17 +0000 | [diff] [blame] | 36 | CFLAGS = $(WFLAGS) $(CCOPTS) -I../include $(DEFINES) |
shemminger | 9ddbb02 | 2005-06-23 17:21:46 +0000 | [diff] [blame] | 37 | YACCFLAGS = -d -t -v |
osdl.org!shemminger | aba5acd | 2004-04-15 20:56:59 +0000 | [diff] [blame] | 38 | |
Stephen Hemminger | d04bc30 | 2012-08-01 15:23:49 -0700 | [diff] [blame] | 39 | SUBDIRS=lib ip tc bridge misc netem genl man |
osdl.org!shemminger | aba5acd | 2004-04-15 20:56:59 +0000 | [diff] [blame] | 40 | |
| 41 | LIBNETLINK=../lib/libnetlink.a ../lib/libutil.a |
Diego Elio Pettenò | 2230ac1 | 2011-03-09 10:18:03 -0800 | [diff] [blame] | 42 | LDLIBS += $(LIBNETLINK) |
osdl.org!shemminger | aba5acd | 2004-04-15 20:56:59 +0000 | [diff] [blame] | 43 | |
shemminger | 737f15f | 2005-07-08 22:08:47 +0000 | [diff] [blame] | 44 | all: Config |
Mike Frysinger | 95dd595 | 2007-03-05 17:50:49 -0800 | [diff] [blame] | 45 | @set -e; \ |
| 46 | for i in $(SUBDIRS); \ |
osdl.net!shemminger | adff36d | 2004-06-25 21:14:22 +0000 | [diff] [blame] | 47 | do $(MAKE) $(MFLAGS) -C $$i; done |
| 48 | |
| 49 | Config: |
shemminger | f35e928 | 2005-06-07 21:48:09 +0000 | [diff] [blame] | 50 | sh configure $(KERNEL_INCLUDE) |
osdl.org!shemminger | aba5acd | 2004-04-15 20:56:59 +0000 | [diff] [blame] | 51 | |
osdl.org!shemminger | aba5acd | 2004-04-15 20:56:59 +0000 | [diff] [blame] | 52 | install: all |
| 53 | install -m 0755 -d $(DESTDIR)$(SBINDIR) |
osdl.net!shemminger | e9a05e9 | 2004-07-02 17:47:15 +0000 | [diff] [blame] | 54 | install -m 0755 -d $(DESTDIR)$(CONFDIR) |
Olaf Rempel | e48f73d | 2005-11-09 15:25:40 +0100 | [diff] [blame] | 55 | install -m 0755 -d $(DESTDIR)$(ARPDDIR) |
osdl.org!shemminger | aba5acd | 2004-04-15 20:56:59 +0000 | [diff] [blame] | 56 | install -m 0755 -d $(DESTDIR)$(DOCDIR)/examples |
| 57 | install -m 0755 -d $(DESTDIR)$(DOCDIR)/examples/diffserv |
osdl.net!shemminger | c72238e | 2004-12-07 23:57:50 +0000 | [diff] [blame] | 58 | 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] | 59 | $(DESTDIR)$(DOCDIR)/examples |
osdl.net!shemminger | c72238e | 2004-12-07 23:57:50 +0000 | [diff] [blame] | 60 | install -m 0644 $(shell find examples/diffserv -maxdepth 1 -type f) \ |
osdl.net!shemminger | e9a05e9 | 2004-07-02 17:47:15 +0000 | [diff] [blame] | 61 | $(DESTDIR)$(DOCDIR)/examples/diffserv |
osdl.org!shemminger | aba5acd | 2004-04-15 20:56:59 +0000 | [diff] [blame] | 62 | @for i in $(SUBDIRS) doc; do $(MAKE) -C $$i install; done |
osdl.net!shemminger | c72238e | 2004-12-07 23:57:50 +0000 | [diff] [blame] | 63 | install -m 0644 $(shell find etc/iproute2 -maxdepth 1 -type f) $(DESTDIR)$(CONFDIR) |
osdl.org!shemminger | aba5acd | 2004-04-15 20:56:59 +0000 | [diff] [blame] | 64 | |
Stephen Hemminger | 235ac6a | 2007-12-21 09:53:45 -0800 | [diff] [blame] | 65 | snapshot: |
| 66 | echo "static const char SNAPSHOT[] = \""`date +%y%m%d`"\";" \ |
| 67 | > include/SNAPSHOT.h |
| 68 | |
osdl.org!shemminger | aba5acd | 2004-04-15 20:56:59 +0000 | [diff] [blame] | 69 | clean: |
osdl.net!shemminger | adff36d | 2004-06-25 21:14:22 +0000 | [diff] [blame] | 70 | @for i in $(SUBDIRS) doc; \ |
| 71 | do $(MAKE) $(MFLAGS) -C $$i clean; done |
| 72 | |
Stephen Hemminger | 82408fc | 2010-11-18 15:25:38 -0800 | [diff] [blame] | 73 | clobber: |
| 74 | touch Config |
| 75 | $(MAKE) $(MFLAGS) clean |
Stephen Hemminger | a6ddc20 | 2012-03-14 10:22:25 -0700 | [diff] [blame] | 76 | rm -f Config cscope.* |
osdl.net!shemminger | adff36d | 2004-06-25 21:14:22 +0000 | [diff] [blame] | 77 | |
shemminger | 87773db | 2005-06-23 17:23:53 +0000 | [diff] [blame] | 78 | distclean: clobber |
osdl.org!shemminger | aba5acd | 2004-04-15 20:56:59 +0000 | [diff] [blame] | 79 | |
shemminger | f6aa8e0 | 2005-06-23 17:31:49 +0000 | [diff] [blame] | 80 | cscope: |
| 81 | cscope -b -q -R -Iinclude -sip -slib -smisc -snetem -stc |
| 82 | |
osdl.org!shemminger | aba5acd | 2004-04-15 20:56:59 +0000 | [diff] [blame] | 83 | .EXPORT_ALL_VARIABLES: |