iproute2/Makefile

87 lines
2.0 KiB
Makefile
Raw Normal View History

ROOTDIR=$(DESTDIR)
PREFIX=/usr
LIBDIR=$(PREFIX)/lib
SBINDIR=/sbin
2004-04-16 04:56:59 +08:00
CONFDIR=/etc/iproute2
DATADIR=$(PREFIX)/share
DOCDIR=$(DATADIR)/doc/iproute2
MANDIR=$(DATADIR)/man
ARPDDIR=/var/lib/arpd
2004-04-16 04:56:59 +08:00
# Path to db_185.h include
DBM_INCLUDE:=$(ROOTDIR)/usr/include
SHARED_LIBS = y
DEFINES= -DRESOLVE_HOSTNAMES -DLIBDIR=\"$(LIBDIR)\"
ifneq ($(SHARED_LIBS),y)
DEFINES+= -DNO_SHARED_LIBS
endif
2004-04-16 04:56:59 +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
#options for mpls
ADDLIB+=mpls_ntop.o mpls_pton.o
2004-04-16 04:56:59 +08:00
CC = gcc
HOSTCC = gcc
DEFINES += -D_GNU_SOURCE
CCOPTS = -O2
WFLAGS := -Wall -Wstrict-prototypes -Wmissing-prototypes
WFLAGS += -Wmissing-declarations -Wold-style-definition -Wformat=2
CFLAGS = $(WFLAGS) $(CCOPTS) -I../include $(DEFINES)
YACCFLAGS = -d -t -v
2004-04-16 04:56:59 +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
LDLIBS += $(LIBNETLINK)
2004-04-16 04:56:59 +08:00
all: Config
@set -e; \
for i in $(SUBDIRS); \
do $(MAKE) $(MFLAGS) -C $$i; done
Config:
sh configure $(KERNEL_INCLUDE)
2004-04-16 04:56:59 +08:00
install: all
install -m 0755 -d $(DESTDIR)$(SBINDIR)
install -m 0755 -d $(DESTDIR)$(CONFDIR)
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
install -m 0644 README.iproute2+tc $(shell find examples -maxdepth 1 -type f) \
$(DESTDIR)$(DOCDIR)/examples
install -m 0644 $(shell find examples/diffserv -maxdepth 1 -type f) \
$(DESTDIR)$(DOCDIR)/examples/diffserv
2004-04-16 04:56:59 +08:00
@for i in $(SUBDIRS) doc; do $(MAKE) -C $$i install; done
install -m 0644 $(shell find etc/iproute2 -maxdepth 1 -type f) $(DESTDIR)$(CONFDIR)
2004-04-16 04:56:59 +08:00
snapshot:
echo "static const char SNAPSHOT[] = \""`date +%y%m%d`"\";" \
> include/SNAPSHOT.h
2004-04-16 04:56:59 +08:00
clean:
@for i in $(SUBDIRS) doc; \
do $(MAKE) $(MFLAGS) -C $$i clean; done
clobber:
touch Config
$(MAKE) $(MFLAGS) clean
rm -f Config cscope.*
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: