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
:=27877d0da6916f88a6cecbbb3f3d23cc4558ef7c7294324bf4fd050ed606b553
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 PKG_BUILD_DIR
:=$(BUILD_DIR
)/$(PKG_NAME
)/$(PKG_NAME
)-$(PKG_VERSION
)
22 include $(INCLUDE_DIR
)/package.mk
25 URL
:=https
://www.open-mesh.org
/
28 DEPENDS
:=+kmod-batman-adv
+libnl-tiny
+libc
+librt
29 TITLE
:=B.A.T.M.A.N. Advanced user space configuration tool batctl
30 MAINTAINER
:=Simon Wunderlich
<sw@simonwunderlich.de
>
33 define Package
/batctl
/description
34 batctl is a more intuitive managment utility for B.A.T.M.A.N.
-Advanced.
35 It is an easier method for configuring batman-adv and provides some
36 additional tools for debugging
as well. This package builds
37 version
$(PKG_VERSION
) of the user space utility.
40 # The linker can identify unused sections of a binary when each symbol is stored
41 # in a separate section. This mostly removes unused linker sections and reduces
42 # the size by ~3% on mipsel.
44 TARGET_CFLAGS
+= -ffunction-sections
-fdata-sections
45 TARGET_LDFLAGS
+= -Wl
,--gc-sections
47 # Link-time optimization allows to move parts of the optimization from the single
48 # source file to the global source view. This is done by emitting the GIMPLE
49 # representation in each object file and analyzing it again during the link step.
51 TARGET_CFLAGS
+= -flto
52 TARGET_LDFLAGS
+= -fuse-linker-plugin
55 CPPFLAGS
="$(TARGET_CPPFLAGS)" \
56 CFLAGS
="$(TARGET_CFLAGS)" \
57 LDFLAGS
="$(TARGET_LDFLAGS)" \
58 LIBNL_NAME
="libnl-tiny" \
59 LIBNL_GENL_NAME
="libnl-tiny"
62 REVISION
="$(PKG_BATCTL_SHORTREV)" \
64 DESTDIR
="$(PKG_INSTALL_DIR)" \
69 $(MAKE_BATCTL_ENV
) $(MAKE
) -C
"$(PKG_BUILD_DIR)" $(MAKE_BATCTL_ARGS
)
73 rm -rf
$(BUILD_DIR
)/$(PKG_NAME
)/
76 define Package
/batctl
/install
77 $(INSTALL_DIR
) $(1)/usr
/sbin
78 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/batctl
$(1)/usr
/sbin
/
81 $(eval
$(call BuildPackage
,batctl
))