e689d72516798e8137985685b8b76db8fea34dd8
[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
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=batman-adv
11
12 PKG_VERSION:=2019.2
13 PKG_RELEASE:=5
14 PKG_HASH:=70c3f6a6cf88d2b25681a76768a52ed92d9fe992ba8e358368b6a8088757adc8
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 PKG_EXTMOD_SUBDIRS=net/batman-adv
20
21 STAMP_CONFIGURED_DEPENDS := $(STAGING_DIR)/usr/include/mac80211-backport/backport/autoconf.h
22
23 include $(INCLUDE_DIR)/kernel.mk
24 include $(INCLUDE_DIR)/package.mk
25
26 define KernelPackage/batman-adv
27 URL:=https://www.open-mesh.org/
28 MAINTAINER:=Simon Wunderlich <sw@simonwunderlich.de>
29 SUBMENU:=Network Support
30 DEPENDS:=+BATMAN_ADV_BLA:kmod-lib-crc16 +kmod-lib-crc32c +kmod-cfg80211 +batctl
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 AutoProbe,batman-adv)
34 endef
35
36 define KernelPackage/batman-adv/description
37 B.A.T.M.A.N. (better approach to mobile ad-hoc networking) is
38 a routing protocol for multi-hop ad-hoc mesh networks. The
39 networks may be wired or wireless. See
40 https://www.open-mesh.org/ for more information and user space
41 tools. This package builds version $(PKG_VERSION) of the kernel
42 module.
43 endef
44
45 define KernelPackage/batman-adv/config
46 source "$(SOURCE)/Config.in"
47 endef
48
49 define Package/kmod-batman-adv/conffiles
50 /etc/config/batman-adv
51 endef
52
53 PKG_EXTRA_KCONFIG:= \
54 CONFIG_BATMAN_ADV=m \
55 CONFIG_BATMAN_ADV_DEBUG=$(if $(CONFIG_BATMAN_ADV_DEBUG),y,n) \
56 CONFIG_BATMAN_ADV_DEBUGFS=$(if $(CONFIG_BATMAN_ADV_DEBUGFS),y,n) \
57 CONFIG_BATMAN_ADV_BLA=$(if $(CONFIG_BATMAN_ADV_BLA),y,n) \
58 CONFIG_BATMAN_ADV_DAT=$(if $(CONFIG_BATMAN_ADV_DAT),y,n) \
59 CONFIG_BATMAN_ADV_MCAST=$(if $(CONFIG_BATMAN_ADV_MCAST),y,n) \
60 CONFIG_BATMAN_ADV_NC=$(if $(CONFIG_BATMAN_ADV_NC),y,n) \
61 CONFIG_BATMAN_ADV_BATMAN_V=$(if $(CONFIG_BATMAN_ADV_BATMAN_V),y,n) \
62 CONFIG_BATMAN_ADV_SYSFS=$(if $(CONFIG_BATMAN_ADV_SYSFS),y,n) \
63 CONFIG_BATMAN_ADV_TRACING=$(if $(CONFIG_BATMAN_ADV_TRACING),y,n) \
64
65 PKG_EXTRA_CFLAGS:= \
66 $(patsubst CONFIG_%, -DCONFIG_%=1, $(patsubst %=m,%,$(filter %=m,$(PKG_EXTRA_KCONFIG)))) \
67 $(patsubst CONFIG_%, -DCONFIG_%=1, $(patsubst %=y,%,$(filter %=y,$(PKG_EXTRA_KCONFIG)))) \
68
69 NOSTDINC_FLAGS = \
70 -I$(PKG_BUILD_DIR)/net/batman-adv \
71 -I$(STAGING_DIR)/usr/include/mac80211-backport \
72 -I$(STAGING_DIR)/usr/include/mac80211-backport/uapi \
73 -I$(STAGING_DIR)/usr/include/mac80211 \
74 -I$(STAGING_DIR)/usr/include/mac80211/uapi \
75 -I$(PKG_BUILD_DIR)/include/ \
76 -include backport/backport.h \
77 -include $(PKG_BUILD_DIR)/compat-hacks.h \
78 -DBATADV_SOURCE_VERSION=\\\"openwrt-$(PKG_VERSION)-$(PKG_RELEASE)\\\"
79
80 COMPAT_SOURCES = \
81 $(if $(CONFIG_BATMAN_ADV_MCAST),../../compat-sources/net/core/skbuff.o,) \
82 $(if $(CONFIG_BATMAN_ADV_MCAST),../../compat-sources/net/ipv4/igmp.o,) \
83 $(if $(CONFIG_BATMAN_ADV_MCAST),../../compat-sources/net/ipv6/mcast_snoop.o,) \
84
85 define Build/Compile
86 +env "batman-adv-y=$(COMPAT_SOURCES)" \
87 $(MAKE) $(PKG_JOBS) -C "$(LINUX_DIR)" \
88 ARCH="$(LINUX_KARCH)" \
89 CROSS_COMPILE="$(TARGET_CROSS)" \
90 SUBDIRS="$(PKG_BUILD_DIR)/net/batman-adv" \
91 $(PKG_EXTRA_KCONFIG) \
92 EXTRA_CFLAGS="$(PKG_EXTRA_CFLAGS)" \
93 NOSTDINC_FLAGS="$(NOSTDINC_FLAGS)" \
94 modules
95 endef
96
97 define KernelPackage/batman-adv/install
98 $(CP) ./files/. $(1)/
99 endef
100
101 $(eval $(call KernelPackage,batman-adv))