Eric W. Biederman | 0dc34c7 | 2011-07-13 09:48:26 -0700 | [diff] [blame] | 1 | IPOBJ=ip.o ipaddress.o ipaddrlabel.o iproute.o iprule.o ipnetns.o \ |
Masahide NAKAMURA | 288384f | 2006-11-24 12:27:09 +0900 | [diff] [blame] | 2 | rtm_map.o iptunnel.o ip6tunnel.o tunnel.o ipneigh.o ipntable.o iplink.o \ |
Daniel Borkmann | 191b60b | 2013-04-30 06:22:50 +0000 | [diff] [blame] | 3 | ipmaddr.o ipmonitor.o ipmroute.o ipprefix.o iptuntap.o iptoken.o \ |
Stephen Hemminger | e32d4db | 2007-10-11 13:01:42 -0700 | [diff] [blame] | 4 | ipxfrm.o xfrm_state.o xfrm_policy.o xfrm_monitor.o \ |
Arnd Bergmann | d63a9b2 | 2009-12-26 11:22:57 -0800 | [diff] [blame] | 5 | iplink_vlan.o link_veth.o link_gre.o iplink_can.o \ |
Steffen Klassert | 2f7fbec | 2014-09-26 09:11:37 +0200 | [diff] [blame] | 6 | iplink_macvlan.o iplink_macvtap.o ipl2tp.o link_vti.o link_vti6.o \ |
Nicolas Dichtel | 1ce2de9 | 2012-12-12 10:51:47 +0100 | [diff] [blame] | 7 | iplink_vxlan.o tcp_metrics.o iplink_ipoib.o ipnetconf.o link_ip6tnl.o \ |
Jiri Pirko | 8c39db3 | 2014-09-28 16:31:04 -0700 | [diff] [blame^] | 8 | link_iptnl.o link_gre6.o iplink_bond.o iplink_bond_slave.o iplink_hsr.o \ |
| 9 | iplink_bridge_slave.o |
Patrick McHardy | 5c302d5 | 2007-09-01 18:47:19 +0200 | [diff] [blame] | 10 | |
osdl.org!shemminger | aba5acd | 2004-04-15 20:56:59 +0000 | [diff] [blame] | 11 | RTMONOBJ=rtmon.o |
| 12 | |
Eric W. Biederman | 2e8a07f | 2011-07-15 14:26:59 +0000 | [diff] [blame] | 13 | include ../Config |
| 14 | |
| 15 | ifeq ($(IP_CONFIG_SETNS),y) |
| 16 | CFLAGS += -DHAVE_SETNS |
| 17 | endif |
| 18 | |
osdl.org!shemminger | aba5acd | 2004-04-15 20:56:59 +0000 | [diff] [blame] | 19 | ALLOBJ=$(IPOBJ) $(RTMONOBJ) |
osdl.net!shemminger | 03ffadf | 2005-02-09 22:05:41 +0000 | [diff] [blame] | 20 | SCRIPTS=ifcfg rtpr routel routef |
| 21 | TARGETS=ip rtmon |
osdl.org!shemminger | aba5acd | 2004-04-15 20:56:59 +0000 | [diff] [blame] | 22 | |
Yegor Yefremov | 8ced4fc | 2012-02-27 15:21:15 +0100 | [diff] [blame] | 23 | all: $(TARGETS) $(SCRIPTS) |
osdl.org!shemminger | aba5acd | 2004-04-15 20:56:59 +0000 | [diff] [blame] | 24 | |
Yegor Yefremov | 8ced4fc | 2012-02-27 15:21:15 +0100 | [diff] [blame] | 25 | ip: $(IPOBJ) $(LIBNETLINK) |
osdl.org!shemminger | aba5acd | 2004-04-15 20:56:59 +0000 | [diff] [blame] | 26 | |
Yegor Yefremov | 8ced4fc | 2012-02-27 15:21:15 +0100 | [diff] [blame] | 27 | rtmon: $(RTMONOBJ) |
osdl.org!shemminger | aba5acd | 2004-04-15 20:56:59 +0000 | [diff] [blame] | 28 | |
| 29 | install: all |
Mike Frysinger | 418a217 | 2008-03-16 04:27:01 -0400 | [diff] [blame] | 30 | install -m 0755 $(TARGETS) $(DESTDIR)$(SBINDIR) |
osdl.net!shemminger | 03ffadf | 2005-02-09 22:05:41 +0000 | [diff] [blame] | 31 | install -m 0755 $(SCRIPTS) $(DESTDIR)$(SBINDIR) |
osdl.org!shemminger | aba5acd | 2004-04-15 20:56:59 +0000 | [diff] [blame] | 32 | |
| 33 | clean: |
| 34 | rm -f $(ALLOBJ) $(TARGETS) |
| 35 | |
Mike Frysinger | f2e27cf | 2009-11-06 06:09:22 -0500 | [diff] [blame] | 36 | SHARED_LIBS ?= y |
| 37 | ifeq ($(SHARED_LIBS),y) |
Vitaliy Gusev | d84914a | 2007-12-17 16:06:38 +0300 | [diff] [blame] | 38 | |
Mike Frysinger | f2e27cf | 2009-11-06 06:09:22 -0500 | [diff] [blame] | 39 | LDLIBS += -ldl |
Vitaliy Gusev | d84914a | 2007-12-17 16:06:38 +0300 | [diff] [blame] | 40 | LDFLAGS += -Wl,-export-dynamic |
Mike Frysinger | f2e27cf | 2009-11-06 06:09:22 -0500 | [diff] [blame] | 41 | |
| 42 | else |
| 43 | |
| 44 | ip: static-syms.o |
| 45 | static-syms.o: static-syms.h |
| 46 | static-syms.h: $(wildcard *.c) |
| 47 | files="$^" ; \ |
| 48 | for s in `grep -B 3 '\<dlsym' $$files | sed -n '/snprintf/{s:.*"\([^"]*\)".*:\1:;s:%s::;p}'` ; do \ |
| 49 | sed -n '/'$$s'[^ ]* =/{s:.* \([^ ]*'$$s'[^ ]*\) .*:extern char \1[] __attribute__((weak)); if (!strcmp(sym, "\1")) return \1;:;p}' $$files ; \ |
| 50 | done > $@ |
| 51 | |
| 52 | endif |