1 # SPDX-License-Identifier: GPL-2.0-only
3 include $(TOPDIR
)/rules.mk
7 PKG_RELEASE
:=$(AUTORELEASE
)
9 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
).
tar.gz
10 PKG_SOURCE_URL
:=https
://downloads.open-mesh.org
/batman
/releases
/batman-adv-
$(PKG_VERSION
)
11 PKG_HASH
:=87e89a938971b862422681bb34104e9b2b4b6512d1d165de953630df38d61a68
12 PKG_BUILD_DIR
:=$(BUILD_DIR
)/$(PKG_NAME
)-$(BUILD_VARIANT
)/$(PKG_NAME
)-$(PKG_VERSION
)
14 PKG_MAINTAINER
:=Simon Wunderlich
<sw@simonwunderlich.de
>
15 PKG_LICENSE
:=GPL-2.0
-only ISC MIT
16 PKG_LICENSE_FILES
:=LICENSES
/preferred
/GPL-2.0 LICENSES
/preferred
/MIT LICENSES
/deprecated
/ISC
20 include $(INCLUDE_DIR
)/package.mk
22 define Package
/batctl
/Default
25 URL
:=https
://www.open-mesh.org
/
26 DEPENDS
:=+libnl-tiny
+libc
+librt
30 define Package
/batctl
/description
31 batctl is a more intuitive managment utility for B.A.T.M.A.N.
-Advanced.
32 It is an easier method for configuring batman-adv and provides some
33 additional tools for debugging
as well. This package builds
34 version
$(PKG_VERSION
) of the user space utility.
37 define Package
/batctl-tiny
38 $(call Package
/batctl
/Default
)
39 TITLE
:=B.A.T.M.A.N. Advanced user space configuration tool
(Minimal
)
41 ALTERNATIVES
:=100:/usr
/sbin
/batctl
:/usr
/libexec
/batctl-tiny
44 define Package
/batctl-tiny
/description
45 $(Package
/batctl
/description
)
46 Only configuration relevant subcommands are enabled.
49 define Package
/batctl-default
50 $(call Package
/batctl
/Default
)
51 TITLE
:=B.A.T.M.A.N. Advanced user space configuration tool
(Default
)
53 ALTERNATIVES
:=200:/usr
/sbin
/batctl
:/usr
/libexec
/batctl-default
56 define Package
/batctl-default
/description
57 $(Package
/batctl
/description
)
58 Standard subcommands for configuration and online debugging are enabled.
61 define Package
/batctl-full
62 $(call Package
/batctl
/Default
)
63 TITLE
:=B.A.T.M.A.N. Advanced user space configuration tool
(Full
)
65 ALTERNATIVES
:=300:/usr
/sbin
/batctl
:/usr
/libexec
/batctl-full
68 define Package
/batctl-full
/description
69 $(Package
/batctl
/description
)
70 Subcommands for configuration
, online and offline debugging are enabled.
73 # The linker can identify unused sections of a binary when each symbol is stored
74 # in a separate section. This mostly removes unused linker sections and reduces
75 # the size by ~3% on mipsel.
77 TARGET_CFLAGS
+= -ffunction-sections
-fdata-sections
78 TARGET_LDFLAGS
+= -Wl
,--gc-sections
80 # Link-time optimization allows to move parts of the optimization from the single
81 # source file to the global source view. This is done by emitting the GIMPLE
82 # representation in each object file and analyzing it again during the link step.
84 TARGET_CFLAGS
+= -flto
85 TARGET_LDFLAGS
+= -fuse-linker-plugin
88 LIBNL_NAME
="libnl-tiny" \
89 LIBNL_GENL_NAME
="libnl-tiny"
92 REVISION
="$(PKG_VERSION)-openwrt-$(PKG_RELEASE)"
102 bridge_loop_avoidance \
106 distributed_arp_table \
123 multicast_forceflood \
135 throughput_override \
141 transtable_global_json \
142 transtable_local_json \
149 bridge_loop_avoidance \
150 distributed_arp_table \
159 multicast_forceflood \
164 throughput_override \
189 transtable_global_json \
190 transtable_local_json \
201 config-extratools
:= \
204 ifeq ($(BUILD_VARIANT
),tiny
)
211 ifeq ($(BUILD_VARIANT
),default
)
221 ifeq ($(BUILD_VARIANT
),full
)
228 $(config-extratools
) \
233 $(subst $(space
),,$(foreach opt
,$(config-
$(1)),CONFIG_
$(opt
)=$(1)
238 $(call ConfigVars
,n
)$(call ConfigVars
,y
)
240 $(eval
$(call shexport
,batctl_config
))
242 MAKE_FLAGS
+= $$$$$(call shvar
,batctl_config
)
244 define Package
/batctl-tiny
/install
245 $(INSTALL_DIR
) $(1)/usr
/libexec
246 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/batctl
$(1)/usr
/libexec
/batctl-tiny
249 define Package
/batctl-default
/install
250 $(INSTALL_DIR
) $(1)/usr
/libexec
251 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/batctl
$(1)/usr
/libexec
/batctl-default
254 define Package
/batctl-full
/install
255 $(INSTALL_DIR
) $(1)/usr
/libexec
256 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/batctl
$(1)/usr
/libexec
/batctl-full
259 $(eval
$(call BuildPackage
,batctl-default
))
260 $(eval
$(call BuildPackage
,batctl-tiny
))
261 $(eval
$(call BuildPackage
,batctl-full
))