source: packages/net/batman-adv/Makefile @ 28657

Last change on this file since 28657 was 28657, checked in by nico, 5 years ago

packages/batman-adv: adjust dependency on CRC16 kernel module

File size: 3.7 KB
Line 
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
9include $(TOPDIR)/rules.mk
10
11PKG_NAME:=batman-adv
12
13PKG_VERSION:=2011.3.1
14BATCTL_VERSION:=2011.3.0
15PKG_MD5SUM:=54a5caff56a8380f3070111ce84bbfc4
16BATCTL_MD5SUM:=8eb197896049bb04a6beef56015a16b6
17
18PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
19PKG_SOURCE_URL:=http://downloads.open-mesh.org/batman/releases/batman-adv-$(PKG_VERSION)
20
21PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)/$(PKG_NAME)-$(PKG_VERSION)
22PKG_BATCTL_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)/batctl-$(BATCTL_VERSION)
23
24include $(INCLUDE_DIR)/package.mk
25include $(INCLUDE_DIR)/kernel.mk
26
27define KernelPackage/batman-adv
28  URL:=http://www.open-mesh.org/
29  MAINTAINER:=Marek Lindner <lindner_marek@yahoo.de>
30  SUBMENU:=Network Support
31  DEPENDS:=@!LINUX_2_4 +kmod-lib-crc16
32  TITLE:=B.A.T.M.A.N. Adv
33  FILES:=$(PKG_BUILD_DIR)/batman-adv.$(LINUX_KMOD_SUFFIX)
34  AUTOLOAD:=$(call AutoLoad,50,batman-adv)
35endef
36
37define KernelPackage/batman-adv/description
38B.A.T.M.A.N. advanced is a kernel module which allows to
39build layer 2 mesh networks. This package contains the
40version $(PKG_VERSION) of the kernel module plus its user space
41configuration & managerment tool batctl.
42endef
43
44define KernelPackage/batman-adv/config
45        source "$(SOURCE)/Config.in"
46endef
47
48MAKE_BATMAN_ADV_ARGS += \
49        CROSS_COMPILE="$(TARGET_CROSS)" \
50        ARCH="$(LINUX_KARCH)" \
51        PATH="$(TARGET_PATH)" \
52        $(if $(CONFIG_KMOD_BATMAN_ADV_DEBUG_LOG),EXTRA_CFLAGS="-DCONFIG_BATMAN_ADV_DEBUG") \
53        SUBDIRS="$(PKG_BUILD_DIR)" \
54        LINUX_VERSION="$(LINUX_VERSION)" \
55        REVISION="" modules
56
57MAKE_BATCTL_ARGS += \
58        CFLAGS="$(TARGET_CFLAGS)" \
59        CCFLAGS="$(TARGET_CFLAGS)" \
60        OFLAGS="$(TARGET_CFLAGS)" \
61        REVISION="" \
62        CC="$(TARGET_CC)" \
63        NODEBUG=1 \
64        UNAME="Linux" \
65        DESTDIR="$(PKG_INSTALL_DIR)" \
66        STRIP="/bin/true" \
67        batctl install
68
69ifneq ($(DEVELOPER)$(CONFIG_KMOD_BATMAN_ADV_BATCTL),)
70define Download/batctl
71  FILE:=batctl-$(BATCTL_VERSION).tar.gz
72  URL:=$(PKG_SOURCE_URL)
73  MD5SUM:=$(BATCTL_MD5SUM)
74endef
75$(eval $(call Download,batctl))
76
77EXTRACT_BATCTL = tar xzf "$(DL_DIR)/batctl-$(BATCTL_VERSION).tar.gz" -C "$(BUILD_DIR)/$(PKG_NAME)"
78PATCH_BATCTL = $(call Build/DoPatch,"$(PKG_BATCTL_BUILD_DIR)","$(PATCH_DIR)","*batctl*")
79BUILD_BATCTL = $(MAKE) -C $(PKG_BATCTL_BUILD_DIR) $(MAKE_BATCTL_ARGS)
80endif
81
82KPATCH ?= $(PATCH)
83define Build/DoPatch
84        @if [ -d "$(2)" ]; then \
85                if [ "$$$$(ls $(2) | grep -Ec $(3))" -gt 0 ]; then \
86                        $(KPATCH) "$(1)" "$(2)" "$(3)"; \
87                fi; \
88        fi
89endef
90
91define Build/Patch
92        $(call Build/DoPatch,"$(PKG_BUILD_DIR)","$(PATCH_DIR)","*batman*")
93        $(EXTRACT_BATCTL)
94        $(PATCH_BATCTL)
95endef
96
97define Build/Compile
98        cp $(PKG_BUILD_DIR)/Makefile.kbuild $(PKG_BUILD_DIR)/Makefile
99        $(MAKE) -C "$(LINUX_DIR)" $(MAKE_BATMAN_ADV_ARGS)
100        $(BUILD_BATCTL)
101endef
102
103define Build/Clean
104        rm -rf $(BUILD_DIR)/$(PKG_NAME)/
105endef
106
107ifneq ($(DEVELOPER)$(CONFIG_KMOD_BATMAN_ADV_BATCTL),)
108define KernelPackage/batman-adv/install
109        $(INSTALL_DIR) $(1)/etc/config $(1)/etc/init.d $(1)/lib/batman-adv
110        $(INSTALL_BIN) ./files/etc/init.d/batman-adv $(1)/etc/init.d
111        $(INSTALL_BIN) ./files/lib/batman-adv/config.sh $(1)/lib/batman-adv
112        $(INSTALL_DATA) ./files/etc/config/batman-adv $(1)/etc/config
113        $(INSTALL_DIR) $(1)/usr/sbin
114        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/local/sbin/batctl $(1)/usr/sbin/
115endef
116else
117define KernelPackage/batman-adv/install
118        $(INSTALL_DIR) $(1)/etc/config $(1)/etc/init.d $(1)/lib/batman-adv
119        $(INSTALL_BIN) ./files/etc/init.d/batman-adv $(1)/etc/init.d
120        $(INSTALL_BIN) ./files/lib/batman-adv/config.sh $(1)/lib/batman-adv
121        $(INSTALL_DATA) ./files/etc/config/batman-adv $(1)/etc/config
122endef
123endif
124
125$(eval $(call KernelPackage,batman-adv))
Note: See TracBrowser for help on using the repository browser.