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
:=997721096ff396644e8d697ea7651e9d38243faf317bcea2661d4139ff58b531
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-default
48 define Package
/batctl-full
49 $(call Package
/batctl
/Default
)
50 TITLE
:=B.A.T.M.A.N. Advanced user space configuration tool
(Full
)
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 \
130 bridge_loop_avoidance \
131 distributed_arp_table \
165 config-extratools
:= \
168 ifeq ($(BUILD_VARIANT
),tiny
)
175 ifeq ($(BUILD_VARIANT
),default
)
184 ifeq ($(BUILD_VARIANT
),full
)
190 $(config-extratools
) \
195 $(subst $(space
),,$(foreach opt
,$(config-
$(1)),CONFIG_
$(opt
)=$(1)
200 $(call ConfigVars
,n
)$(call ConfigVars
,y
)
202 $(eval
$(call shexport
,batctl_config
))
205 $(MAKE_BATCTL_ENV
) $(MAKE
) -C
"$(PKG_BUILD_DIR)" $(MAKE_BATCTL_ARGS
) \
206 $$$$$(call shvar
,batctl_config
)
209 define Package
/batctl-tiny
/install
210 $(INSTALL_DIR
) $(1)/usr
/libexec
211 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/batctl
$(1)/usr
/libexec
/batctl-tiny
214 define Package
/batctl-default
/install
215 $(INSTALL_DIR
) $(1)/usr
/libexec
216 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/batctl
$(1)/usr
/libexec
/batctl-default
219 define Package
/batctl-full
/install
220 $(INSTALL_DIR
) $(1)/usr
/libexec
221 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/batctl
$(1)/usr
/libexec
/batctl-full
224 $(eval
$(call BuildPackage
,batctl-default
))
225 $(eval
$(call BuildPackage
,batctl-tiny
))
226 $(eval
$(call BuildPackage
,batctl-full
))