2009-05-12 17:42:49 +08:00
|
|
|
ROOTDIR=$(DESTDIR)
|
2012-03-02 00:46:26 +08:00
|
|
|
PREFIX=/usr
|
|
|
|
LIBDIR=$(PREFIX)/lib
|
2008-06-02 08:33:44 +08:00
|
|
|
SBINDIR=/sbin
|
2004-04-16 04:56:59 +08:00
|
|
|
CONFDIR=/etc/iproute2
|
2012-03-02 00:46:26 +08:00
|
|
|
DATADIR=$(PREFIX)/share
|
|
|
|
DOCDIR=$(DATADIR)/doc/iproute2
|
|
|
|
MANDIR=$(DATADIR)/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
|
|
|
|
2012-03-02 00:46:26 +08:00
|
|
|
DEFINES+=-DCONFDIR=\"$(CONFDIR)\"
|
|
|
|
|
2004-04-16 04:56:59 +08:00
|
|
|
#options for decnet
|
|
|
|
ADDLIB+=dnet_ntop.o dnet_pton.o
|
|
|
|
|
|
|
|
#options for ipx
|
|
|
|
ADDLIB+=ipx_ntop.o ipx_pton.o
|
|
|
|
|
2015-03-16 03:53:45 +08:00
|
|
|
#options for mpls
|
|
|
|
ADDLIB+=mpls_ntop.o mpls_pton.o
|
|
|
|
|
2004-04-16 04:56:59 +08:00
|
|
|
CC = gcc
|
2005-02-08 02:01:21 +08:00
|
|
|
HOSTCC = gcc
|
2012-03-01 14:45:17 +08:00
|
|
|
DEFINES += -D_GNU_SOURCE
|
|
|
|
CCOPTS = -O2
|
2013-08-01 08:42:39 +08:00
|
|
|
WFLAGS := -Wall -Wstrict-prototypes -Wmissing-prototypes
|
2014-05-30 01:31:30 +08:00
|
|
|
WFLAGS += -Wmissing-declarations -Wold-style-definition -Wformat=2
|
2013-02-13 03:39:32 +08:00
|
|
|
|
2012-03-01 14:45:17 +08:00
|
|
|
CFLAGS = $(WFLAGS) $(CCOPTS) -I../include $(DEFINES)
|
2005-06-24 01:21:46 +08:00
|
|
|
YACCFLAGS = -d -t -v
|
2004-04-16 04:56:59 +08:00
|
|
|
|
2012-08-02 06:23:49 +08:00
|
|
|
SUBDIRS=lib ip tc bridge misc netem genl man
|
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-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:
|