]> git.proxmox.com Git - mirror_iproute2.git/blob - ip/Makefile
iproute2: Add processless network namespace support
[mirror_iproute2.git] / ip / Makefile
1 IPOBJ=ip.o ipaddress.o ipaddrlabel.o iproute.o iprule.o ipnetns.o \
2 rtm_map.o iptunnel.o ip6tunnel.o tunnel.o ipneigh.o ipntable.o iplink.o \
3 ipmaddr.o ipmonitor.o ipmroute.o ipprefix.o iptuntap.o \
4 ipxfrm.o xfrm_state.o xfrm_policy.o xfrm_monitor.o \
5 iplink_vlan.o link_veth.o link_gre.o iplink_can.o \
6 iplink_macvlan.o iplink_macvtap.o
7
8 RTMONOBJ=rtmon.o
9
10 ALLOBJ=$(IPOBJ) $(RTMONOBJ)
11 SCRIPTS=ifcfg rtpr routel routef
12 TARGETS=ip rtmon
13
14 all: $(TARGETS) $(SCRIPTS) $(LIBS)
15
16 ip: $(IPOBJ) $(LIBNETLINK) $(LIBUTIL)
17
18 rtmon: $(RTMONOBJ) $(LIBNETLINK)
19
20 install: all
21 install -m 0755 $(TARGETS) $(DESTDIR)$(SBINDIR)
22 install -m 0755 $(SCRIPTS) $(DESTDIR)$(SBINDIR)
23
24 clean:
25 rm -f $(ALLOBJ) $(TARGETS)
26
27 SHARED_LIBS ?= y
28 ifeq ($(SHARED_LIBS),y)
29
30 LDLIBS += -ldl
31 LDFLAGS += -Wl,-export-dynamic
32
33 else
34
35 ip: static-syms.o
36 static-syms.o: static-syms.h
37 static-syms.h: $(wildcard *.c)
38 files="$^" ; \
39 for s in `grep -B 3 '\<dlsym' $$files | sed -n '/snprintf/{s:.*"\([^"]*\)".*:\1:;s:%s::;p}'` ; do \
40 sed -n '/'$$s'[^ ]* =/{s:.* \([^ ]*'$$s'[^ ]*\) .*:extern char \1[] __attribute__((weak)); if (!strcmp(sym, "\1")) return \1;:;p}' $$files ; \
41 done > $@
42
43 endif