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
:=2bd93fa14925a8dc63a67e64266c8ccd2fa3ac44b10253d93e6f8a630350070c
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
)-$(BUILD_VARIANT
)/$(PKG_NAME
)-$(PKG_VERSION
)
22 include $(INCLUDE_DIR
)/package.mk
24 define Package
/batctl
/Default
25 URL
:=https
://www.open-mesh.org
/
28 DEPENDS
:=+libnl-tiny
+libc
+librt
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 define Package
/batctl-tiny
41 $(call Package
/batctl
/Default
)
42 TITLE
:=B.A.T.M.A.N. Advanced user space configuration tool
(Minimal
)
45 ALTERNATIVES
:=100:/usr
/sbin
/batctl
:/usr
/libexec
/batctl-tiny
48 define Package
/batctl-tiny
/description
49 $(Package
/batctl
/description
)
50 Only configuration relevant subcommands are enabled.
53 define Package
/batctl-default
54 $(call Package
/batctl
/Default
)
55 TITLE
:=B.A.T.M.A.N. Advanced user space configuration tool
(Default
)
57 ALTERNATIVES
:=200:/usr
/sbin
/batctl
:/usr
/libexec
/batctl-default
60 define Package
/batctl-default
/description
61 $(Package
/batctl
/description
)
62 Standard subcommands for configuration and online debugging are enabled.
65 define Package
/batctl-full
66 $(call Package
/batctl
/Default
)
67 TITLE
:=B.A.T.M.A.N. Advanced user space configuration tool
(Full
)
69 ALTERNATIVES
:=300:/usr
/sbin
/batctl
:/usr
/libexec
/batctl-full
72 define Package
/batctl-full
/description
73 $(Package
/batctl
/description
)
74 Subcommands for configuration
, online and offline debugging are enabled.
77 # The linker can identify unused sections of a binary when each symbol is stored
78 # in a separate section. This mostly removes unused linker sections and reduces
79 # the size by ~3% on mipsel.
81 TARGET_CFLAGS
+= -ffunction-sections
-fdata-sections
82 TARGET_LDFLAGS
+= -Wl
,--gc-sections
84 # Link-time optimization allows to move parts of the optimization from the single
85 # source file to the global source view. This is done by emitting the GIMPLE
86 # representation in each object file and analyzing it again during the link step.
88 TARGET_CFLAGS
+= -flto
89 TARGET_LDFLAGS
+= -fuse-linker-plugin
92 LIBNL_NAME
="libnl-tiny" \
93 LIBNL_GENL_NAME
="libnl-tiny"
96 REVISION
="openwrt-$(PKG_VERSION)-$(PKG_RELEASE)"
104 bridge_loop_avoidance \
107 distributed_arp_table \
119 multicast_forceflood \
130 throughput_override \
141 bridge_loop_avoidance \
142 distributed_arp_table \
151 multicast_forceflood \
156 throughput_override \
179 config-extratools
:= \
182 ifeq ($(BUILD_VARIANT
),tiny
)
189 ifeq ($(BUILD_VARIANT
),default
)
198 ifeq ($(BUILD_VARIANT
),full
)
204 $(config-extratools
) \
209 $(subst $(space
),,$(foreach opt
,$(config-
$(1)),CONFIG_
$(opt
)=$(1)
214 $(call ConfigVars
,n
)$(call ConfigVars
,y
)
216 $(eval
$(call shexport
,batctl_config
))
218 MAKE_FLAGS
+= $$$$$(call shvar
,batctl_config
)
220 define Package
/batctl-tiny
/install
221 $(INSTALL_DIR
) $(1)/usr
/libexec
222 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/batctl
$(1)/usr
/libexec
/batctl-tiny
225 define Package
/batctl-default
/install
226 $(INSTALL_DIR
) $(1)/usr
/libexec
227 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/batctl
$(1)/usr
/libexec
/batctl-default
230 define Package
/batctl-full
/install
231 $(INSTALL_DIR
) $(1)/usr
/libexec
232 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/batctl
$(1)/usr
/libexec
/batctl-full
235 $(eval
$(call BuildPackage
,batctl-default
))
236 $(eval
$(call BuildPackage
,batctl-tiny
))
237 $(eval
$(call BuildPackage
,batctl-full
))