batctl: upgrade package to latest release 2014.3.0
[lede-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:=2014.3.0
13 PKG_RELEASE:=1
14 PKG_MD5SUM:=7d2b8c129424c014d020c4b1a2add31b
15
16 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
17 PKG_SOURCE_URL:=http://downloads.open-mesh.org/batman/releases/batman-adv-$(PKG_VERSION)
18
19 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)/$(PKG_NAME)-$(PKG_VERSION)
20
21 include $(INCLUDE_DIR)/package.mk
22
23 define Package/batctl
24   URL:=http://www.open-mesh.org/
25   SECTION:=net
26   CATEGORY:=Network
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>
30 endef
31
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.
37 endef
38
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.
42
43 TARGET_CFLAGS  += -ffunction-sections -fdata-sections
44 TARGET_LDFLAGS += -Wl,--gc-sections
45
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.
49
50 TARGET_CFLAGS  += -flto
51 TARGET_LDFLAGS += -fuse-linker-plugin
52
53 MAKE_BATCTL_ENV += \
54         CPPFLAGS="$(TARGET_CPPFLAGS)" \
55         CFLAGS="$(TARGET_CFLAGS)" \
56         LDFLAGS="$(TARGET_LDFLAGS)" \
57         LIBNL_NAME="libnl-tiny"
58
59 MAKE_BATCTL_ARGS += \
60         REVISION="$(PKG_BATCTL_SHORTREV)" \
61         CC="$(TARGET_CC)" \
62         DESTDIR="$(PKG_INSTALL_DIR)" \
63         batctl install
64
65
66 define Build/Compile
67         $(MAKE_BATCTL_ENV) $(MAKE) -C "$(PKG_BUILD_DIR)" $(MAKE_BATCTL_ARGS)
68 endef
69
70 define Build/Clean
71         rm -rf $(BUILD_DIR)/$(PKG_NAME)/
72 endef
73
74 define Package/batctl/install
75         $(INSTALL_DIR) $(1)/usr/sbin
76         $(INSTALL_BIN) $(PKG_BUILD_DIR)/batctl $(1)/usr/sbin/
77 endef
78
79 $(eval $(call BuildPackage,batctl))