2008-01-21 00:56:34 +00:00
|
|
|
#
|
2008-03-16 18:32:13 +00:00
|
|
|
# Copyright (C) 2008 OpenWrt.org
|
2007-07-31 21:14:30 +00:00
|
|
|
#
|
|
|
|
# This is free software, licensed under the GNU General Public License v2.
|
|
|
|
# See /LICENSE for more information.
|
|
|
|
#
|
2009-04-21 19:16:40 +00:00
|
|
|
# $Id: Makefile 5624 2006-11-23 00:29:07Z nbd $
|
2007-07-31 21:14:30 +00:00
|
|
|
|
|
|
|
include $(TOPDIR)/rules.mk
|
|
|
|
|
2009-03-10 15:48:41 +00:00
|
|
|
PKG_NAME:=batman-adv
|
2010-01-28 05:52:18 +00:00
|
|
|
PKG_REV:=1568
|
2008-01-21 00:56:34 +00:00
|
|
|
PKG_VERSION:=r$(PKG_REV)
|
2007-07-31 21:14:30 +00:00
|
|
|
PKG_RELEASE:=1
|
|
|
|
|
2010-01-28 05:52:18 +00:00
|
|
|
PKG_SOURCE_SUBDIR:=$(PKG_NAME)
|
|
|
|
|
|
|
|
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
|
|
|
|
PKG_TOOL_VERSION=$(PKG_REV)
|
|
|
|
|
|
|
|
ifneq ($(CONFIG_BATMAN_ADV_DEV),)
|
|
|
|
PKG_KMOD_VERSION=060c4d34077550d57cd57c5375dd5f8758391eb5
|
|
|
|
PKG_KMOD_FNAME=batman-adv-dev-$(PKG_REV).tar.gz
|
|
|
|
PKG_TOOL_URL=http://downloads.open-mesh.org/svn/batman/trunk/batctl
|
|
|
|
PKG_TOOL_FNAME:=batctl-dev-$(PKG_TOOL_VERSION).tar.gz
|
|
|
|
else
|
|
|
|
PKG_KMOD_VERSION=1b58d49b4342caabb9624243bc76e037eaac2673
|
|
|
|
PKG_KMOD_FNAME=batman-adv-maint-$(PKG_REV).tar.gz
|
|
|
|
PKG_TOOL_URL=http://downloads.open-mesh.org/svn/batman/branches/batctl-0.2.x/
|
|
|
|
PKG_TOOL_FNAME:=batctl-maint-$(PKG_TOOL_VERSION).tar.gz
|
|
|
|
endif
|
2007-07-31 21:14:30 +00:00
|
|
|
|
2010-01-28 05:52:18 +00:00
|
|
|
PKG_KMOD_BUILD_DIR:=$(PKG_BUILD_DIR)/batman-adv-kernelland
|
|
|
|
PKG_TOOL_BUILD_DIR:=$(PKG_BUILD_DIR)/batctl
|
2008-01-21 00:56:34 +00:00
|
|
|
|
2007-07-31 21:14:30 +00:00
|
|
|
include $(INCLUDE_DIR)/package.mk
|
2008-01-21 00:56:34 +00:00
|
|
|
include $(INCLUDE_DIR)/kernel.mk
|
2007-07-31 21:14:30 +00:00
|
|
|
|
2010-01-31 02:21:37 +00:00
|
|
|
# have to set this variable after including the Makefiles
|
|
|
|
ifneq ($(CONFIG_BATMAN_ADV_DEV),)
|
|
|
|
STAMP_PREPARED:=$(STAMP_PREPARED)_dev
|
|
|
|
else
|
|
|
|
STAMP_PREPARED:=$(STAMP_PREPARED)_maint
|
|
|
|
endif
|
|
|
|
STAMP_PREPARED:=$(STAMP_PREPARED)$(if $(CONFIG_KMOD_BATMAN_ADV_BATCTL),_batctl)
|
|
|
|
STAMP_BUILT:=$(STAMP_BUILT)$(if $(CONFIG_KMOD_BATMAN_ADV_DEBUG_LOG),_debug)
|
|
|
|
|
2008-01-21 00:56:34 +00:00
|
|
|
define Package/batman-adv/Default
|
2010-01-28 05:52:18 +00:00
|
|
|
URL:=http://www.open-mesh.org/
|
2008-01-21 00:56:34 +00:00
|
|
|
MAINTAINER:=Marek Lindner <lindner_marek@yahoo.de>
|
2007-07-31 21:14:30 +00:00
|
|
|
endef
|
|
|
|
|
2009-03-09 05:50:38 +00:00
|
|
|
define KernelPackage/batman-adv-kernelland
|
2008-01-21 00:56:34 +00:00
|
|
|
$(call Package/batman-adv/Default)
|
2008-03-16 18:32:13 +00:00
|
|
|
SUBMENU:=Network Support
|
2008-01-21 00:56:34 +00:00
|
|
|
DEPENDS:=@LINUX_2_6
|
2009-05-18 17:49:15 +00:00
|
|
|
TITLE:=B.A.T.M.A.N. layer 2
|
2009-01-01 17:55:45 +00:00
|
|
|
FILES:=$(PKG_KMOD_BUILD_DIR)/batman-adv.$(LINUX_KMOD_SUFFIX)
|
|
|
|
AUTOLOAD:=$(call AutoLoad,50,batman-adv)
|
2008-01-21 00:56:34 +00:00
|
|
|
endef
|
|
|
|
|
2010-01-10 02:32:03 +00:00
|
|
|
define KernelPackage/batman-adv-kernelland/config
|
|
|
|
source "$(SOURCE)/Config.in"
|
|
|
|
endef
|
2008-01-21 00:56:34 +00:00
|
|
|
|
2009-03-09 05:50:38 +00:00
|
|
|
define KernelPackage/batman-adv-kernelland/description
|
2009-05-18 17:49:15 +00:00
|
|
|
B.A.T.M.A.N. layer 2
|
2008-01-21 00:56:34 +00:00
|
|
|
endef
|
|
|
|
|
2010-01-28 05:52:18 +00:00
|
|
|
define Download/batman-adv-kernelland
|
2010-01-10 02:32:03 +00:00
|
|
|
FILE:=$(PKG_KMOD_FNAME)
|
2010-01-28 05:52:18 +00:00
|
|
|
URL:=http://git.open-mesh.org/snapshot/$(PKG_KMOD_VERSION)/
|
|
|
|
endef
|
|
|
|
$(eval $(call Download,batman-adv-kernelland))
|
|
|
|
|
|
|
|
ifneq ($(DEVELOPER)$(CONFIG_KMOD_BATMAN_ADV_BATCTL),)
|
|
|
|
define Download/batctl
|
|
|
|
FILE:=$(PKG_TOOL_FNAME)
|
|
|
|
URL:=$(PKG_TOOL_URL)
|
|
|
|
PROTO:=svn
|
|
|
|
VERSION:=$(PKG_TOOL_VERSION)
|
|
|
|
SUBDIR:=$(PKG_SOURCE_SUBDIR)/batctl
|
|
|
|
endef
|
|
|
|
$(eval $(call Download,batctl))
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq ($(DEVELOPER)$(CONFIG_KMOD_BATMAN_ADV_BATCTL),)
|
|
|
|
ifneq ($(DEVELOPER)$(CONFIG_BATMAN_ADV_DEV),)
|
|
|
|
define Download/batman
|
|
|
|
FILE:=batman-$(PKG_REV).tar.gz
|
|
|
|
URL:=http://downloads.open-mesh.org/svn/batman/trunk/batman
|
|
|
|
PROTO:=svn
|
|
|
|
VERSION:=$(PKG_REV)
|
|
|
|
SUBDIR:=$(PKG_SOURCE_SUBDIR)/batman
|
|
|
|
endef
|
|
|
|
$(eval $(call Download,batman))
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
define Build/Prepare
|
|
|
|
tar xzf "$(DL_DIR)/$(PKG_KMOD_FNAME)" -C "$(PKG_BUILD_DIR)"
|
|
|
|
ifneq ($(DEVELOPER)$(CONFIG_KMOD_BATMAN_ADV_BATCTL),)
|
|
|
|
tar xzf "$(DL_DIR)/$(PKG_TOOL_FNAME)" -C "$(BUILD_DIR)"
|
|
|
|
ifneq ($(DEVELOPER)$(CONFIG_BATMAN_ADV_DEV),)
|
|
|
|
tar xzf "$(DL_DIR)/batman-$(PKG_REV).tar.gz" -C "$(BUILD_DIR)"
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
mv "$(PKG_BUILD_DIR)/batman-adv" "$(PKG_KMOD_BUILD_DIR)"
|
|
|
|
cp $(PKG_KMOD_BUILD_DIR)/Makefile.kbuild $(PKG_KMOD_BUILD_DIR)/Makefile
|
|
|
|
$(call PatchDir,$(PKG_BUILD_DIR),$(PATCH_DIR),)
|
|
|
|
ifneq ($(CONFIG_BATMAN_ADV_DEV),)
|
|
|
|
$(call PatchDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/dev,)
|
|
|
|
else
|
|
|
|
$(call PatchDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/maint,)
|
|
|
|
endif
|
2010-01-10 02:32:03 +00:00
|
|
|
endef
|
|
|
|
|
2009-04-21 19:16:40 +00:00
|
|
|
MAKE_BATADV_KERNELLAND_ARGS += \
|
2009-02-07 20:51:42 +00:00
|
|
|
CROSS_COMPILE="$(TARGET_CROSS)" \
|
|
|
|
ARCH="$(LINUX_KARCH)" \
|
|
|
|
PATH="$(TARGET_PATH)" \
|
2010-01-28 05:52:18 +00:00
|
|
|
$(if $(CONFIG_KMOD_BATMAN_ADV_DEBUG_LOG),EXTRA_CFLAGS="-DCONFIG_BATMAN_ADV_DEBUG") \
|
2009-02-07 20:51:42 +00:00
|
|
|
SUBDIRS="$(PKG_KMOD_BUILD_DIR)" \
|
|
|
|
LINUX_VERSION="$(LINUX_VERSION)" \
|
|
|
|
REVISION="$(PKG_REV)" modules
|
2007-07-31 21:14:30 +00:00
|
|
|
|
2009-07-03 15:17:39 +00:00
|
|
|
MAKE_BATCTL_ARGS += \
|
2008-01-21 00:56:34 +00:00
|
|
|
CFLAGS="$(TARGET_CFLAGS)" \
|
|
|
|
CCFLAGS="$(TARGET_CFLAGS)" \
|
|
|
|
OFLAGS="$(TARGET_CFLAGS)" \
|
|
|
|
REVISION="$(PKG_REV)" \
|
|
|
|
CC="$(TARGET_CC)" \
|
|
|
|
NODEBUG=1 \
|
|
|
|
UNAME="Linux" \
|
|
|
|
INSTALL_PREFIX="$(PKG_INSTALL_DIR)" \
|
|
|
|
STRIP="/bin/true" \
|
2009-07-03 15:17:39 +00:00
|
|
|
batctl install
|
2008-01-21 00:56:34 +00:00
|
|
|
|
|
|
|
define Build/Configure
|
|
|
|
endef
|
|
|
|
|
2009-05-18 17:49:15 +00:00
|
|
|
ifneq ($(DEVELOPER)$(CONFIG_PACKAGE_kmod-batman-adv-kernelland),)
|
2009-04-21 19:16:40 +00:00
|
|
|
BUILD_KMOD_ADV = $(MAKE) -C "$(LINUX_DIR)" $(MAKE_BATADV_KERNELLAND_ARGS)
|
2009-07-03 15:17:39 +00:00
|
|
|
BUILD_BATCTL = $(MAKE) -C $(PKG_TOOL_BUILD_DIR) $(MAKE_BATCTL_ARGS)
|
2009-02-07 20:51:42 +00:00
|
|
|
endif
|
|
|
|
|
2008-01-21 00:56:34 +00:00
|
|
|
define Build/Compile
|
2009-02-07 20:51:42 +00:00
|
|
|
$(BUILD_KMOD_ADV)
|
2010-01-28 05:52:18 +00:00
|
|
|
ifneq ($(DEVELOPER)$(CONFIG_KMOD_BATMAN_ADV_BATCTL),)
|
2009-07-03 15:17:39 +00:00
|
|
|
$(BUILD_BATCTL)
|
2010-01-28 05:52:18 +00:00
|
|
|
endif
|
2008-01-21 00:56:34 +00:00
|
|
|
endef
|
|
|
|
|
2010-01-10 02:32:03 +00:00
|
|
|
define Build/Clean
|
|
|
|
rm -rf $(PKG_KMOD_BUILD_DIR)
|
|
|
|
endef
|
|
|
|
|
2009-03-10 16:58:27 +00:00
|
|
|
define KernelPackage/batman-adv-kernelland/install
|
2010-01-28 05:52:18 +00:00
|
|
|
$(INSTALL_DIR) $(1)/etc/config $(1)/etc/init.d
|
2009-03-10 15:48:41 +00:00
|
|
|
$(INSTALL_BIN) ./files/etc/init.d/batman-adv-kernelland $(1)/etc/init.d
|
|
|
|
$(INSTALL_DATA) ./files/etc/config/batman-adv-kernelland $(1)/etc/config
|
2010-01-28 05:52:18 +00:00
|
|
|
ifneq ($(DEVELOPER)$(CONFIG_KMOD_BATMAN_ADV_BATCTL),)
|
|
|
|
$(INSTALL_DIR) $(1)/usr/sbin
|
2009-07-03 15:17:39 +00:00
|
|
|
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/batctl $(1)/usr/sbin/
|
2010-01-28 05:52:18 +00:00
|
|
|
endif
|
2008-01-21 00:56:34 +00:00
|
|
|
endef
|
|
|
|
|
2009-03-09 05:50:38 +00:00
|
|
|
$(eval $(call KernelPackage,batman-adv-kernelland))
|