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 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-tiny
34 $(call Package
/batctl
/Default
)
35 TITLE
:=B.A.T.M.A.N. Advanced user space configuration tool
(Minimal
)
38 ALTERNATIVES
:=100:/usr
/sbin
/batctl
:/usr
/libexec
/batctl-tiny
41 define Package
/batctl-default
42 $(call Package
/batctl
/Default
)
43 TITLE
:=B.A.T.M.A.N. Advanced user space configuration tool
(Default
)
45 ALTERNATIVES
:=200:/usr
/sbin
/batctl
:/usr
/libexec
/batctl-full
48 define Package
/batctl-full
49 $(call Package
/batctl
/Default
)
50 TITLE
:=B.A.T.M.A.N. Advanced user space configuration tool
(Minimal
)
52 ALTERNATIVES
:=300:/usr
/sbin
/batctl
:/usr
/libexec
/batctl-full
55 define Package
/batctl
/description
56 batctl is a more intuitive managment utility for B.A.T.M.A.N.
-Advanced.
57 It is an easier method for configuring batman-adv and provides some
58 additional tools for debugging
as well. This package builds
59 version
$(PKG_VERSION
) of the user space utility.
62 # The linker can identify unused sections of a binary when each symbol is stored
63 # in a separate section. This mostly removes unused linker sections and reduces
64 # the size by ~3% on mipsel.
66 TARGET_CFLAGS
+= -ffunction-sections
-fdata-sections
67 TARGET_LDFLAGS
+= -Wl
,--gc-sections
69 # Link-time optimization allows to move parts of the optimization from the single
70 # source file to the global source view. This is done by emitting the GIMPLE
71 # representation in each object file and analyzing it again during the link step.
73 TARGET_CFLAGS
+= -flto
74 TARGET_LDFLAGS
+= -fuse-linker-plugin
77 CPPFLAGS
="$(TARGET_CPPFLAGS)" \
78 CFLAGS
="$(TARGET_CFLAGS)" \
79 LDFLAGS
="$(TARGET_LDFLAGS)" \
80 LIBNL_NAME
="libnl-tiny" \
81 LIBNL_GENL_NAME
="libnl-tiny"
84 REVISION
="$(PKG_BATCTL_SHORTREV)" \
86 DESTDIR
="$(PKG_INSTALL_DIR)" \
88 REVISION
="openwrt-$(PKG_VERSION)-$(PKG_RELEASE)"
96 bridge_loop_avoidance \
99 distributed_arp_table \
129 bridge_loop_avoidance \
130 distributed_arp_table \
163 config-extratools
:= \
166 ifeq ($(BUILD_VARIANT
),tiny
)
173 ifeq ($(BUILD_VARIANT
),default
)
182 ifeq ($(BUILD_VARIANT
),full
)
188 $(config-extratools
) \
193 $(subst $(space
),,$(foreach opt
,$(config-
$(1)),CONFIG_
$(opt
)=$(1)
198 $(call ConfigVars
,n
)$(call ConfigVars
,y
)
200 $(eval
$(call shexport
,batctl_config
))
203 $(MAKE_BATCTL_ENV
) $(MAKE
) -C
"$(PKG_BUILD_DIR)" $(MAKE_BATCTL_ARGS
) \
204 $$$$$(call shvar
,batctl_config
)
207 define Package
/batctl-tiny
/install
208 $(INSTALL_DIR
) $(1)/usr
/libexec
209 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/batctl
$(1)/usr
/libexec
/batctl-tiny
212 define Package
/batctl-default
/install
213 $(INSTALL_DIR
) $(1)/usr
/libexec
214 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/batctl
$(1)/usr
/libexec
/batctl-default
217 define Package
/batctl-full
/install
218 $(INSTALL_DIR
) $(1)/usr
/libexec
219 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/batctl
$(1)/usr
/libexec
/batctl-full
222 $(eval
$(call BuildPackage
,batctl-default
))
223 $(eval
$(call BuildPackage
,batctl-tiny
))
224 $(eval
$(call BuildPackage
,batctl-full
))