2008-06-02 08:33:44 +08:00
|
|
|
DESTDIR=/usr/
|
2009-05-12 17:42:49 +08:00
|
|
|
ROOTDIR=$(DESTDIR)
|
2008-08-22 22:54:12 +08:00
|
|
|
LIBDIR=/usr/lib/
|
2008-06-02 08:33:44 +08:00
|
|
|
SBINDIR=/sbin
|
2004-04-16 04:56:59 +08:00
|
|
|
CONFDIR=/etc/iproute2
|
2008-06-02 08:33:44 +08:00
|
|
|
DOCDIR=/share/doc/iproute2
|
|
|
|
MANDIR=/share/man
|
2005-11-09 22:25:40 +08:00
|
|
|
ARPDDIR=/var/lib/arpd
|
2004-04-16 04:56:59 +08:00
|
|
|
|
2004-06-26 05:20:20 +08:00
|
|
|
# Path to db_185.h include
|
2009-05-12 17:42:49 +08:00
|
|
|
DBM_INCLUDE:=$(ROOTDIR)/usr/include
|
2004-06-26 05:20:20 +08:00
|
|
|
|
2009-11-06 19:09:22 +08:00
|
|
|
SHARED_LIBS = y
|
|
|
|
|
2008-08-22 22:54:12 +08:00
|
|
|
DEFINES= -DRESOLVE_HOSTNAMES -DLIBDIR=\"$(LIBDIR)\"
|
2009-11-06 19:09:22 +08:00
|
|
|
ifneq ($(SHARED_LIBS),y)
|
|
|
|
DEFINES+= -DNO_SHARED_LIBS
|
|
|
|
endif
|
2004-04-16 04:56:59 +08:00
|
|
|
|
|
|
|
#options if you have a bind>=4.9.4 libresolv (or, maybe, glibc)
|
|
|
|
LDLIBS=-lresolv
|
|
|
|
ADDLIB=
|
|
|
|
|
|
|
|
#options for decnet
|
|
|
|
ADDLIB+=dnet_ntop.o dnet_pton.o
|
|
|
|
|
|
|
|
#options for ipx
|
|
|
|
ADDLIB+=ipx_ntop.o ipx_pton.o
|
|
|
|
|
|
|
|
CC = gcc
|
2005-02-08 02:01:21 +08:00
|
|
|
HOSTCC = gcc
|
2005-03-11 03:03:16 +08:00
|
|
|
CCOPTS = -D_GNU_SOURCE -O2 -Wstrict-prototypes -Wall
|
2004-08-05 01:45:52 +08:00
|
|
|
CFLAGS = $(CCOPTS) -I../include $(DEFINES)
|
2005-06-24 01:21:46 +08:00
|
|
|
YACCFLAGS = -d -t -v
|
2004-04-16 04:56:59 +08:00
|
|
|
|
2006-08-09 03:13:34 +08:00
|
|
|
SUBDIRS=lib ip tc misc netem genl
|
2004-04-16 04:56:59 +08:00
|
|
|
|
|
|
|
LIBNETLINK=../lib/libnetlink.a ../lib/libutil.a
|
2011-03-10 02:18:03 +08:00
|
|
|
LDLIBS += $(LIBNETLINK)
|
2004-04-16 04:56:59 +08:00
|
|
|
|
2005-07-09 06:08:47 +08:00
|
|
|
all: Config
|
2007-03-06 09:50:49 +08:00
|
|
|
@set -e; \
|
|
|
|
for i in $(SUBDIRS); \
|
2004-06-26 05:14:22 +08:00
|
|
|
do $(MAKE) $(MFLAGS) -C $$i; done
|
|
|
|
|
|
|
|
Config:
|
2005-06-08 05:48:09 +08:00
|
|
|
sh configure $(KERNEL_INCLUDE)
|
2004-04-16 04:56:59 +08:00
|
|
|
|
|
|
|
install: all
|
|
|
|
install -m 0755 -d $(DESTDIR)$(SBINDIR)
|
2004-07-03 01:47:15 +08:00
|
|
|
install -m 0755 -d $(DESTDIR)$(CONFDIR)
|
2005-11-09 22:25:40 +08:00
|
|
|
install -m 0755 -d $(DESTDIR)$(ARPDDIR)
|
2004-04-16 04:56:59 +08:00
|
|
|
install -m 0755 -d $(DESTDIR)$(DOCDIR)/examples
|
|
|
|
install -m 0755 -d $(DESTDIR)$(DOCDIR)/examples/diffserv
|
2004-12-08 07:57:50 +08:00
|
|
|
install -m 0644 README.iproute2+tc $(shell find examples -maxdepth 1 -type f) \
|
2004-07-03 01:47:15 +08:00
|
|
|
$(DESTDIR)$(DOCDIR)/examples
|
2004-12-08 07:57:50 +08:00
|
|
|
install -m 0644 $(shell find examples/diffserv -maxdepth 1 -type f) \
|
2004-07-03 01:47:15 +08:00
|
|
|
$(DESTDIR)$(DOCDIR)/examples/diffserv
|
2004-04-16 04:56:59 +08:00
|
|
|
@for i in $(SUBDIRS) doc; do $(MAKE) -C $$i install; done
|
2004-12-08 07:57:50 +08:00
|
|
|
install -m 0644 $(shell find etc/iproute2 -maxdepth 1 -type f) $(DESTDIR)$(CONFDIR)
|
2004-09-29 03:16:48 +08:00
|
|
|
install -m 0755 -d $(DESTDIR)$(MANDIR)/man8
|
2004-12-08 07:57:50 +08:00
|
|
|
install -m 0644 $(shell find man/man8 -maxdepth 1 -type f) $(DESTDIR)$(MANDIR)/man8
|
2011-10-26 16:15:21 +08:00
|
|
|
install -m 0755 -d $(DESTDIR)$(MANDIR)/man7
|
|
|
|
install -m 0644 $(shell find man/man7 -maxdepth 1 -type f) $(DESTDIR)$(MANDIR)/man7
|
2007-06-18 10:16:42 +08:00
|
|
|
ln -sf tc-bfifo.8 $(DESTDIR)$(MANDIR)/man8/tc-pfifo.8
|
2007-10-12 16:56:44 +08:00
|
|
|
ln -sf lnstat.8 $(DESTDIR)$(MANDIR)/man8/rtstat.8
|
|
|
|
ln -sf lnstat.8 $(DESTDIR)$(MANDIR)/man8/ctstat.8
|
|
|
|
ln -sf rtacct.8 $(DESTDIR)$(MANDIR)/man8/nstat.8
|
2008-01-03 23:48:56 +08:00
|
|
|
ln -sf routel.8 $(DESTDIR)$(MANDIR)/man8/routef.8
|
2005-03-11 03:03:16 +08:00
|
|
|
install -m 0755 -d $(DESTDIR)$(MANDIR)/man3
|
2005-01-18 07:27:37 +08:00
|
|
|
install -m 0644 $(shell find man/man3 -maxdepth 1 -type f) $(DESTDIR)$(MANDIR)/man3
|
2004-04-16 04:56:59 +08:00
|
|
|
|
2007-12-22 01:53:45 +08:00
|
|
|
snapshot:
|
|
|
|
echo "static const char SNAPSHOT[] = \""`date +%y%m%d`"\";" \
|
|
|
|
> include/SNAPSHOT.h
|
|
|
|
|
2004-04-16 04:56:59 +08:00
|
|
|
clean:
|
2004-06-26 05:14:22 +08:00
|
|
|
@for i in $(SUBDIRS) doc; \
|
|
|
|
do $(MAKE) $(MFLAGS) -C $$i clean; done
|
|
|
|
|
2010-11-19 07:25:38 +08:00
|
|
|
clobber:
|
|
|
|
touch Config
|
|
|
|
$(MAKE) $(MFLAGS) clean
|
2012-03-15 01:22:25 +08:00
|
|
|
rm -f Config cscope.*
|
2004-06-26 05:14:22 +08:00
|
|
|
|
2005-06-24 01:23:53 +08:00
|
|
|
distclean: clobber
|
2004-04-16 04:56:59 +08:00
|
|
|
|
2005-06-24 01:31:49 +08:00
|
|
|
cscope:
|
|
|
|
cscope -b -q -R -Iinclude -sip -slib -smisc -snetem -stc
|
|
|
|
|
2004-04-16 04:56:59 +08:00
|
|
|
.EXPORT_ALL_VARIABLES:
|