]>
Commit | Line | Data |
---|---|---|
0dc34c77 | 1 | IPOBJ=ip.o ipaddress.o ipaddrlabel.o iproute.o iprule.o ipnetns.o \ |
288384f2 | 2 | rtm_map.o iptunnel.o ip6tunnel.o tunnel.o ipneigh.o ipntable.o iplink.o \ |
580fbd88 | 3 | ipmaddr.o ipmonitor.o ipmroute.o ipprefix.o iptuntap.o \ |
e32d4db0 | 4 | ipxfrm.o xfrm_state.o xfrm_policy.o xfrm_monitor.o \ |
d63a9b2b | 5 | iplink_vlan.o link_veth.o link_gre.o iplink_can.o \ |
a5494df2 | 6 | iplink_macvlan.o iplink_macvtap.o ipl2tp.o link_vti.o \ |
1ce2de97 ND |
7 | iplink_vxlan.o tcp_metrics.o iplink_ipoib.o ipnetconf.o link_ip6tnl.o \ |
8 | link_iptnl.o | |
5c302d51 | 9 | |
aba5acdf SH |
10 | RTMONOBJ=rtmon.o |
11 | ||
2e8a07f5 EB |
12 | include ../Config |
13 | ||
14 | ifeq ($(IP_CONFIG_SETNS),y) | |
15 | CFLAGS += -DHAVE_SETNS | |
16 | endif | |
17 | ||
aba5acdf | 18 | ALLOBJ=$(IPOBJ) $(RTMONOBJ) |
03ffadfe SH |
19 | SCRIPTS=ifcfg rtpr routel routef |
20 | TARGETS=ip rtmon | |
aba5acdf | 21 | |
8ced4fcd | 22 | all: $(TARGETS) $(SCRIPTS) |
aba5acdf | 23 | |
8ced4fcd | 24 | ip: $(IPOBJ) $(LIBNETLINK) |
aba5acdf | 25 | |
8ced4fcd YY |
26 | |
27 | rtmon: $(RTMONOBJ) | |
aba5acdf SH |
28 | |
29 | install: all | |
418a217a | 30 | install -m 0755 $(TARGETS) $(DESTDIR)$(SBINDIR) |
03ffadfe | 31 | install -m 0755 $(SCRIPTS) $(DESTDIR)$(SBINDIR) |
aba5acdf SH |
32 | |
33 | clean: | |
34 | rm -f $(ALLOBJ) $(TARGETS) | |
35 | ||
f2e27cfb MF |
36 | SHARED_LIBS ?= y |
37 | ifeq ($(SHARED_LIBS),y) | |
d84914a0 | 38 | |
f2e27cfb | 39 | LDLIBS += -ldl |
d84914a0 | 40 | LDFLAGS += -Wl,-export-dynamic |
f2e27cfb MF |
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 |