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_HASH
:=e43827a5e868b4e134e77ca04da989fde1981463166bf1b6f2053acc3edd6257
16 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
).
tar.gz
17 PKG_SOURCE_URL
:=https
://downloads.open-mesh.org
/batman
/releases
/batman-adv-
$(PKG_VERSION
)
20 include $(INCLUDE_DIR
)/package.mk
23 URL
:=https
://www.open-mesh.org
/
26 DEPENDS
:=+kmod-batman-adv
+libnl-tiny
+libc
+librt
27 TITLE
:=B.A.T.M.A.N. Advanced user space configuration tool batctl
28 MAINTAINER
:=Simon Wunderlich
<sw@simonwunderlich.de
>
31 define Package
/batctl
/description
32 batctl is a more intuitive managment utility for B.A.T.M.A.N.
-Advanced.
33 It is an easier method for configuring batman-adv and provides some
34 additional tools for debugging
as well. This package builds
35 version
$(PKG_VERSION
) of the user space utility.
38 # The linker can identify unused sections of a binary when each symbol is stored
39 # in a separate section. This mostly removes unused linker sections and reduces
40 # the size by ~3% on mipsel.
42 TARGET_CFLAGS
+= -ffunction-sections
-fdata-sections
43 TARGET_LDFLAGS
+= -Wl
,--gc-sections
45 # Link-time optimization allows to move parts of the optimization from the single
46 # source file to the global source view. This is done by emitting the GIMPLE
47 # representation in each object file and analyzing it again during the link step.
49 TARGET_CFLAGS
+= -flto
50 TARGET_LDFLAGS
+= -fuse-linker-plugin
53 CPPFLAGS
="$(TARGET_CPPFLAGS)" \
54 CFLAGS
="$(TARGET_CFLAGS)" \
55 LDFLAGS
="$(TARGET_LDFLAGS)" \
56 LIBNL_NAME
="libnl-tiny" \
57 LIBNL_GENL_NAME
="libnl-tiny"
60 REVISION
="$(PKG_BATCTL_SHORTREV)" \
62 DESTDIR
="$(PKG_INSTALL_DIR)" \
64 REVISION
="openwrt-$(PKG_VERSION)-$(PKG_RELEASE)"
68 $(MAKE_BATCTL_ENV
) $(MAKE
) -C
"$(PKG_BUILD_DIR)" $(MAKE_BATCTL_ARGS
)
71 define Package
/batctl
/install
72 $(INSTALL_DIR
) $(1)/usr
/sbin
73 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/batctl
$(1)/usr
/sbin
/
76 $(eval
$(call BuildPackage
,batctl
))