2011-07-14 00:48:26 +08:00
|
|
|
IPOBJ=ip.o ipaddress.o ipaddrlabel.o iproute.o iprule.o ipnetns.o \
|
2006-11-24 11:27:09 +08:00
|
|
|
rtm_map.o iptunnel.o ip6tunnel.o tunnel.o ipneigh.o ipntable.o iplink.o \
|
2013-04-30 14:22:50 +08:00
|
|
|
ipmaddr.o ipmonitor.o ipmroute.o ipprefix.o iptuntap.o iptoken.o \
|
2007-10-12 04:01:42 +08:00
|
|
|
ipxfrm.o xfrm_state.o xfrm_policy.o xfrm_monitor.o \
|
2009-12-27 03:22:57 +08:00
|
|
|
iplink_vlan.o link_veth.o link_gre.o iplink_can.o \
|
2014-09-26 15:11:37 +08:00
|
|
|
iplink_macvlan.o iplink_macvtap.o ipl2tp.o link_vti.o link_vti6.o \
|
2012-12-12 17:51:47 +08:00
|
|
|
iplink_vxlan.o tcp_metrics.o iplink_ipoib.o ipnetconf.o link_ip6tnl.o \
|
2014-09-29 07:31:04 +08:00
|
|
|
link_iptnl.o link_gre6.o iplink_bond.o iplink_bond_slave.o iplink_hsr.o \
|
2015-05-09 01:27:08 +08:00
|
|
|
iplink_bridge.o iplink_bridge_slave.o ipfou.o iplink_ipvlan.o \
|
|
|
|
iplink_geneve.o
|
2007-09-02 00:47:19 +08:00
|
|
|
|
2004-04-16 04:56:59 +08:00
|
|
|
RTMONOBJ=rtmon.o
|
|
|
|
|
2011-07-15 22:26:59 +08:00
|
|
|
include ../Config
|
|
|
|
|
|
|
|
ifeq ($(IP_CONFIG_SETNS),y)
|
|
|
|
CFLAGS += -DHAVE_SETNS
|
|
|
|
endif
|
|
|
|
|
2004-04-16 04:56:59 +08:00
|
|
|
ALLOBJ=$(IPOBJ) $(RTMONOBJ)
|
2005-02-10 06:05:41 +08:00
|
|
|
SCRIPTS=ifcfg rtpr routel routef
|
|
|
|
TARGETS=ip rtmon
|
2004-04-16 04:56:59 +08:00
|
|
|
|
2012-02-27 22:21:15 +08:00
|
|
|
all: $(TARGETS) $(SCRIPTS)
|
2004-04-16 04:56:59 +08:00
|
|
|
|
2012-02-27 22:21:15 +08:00
|
|
|
ip: $(IPOBJ) $(LIBNETLINK)
|
2004-04-16 04:56:59 +08:00
|
|
|
|
2012-02-27 22:21:15 +08:00
|
|
|
rtmon: $(RTMONOBJ)
|
2004-04-16 04:56:59 +08:00
|
|
|
|
|
|
|
install: all
|
2008-03-16 16:27:01 +08:00
|
|
|
install -m 0755 $(TARGETS) $(DESTDIR)$(SBINDIR)
|
2005-02-10 06:05:41 +08:00
|
|
|
install -m 0755 $(SCRIPTS) $(DESTDIR)$(SBINDIR)
|
2004-04-16 04:56:59 +08:00
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f $(ALLOBJ) $(TARGETS)
|
|
|
|
|
2009-11-06 19:09:22 +08:00
|
|
|
SHARED_LIBS ?= y
|
|
|
|
ifeq ($(SHARED_LIBS),y)
|
2007-12-17 21:06:38 +08:00
|
|
|
|
2009-11-06 19:09:22 +08:00
|
|
|
LDLIBS += -ldl
|
2007-12-17 21:06:38 +08:00
|
|
|
LDFLAGS += -Wl,-export-dynamic
|
2009-11-06 19:09:22 +08:00
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
ip: static-syms.o
|
|
|
|
static-syms.o: static-syms.h
|
|
|
|
static-syms.h: $(wildcard *.c)
|
|
|
|
files="$^" ; \
|
|
|
|
for s in `grep -B 3 '\<dlsym' $$files | sed -n '/snprintf/{s:.*"\([^"]*\)".*:\1:;s:%s::;p}'` ; do \
|
|
|
|
sed -n '/'$$s'[^ ]* =/{s:.* \([^ ]*'$$s'[^ ]*\) .*:extern char \1[] __attribute__((weak)); if (!strcmp(sym, "\1")) return \1;:;p}' $$files ; \
|
|
|
|
done > $@
|
|
|
|
|
|
|
|
endif
|