
include $(COMMON_BASE_MK)

NAME=iproute2
SRC_DIR=iproute2-3.4.0

ifeq ($(LIBC_TYPE),glibc)
#glibc for iproute2
export IP_CONFIG_SETNS=y
endif
all:
	make -C $(SRC_DIR) all

clean:
	-make -C $(SRC_DIR) clean

romfs:
	cp $(SRC_DIR)/ip/ifcfg    $(SRC_DIR)/ip/ifcfg.elf
	cp $(SRC_DIR)/ip/ip       $(SRC_DIR)/ip/ip.elf
	cp $(SRC_DIR)/ip/routef   $(SRC_DIR)/ip/routef.elf
	cp $(SRC_DIR)/ip/routel   $(SRC_DIR)/ip/routel.elf
	cp $(SRC_DIR)/ip/rtpr     $(SRC_DIR)/ip/rtpr.elf
	cp $(SRC_DIR)/tc/tc       $(SRC_DIR)/ip/tc.elf
ifeq ($(CONFIG_MIN_8M_VERSION), n)
	cp $(SRC_DIR)/misc/rtacct $(SRC_DIR)/ip/rtacct.elf
	cp $(SRC_DIR)/ip/rtmon    $(SRC_DIR)/ip/rtmon.elf
endif
	#$(ROMFSINST) $(INSTALL_DIR)/sbin/openvpn /sbin/openvpn
	$(ROMFSINST) $(SRC_DIR)/ip/ifcfg    /bin/ifcfg
	$(ROMFSINST) $(SRC_DIR)/ip/ip       /bin/ip
	$(ROMFSINST) $(SRC_DIR)/ip/routef   /bin/routef
	$(ROMFSINST) $(SRC_DIR)/ip/routel   /bin/routel
	$(ROMFSINST) $(SRC_DIR)/ip/rtpr     /bin/rtpr
	$(ROMFSINST) $(SRC_DIR)/tc/tc       /bin/tc
ifeq ($(CONFIG_MIN_8M_VERSION), n)
	$(ROMFSINST) $(SRC_DIR)/misc/rtacct /bin/rtacct
	$(ROMFSINST) $(SRC_DIR)/ip/rtmon    /bin/rtmon
endif
