openwrt-routing/batctl/Makefile

77 lines
2.3 KiB
Makefile

#
# Copyright (C) 2014 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=batctl
PKG_VERSION:=2018.4
PKG_RELEASE:=1
PKG_HASH:=e43827a5e868b4e134e77ca04da989fde1981463166bf1b6f2053acc3edd6257
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://downloads.open-mesh.org/batman/releases/batman-adv-$(PKG_VERSION)
PKG_LICENSE:=GPL-2.0
include $(INCLUDE_DIR)/package.mk
define Package/batctl
URL:=https://www.open-mesh.org/
SECTION:=net
CATEGORY:=Network
DEPENDS:=+kmod-batman-adv +libnl-tiny +libc +librt
TITLE:=B.A.T.M.A.N. Advanced user space configuration tool batctl
MAINTAINER:=Simon Wunderlich <sw@simonwunderlich.de>
endef
define Package/batctl/description
batctl is a more intuitive managment utility for B.A.T.M.A.N.-Advanced.
It is an easier method for configuring batman-adv and provides some
additional tools for debugging as well. This package builds
version $(PKG_VERSION) of the user space utility.
endef
# The linker can identify unused sections of a binary when each symbol is stored
# in a separate section. This mostly removes unused linker sections and reduces
# the size by ~3% on mipsel.
TARGET_CFLAGS += -ffunction-sections -fdata-sections
TARGET_LDFLAGS += -Wl,--gc-sections
# Link-time optimization allows to move parts of the optimization from the single
# source file to the global source view. This is done by emitting the GIMPLE
# representation in each object file and analyzing it again during the link step.
TARGET_CFLAGS += -flto
TARGET_LDFLAGS += -fuse-linker-plugin
MAKE_BATCTL_ENV += \
CPPFLAGS="$(TARGET_CPPFLAGS)" \
CFLAGS="$(TARGET_CFLAGS)" \
LDFLAGS="$(TARGET_LDFLAGS)" \
LIBNL_NAME="libnl-tiny" \
LIBNL_GENL_NAME="libnl-tiny"
MAKE_BATCTL_ARGS += \
REVISION="$(PKG_BATCTL_SHORTREV)" \
CC="$(TARGET_CC)" \
DESTDIR="$(PKG_INSTALL_DIR)" \
batctl install \
REVISION="openwrt-$(PKG_VERSION)-$(PKG_RELEASE)"
define Build/Compile
$(MAKE_BATCTL_ENV) $(MAKE) -C "$(PKG_BUILD_DIR)" $(MAKE_BATCTL_ARGS)
endef
define Package/batctl/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/batctl $(1)/usr/sbin/
endef
$(eval $(call BuildPackage,batctl))