Merge pull request #150 from booo/olsrd2_hotplug_fix
[feed/routing.git] / batman-adv / Makefile
1 #
2 # Copyright (C) 2010 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 # $Id: Makefile 5624 2006-11-23 00:29:07Z nbd $
8
9 include $(TOPDIR)/rules.mk
10
11 PKG_NAME:=batman-adv
12
13 PKG_VERSION:=2016.1
14 PKG_RELEASE:=1
15 PKG_MD5SUM:=8c8e449009b4d29512d26ee308960bb5
16
17 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
18 PKG_SOURCE_URL:=https://downloads.open-mesh.org/batman/releases/batman-adv-$(PKG_VERSION)
19 PKG_LICENSE:=GPL-2.0
20
21 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)/$(PKG_NAME)-$(PKG_VERSION)
22
23 include $(INCLUDE_DIR)/package.mk
24 include $(INCLUDE_DIR)/kernel.mk
25
26 define KernelPackage/batman-adv
27 URL:=https://www.open-mesh.org/
28 MAINTAINER:=Marek Lindner <mareklindner@neomailbox.ch>
29 SUBMENU:=Network Support
30 DEPENDS:=+KMOD_BATMAN_ADV_BLA:kmod-lib-crc16 +kmod-crypto-crc32c +kmod-lib-crc32c +kmod-cfg80211
31 TITLE:=B.A.T.M.A.N. Adv
32 FILES:=$(PKG_BUILD_DIR)/net/batman-adv/batman-adv.$(LINUX_KMOD_SUFFIX)
33 AUTOLOAD:=$(call AutoLoad,50,cfg80211 batman-adv)
34 endef
35
36 define KernelPackage/batman-adv/description
37 B.A.T.M.A.N. advanced is a kernel module which allows to
38 build layer 2 mesh networks. This package builds
39 version $(PKG_VERSION) of the kernel module.
40 endef
41
42 define KernelPackage/batman-adv/config
43 source "$(SOURCE)/Config.in"
44 endef
45
46 define Package/kmod-batman-adv/conffiles
47 /etc/config/batman-adv
48 endef
49
50 PKG_EXTRA_KCONFIG:= \
51 CONFIG_BATMAN_ADV=m \
52 CONFIG_BATMAN_ADV_DEBUG=$(if $(CONFIG_KMOD_BATMAN_ADV_DEBUG_LOG),y,n) \
53 CONFIG_BATMAN_ADV_BLA=$(if $(CONFIG_KMOD_BATMAN_ADV_BLA),y,n) \
54 CONFIG_BATMAN_ADV_DAT=$(if $(CONFIG_KMOD_BATMAN_ADV_DAT),y,n) \
55 CONFIG_BATMAN_ADV_MCAST=$(if $(CONFIG_KMOD_BATMAN_ADV_MCAST),y,n) \
56 CONFIG_BATMAN_ADV_NC=$(if $(CONFIG_KMOD_BATMAN_ADV_NC),y,n) \
57 CONFIG_BATMAN_ADV_BATMAN_V=$(if $(CONFIG_KMOD_BATMAN_ADV_BATMAN_V),y,n) \
58
59 PKG_EXTRA_CFLAGS:= \
60 $(patsubst CONFIG_%, -DCONFIG_%=1, $(patsubst %=m,%,$(filter %=m,$(PKG_EXTRA_KCONFIG)))) \
61 $(patsubst CONFIG_%, -DCONFIG_%=1, $(patsubst %=y,%,$(filter %=y,$(PKG_EXTRA_KCONFIG)))) \
62
63 NOSTDINC_FLAGS = \
64 -I$(PKG_BUILD_DIR)/net/batman-adv \
65 -I$(STAGING_DIR)/usr/include/mac80211-backport/uapi \
66 -I$(STAGING_DIR)/usr/include/mac80211-backport \
67 -I$(STAGING_DIR)/usr/include/mac80211/uapi \
68 -I$(STAGING_DIR)/usr/include/mac80211 \
69 -include backport/backport.h \
70 -include $(PKG_BUILD_DIR)/compat-hacks.h
71
72 define Build/Compile
73 +$(MAKE) $(PKG_JOBS) -C "$(LINUX_DIR)" \
74 ARCH="$(LINUX_KARCH)" \
75 CROSS_COMPILE="$(TARGET_CROSS)" \
76 SUBDIRS="$(PKG_BUILD_DIR)/net/batman-adv" \
77 $(PKG_EXTRA_KCONFIG) \
78 EXTRA_CFLAGS="$(PKG_EXTRA_CFLAGS)" \
79 NOSTDINC_FLAGS="$(NOSTDINC_FLAGS)" \
80 modules
81 endef
82
83 define Build/Prepare
84 $(call Build/Prepare/Default)
85 $(CP) ./files/compat-hacks.h $(PKG_BUILD_DIR)/
86 $(SED) '/#define _NET_BATMAN_ADV_MAIN_H_/a\#undef CONFIG_MODULE_STRIPPED' \
87 $(PKG_BUILD_DIR)/net/batman-adv/main.h
88 endef
89
90 define Build/Clean
91 rm -rf $(BUILD_DIR)/$(PKG_NAME)/
92 endef
93
94 define KernelPackage/batman-adv/install
95 $(INSTALL_DIR) $(1)/etc/config $(1)/etc/hotplug.d/net $(1)/etc/hotplug.d/iface $(1)/lib/batman-adv $(1)/usr/sbin $(1)/lib/netifd/proto
96 $(INSTALL_DATA) ./files/etc/config/batman-adv $(1)/etc/config
97 $(INSTALL_DATA) ./files/lib/batman-adv/config.sh $(1)/lib/batman-adv
98 $(INSTALL_BIN) ./files/etc/hotplug.d/net/99-batman-adv $(1)/etc/hotplug.d/net
99 $(INSTALL_BIN) ./files/lib/netifd/proto/batadv.sh $(1)/lib/netifd/proto
100 $(INSTALL_BIN) ./files/lib/netifd/proto/batadv_vlan.sh $(1)/lib/netifd/proto
101 endef
102
103 $(eval $(call KernelPackage,batman-adv))