batctl: upgrade package to latest release 2016.4
[feed/routing.git] / batctl / Makefile
1 #
2 # Copyright (C) 2014 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=batctl
11
12 PKG_VERSION:=2016.4
13 PKG_RELEASE:=0
14 PKG_MD5SUM:=0112f35b2a48d32f23a17a6f45348e63
15
16 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
17 PKG_SOURCE_URL:=https://downloads.open-mesh.org/batman/releases/batman-adv-$(PKG_VERSION)
18 PKG_LICENSE:=GPL-2.0
19
20 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)/$(PKG_NAME)-$(PKG_VERSION)
21
22 include $(INCLUDE_DIR)/package.mk
23
24 define Package/batctl
25 URL:=https://www.open-mesh.org/
26 SECTION:=net
27 CATEGORY:=Network
28 DEPENDS:=+kmod-batman-adv +libnl-tiny +libc
29 TITLE:=B.A.T.M.A.N. Advanced user space configuration tool batctl
30 MAINTAINER:=Marek Lindner <mareklindner@neomailbox.ch>
31 endef
32
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.
38 endef
39
40 # The linker can identify unused sections of a binary when each symbol is stored
41 # in a separate section. This mostly removes unused linker sections and reduces
42 # the size by ~3% on mipsel.
43
44 TARGET_CFLAGS += -ffunction-sections -fdata-sections
45 TARGET_LDFLAGS += -Wl,--gc-sections
46
47 # Link-time optimization allows to move parts of the optimization from the single
48 # source file to the global source view. This is done by emitting the GIMPLE
49 # representation in each object file and analyzing it again during the link step.
50
51 TARGET_CFLAGS += -flto
52 TARGET_LDFLAGS += -fuse-linker-plugin
53
54 MAKE_BATCTL_ENV += \
55 CPPFLAGS="$(TARGET_CPPFLAGS)" \
56 CFLAGS="$(TARGET_CFLAGS)" \
57 LDFLAGS="$(TARGET_LDFLAGS)" \
58 LIBNL_NAME="libnl-tiny" \
59 LIBNL_GENL_NAME="libnl-tiny"
60
61 MAKE_BATCTL_ARGS += \
62 REVISION="$(PKG_BATCTL_SHORTREV)" \
63 CC="$(TARGET_CC)" \
64 DESTDIR="$(PKG_INSTALL_DIR)" \
65 batctl install
66
67
68 define Build/Compile
69 $(MAKE_BATCTL_ENV) $(MAKE) -C "$(PKG_BUILD_DIR)" $(MAKE_BATCTL_ARGS)
70 endef
71
72 define Build/Clean
73 rm -rf $(BUILD_DIR)/$(PKG_NAME)/
74 endef
75
76 define Package/batctl/install
77 $(INSTALL_DIR) $(1)/usr/sbin
78 $(INSTALL_BIN) $(PKG_BUILD_DIR)/batctl $(1)/usr/sbin/
79 endef
80
81 $(eval $(call BuildPackage,batctl))