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
:=a3564eb9727335352dc0cfa2f2b29474c2c837384689ac5fcb387784a56e7685
16 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
).
tar.gz
17 PKG_SOURCE_URL
:=https
://downloads.open-mesh.org
/batman
/releases
/batman-adv-
$(PKG_VERSION
)
18 PKG_LICENSE
:=GPL-2.0
-only ISC MIT
19 PKG_LICENSE_FILES
:=LICENSES
/preferred
/GPL-2.0 LICENSES
/preferred
/MIT LICENSES
/deprecated
/ISC
21 PKG_BUILD_DIR
:=$(BUILD_DIR
)/$(PKG_NAME
)-$(BUILD_VARIANT
)/$(PKG_NAME
)-$(PKG_VERSION
)
23 include $(INCLUDE_DIR
)/package.mk
25 define Package
/batctl
/Default
26 URL
:=https
://www.open-mesh.org
/
29 DEPENDS
:=+libnl-tiny
+libc
+librt
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 define Package
/batctl-tiny
42 $(call Package
/batctl
/Default
)
43 TITLE
:=B.A.T.M.A.N. Advanced user space configuration tool
(Minimal
)
46 ALTERNATIVES
:=100:/usr
/sbin
/batctl
:/usr
/libexec
/batctl-tiny
49 define Package
/batctl-tiny
/description
50 $(Package
/batctl
/description
)
51 Only configuration relevant subcommands are enabled.
54 define Package
/batctl-default
55 $(call Package
/batctl
/Default
)
56 TITLE
:=B.A.T.M.A.N. Advanced user space configuration tool
(Default
)
58 ALTERNATIVES
:=200:/usr
/sbin
/batctl
:/usr
/libexec
/batctl-default
61 define Package
/batctl-default
/description
62 $(Package
/batctl
/description
)
63 Standard subcommands for configuration and online debugging are enabled.
66 define Package
/batctl-full
67 $(call Package
/batctl
/Default
)
68 TITLE
:=B.A.T.M.A.N. Advanced user space configuration tool
(Full
)
70 ALTERNATIVES
:=300:/usr
/sbin
/batctl
:/usr
/libexec
/batctl-full
73 define Package
/batctl-full
/description
74 $(Package
/batctl
/description
)
75 Subcommands for configuration
, online and offline debugging are enabled.
78 # The linker can identify unused sections of a binary when each symbol is stored
79 # in a separate section. This mostly removes unused linker sections and reduces
80 # the size by ~3% on mipsel.
82 TARGET_CFLAGS
+= -ffunction-sections
-fdata-sections
83 TARGET_LDFLAGS
+= -Wl
,--gc-sections
85 # Link-time optimization allows to move parts of the optimization from the single
86 # source file to the global source view. This is done by emitting the GIMPLE
87 # representation in each object file and analyzing it again during the link step.
89 TARGET_CFLAGS
+= -flto
90 TARGET_LDFLAGS
+= -fuse-linker-plugin
93 LIBNL_NAME
="libnl-tiny" \
94 LIBNL_GENL_NAME
="libnl-tiny"
97 REVISION
="openwrt-$(PKG_VERSION)-$(PKG_RELEASE)"
105 bridge_loop_avoidance \
108 distributed_arp_table \
120 multicast_forceflood \
131 throughput_override \
142 bridge_loop_avoidance \
143 distributed_arp_table \
152 multicast_forceflood \
157 throughput_override \
180 config-extratools
:= \
183 ifeq ($(BUILD_VARIANT
),tiny
)
190 ifeq ($(BUILD_VARIANT
),default
)
199 ifeq ($(BUILD_VARIANT
),full
)
205 $(config-extratools
) \
210 $(subst $(space
),,$(foreach opt
,$(config-
$(1)),CONFIG_
$(opt
)=$(1)
215 $(call ConfigVars
,n
)$(call ConfigVars
,y
)
217 $(eval
$(call shexport
,batctl_config
))
219 MAKE_FLAGS
+= $$$$$(call shvar
,batctl_config
)
221 define Package
/batctl-tiny
/install
222 $(INSTALL_DIR
) $(1)/usr
/libexec
223 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/batctl
$(1)/usr
/libexec
/batctl-tiny
226 define Package
/batctl-default
/install
227 $(INSTALL_DIR
) $(1)/usr
/libexec
228 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/batctl
$(1)/usr
/libexec
/batctl-default
231 define Package
/batctl-full
/install
232 $(INSTALL_DIR
) $(1)/usr
/libexec
233 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/batctl
$(1)/usr
/libexec
/batctl-full
236 $(eval
$(call BuildPackage
,batctl-default
))
237 $(eval
$(call BuildPackage
,batctl-tiny
))
238 $(eval
$(call BuildPackage
,batctl-full
))