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 \
|
2009-09-20 00:48:43 +08:00
|
|
|
ipmaddr.o ipmonitor.o ipmroute.o ipprefix.o iptuntap.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 \
|
2011-12-24 12:52:10 +08:00
|
|
|
iplink_macvlan.o iplink_macvtap.o ipl2tp.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
|
|
|
|
2007-07-11 17:33:55 +08:00
|
|
|
all: $(TARGETS) $(SCRIPTS) $(LIBS)
|
2004-04-16 04:56:59 +08:00
|
|
|
|
|
|
|
ip: $(IPOBJ) $(LIBNETLINK) $(LIBUTIL)
|
|
|
|
|
|
|
|
rtmon: $(RTMONOBJ) $(LIBNETLINK)
|
|
|
|
|
|
|
|
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
|