2 # Copyright (C) 2014 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR)/rules.mk
14 PKG_MD5SUM:=7b33fb47c7fa5b317e9a152a286999fc
15 PKG_HASH:=07edeb1d87a548285be8c499542790a158fc8d94ef7ebb295f27ebf710024ae9
17 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
18 PKG_SOURCE_URL:=https://downloads.open-mesh.org/batman/releases/batman-adv-$(PKG_VERSION)
21 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)/$(PKG_NAME)-$(PKG_VERSION)
23 include $(INCLUDE_DIR)/package.mk
26 URL:=https://www.open-mesh.org/
29 DEPENDS:=+kmod-batman-adv +libnl-tiny +libc +librt
30 TITLE:=B.A.T.M.A.N. Advanced user space configuration tool batctl
31 MAINTAINER:=Simon Wunderlich <sw@simonwunderlich.de>
34 define Package/batctl/description
35 batctl is a more intuitive managment utility for B.A.T.M.A.N.-Advanced.
36 It is an easier method for configuring batman-adv and provides some
37 additional tools for debugging as well. This package builds
38 version $(PKG_VERSION) of the user space utility.
41 # The linker can identify unused sections of a binary when each symbol is stored
42 # in a separate section. This mostly removes unused linker sections and reduces
43 # the size by ~3% on mipsel.
45 TARGET_CFLAGS += -ffunction-sections -fdata-sections
46 TARGET_LDFLAGS += -Wl,--gc-sections
48 # Link-time optimization allows to move parts of the optimization from the single
49 # source file to the global source view. This is done by emitting the GIMPLE
50 # representation in each object file and analyzing it again during the link step.
52 TARGET_CFLAGS += -flto
53 TARGET_LDFLAGS += -fuse-linker-plugin
56 CPPFLAGS="$(TARGET_CPPFLAGS)" \
57 CFLAGS="$(TARGET_CFLAGS)" \
58 LDFLAGS="$(TARGET_LDFLAGS)" \
59 LIBNL_NAME="libnl-tiny" \
60 LIBNL_GENL_NAME="libnl-tiny"
63 REVISION="$(PKG_BATCTL_SHORTREV)" \
65 DESTDIR="$(PKG_INSTALL_DIR)" \
70 $(MAKE_BATCTL_ENV) $(MAKE) -C "$(PKG_BUILD_DIR)" $(MAKE_BATCTL_ARGS)
74 rm -rf $(BUILD_DIR)/$(PKG_NAME)/
77 define Package/batctl/install
78 $(INSTALL_DIR) $(1)/usr/sbin
79 $(INSTALL_BIN) $(PKG_BUILD_DIR)/batctl $(1)/usr/sbin/
82 $(eval $(call BuildPackage,batctl))