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_MD5SUM
:=c196cf95b7324d9123b701a56b06b31d
16 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
).
tar.gz
17 PKG_SOURCE_URL
:=http
://downloads.open-mesh.org
/batman
/releases
/batman-adv-
$(PKG_VERSION
)
19 PKG_BUILD_DIR
:=$(BUILD_DIR
)/$(PKG_NAME
)/$(PKG_NAME
)-$(PKG_VERSION
)
21 include $(INCLUDE_DIR
)/package.mk
24 URL
:=http
://www.open-mesh.org
/
27 DEPENDS
:=+kmod-batman-adv
+libnl-tiny
+libc
28 TITLE
:=B.A.T.M.A.N. Advanced user space configuration tool batctl
29 MAINTAINER
:=Marek Lindner
<mareklindner@neomailbox.ch
>
32 define Package
/batctl
/description
33 batctl is a more intuitive managment utility for B.A.T.M.A.N.
-Advanced.
34 It is an easier method for configuring batman-adv and provides some
35 additional tools for debugging
as well. This package builds
36 version
$(PKG_VERSION
) of the user space utility.
39 # The linker can identify unused sections of a binary when each symbol is stored
40 # in a separate section. This mostly removes unused linker sections and reduces
41 # the size by ~3% on mipsel.
43 TARGET_CFLAGS
+= -ffunction-sections
-fdata-sections
44 TARGET_LDFLAGS
+= -Wl
,--gc-sections
46 # Link-time optimization allows to move parts of the optimization from the single
47 # source file to the global source view. This is done by emitting the GIMPLE
48 # representation in each object file and analyzing it again during the link step.
50 TARGET_CFLAGS
+= -flto
51 TARGET_LDFLAGS
+= -fuse-linker-plugin
54 CPPFLAGS
="$(TARGET_CPPFLAGS)" \
55 CFLAGS
="$(TARGET_CFLAGS)" \
56 LDFLAGS
="$(TARGET_LDFLAGS)" \
57 LIBNL_NAME
="libnl-tiny"
60 REVISION
="$(PKG_BATCTL_SHORTREV)" \
62 DESTDIR
="$(PKG_INSTALL_DIR)" \
67 $(MAKE_BATCTL_ENV
) $(MAKE
) -C
"$(PKG_BUILD_DIR)" $(MAKE_BATCTL_ARGS
)
71 rm -rf
$(BUILD_DIR
)/$(PKG_NAME
)/
74 define Package
/batctl
/install
75 $(INSTALL_DIR
) $(1)/usr
/sbin
76 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/batctl
$(1)/usr
/sbin
/
79 $(eval
$(call BuildPackage
,batctl
))