source: packages/net/batman-advanced/Makefile @ 20380

Last change on this file since 20380 was 20380, checked in by marek, 7 years ago

batman-adv: update maint branch to version 0.2.1

File size: 4.8 KB
Line 
1#
2# Copyright (C) 2008 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
12PKG_REV:=1611
13PKG_VERSION:=r$(PKG_REV)
14PKG_RELEASE:=1
15
16PKG_SOURCE_SUBDIR:=$(PKG_NAME)
17
18PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
19PKG_TOOL_VERSION=$(PKG_REV)
20
21ifneq ($(CONFIG_BATMAN_ADV_DEV),)
22        PKG_KMOD_VERSION=f9c84f3d20df87f4ebbc38b754b6b13fc1593ce2
23        PKG_KMOD_FNAME=batman-adv-dev-$(PKG_REV).tar.gz
24        PKG_TOOL_URL=http://downloads.open-mesh.org/svn/batman/trunk/batctl
25        PKG_TOOL_FNAME:=batctl-dev-$(PKG_TOOL_VERSION).tar.gz
26else
27        PKG_KMOD_VERSION=5c4633c532a7a9b5adfe5dbf3f5e97fff307216e
28        PKG_KMOD_FNAME=batman-adv-maint-$(PKG_REV).tar.gz
29        PKG_TOOL_URL=http://downloads.open-mesh.org/svn/batman/branches/batctl-0.2.x/
30        PKG_TOOL_FNAME:=batctl-maint-$(PKG_TOOL_VERSION).tar.gz
31endif
32
33PKG_KMOD_BUILD_DIR:=$(PKG_BUILD_DIR)/batman-adv-kernelland
34PKG_TOOL_BUILD_DIR:=$(PKG_BUILD_DIR)/batctl
35
36include $(INCLUDE_DIR)/package.mk
37include $(INCLUDE_DIR)/kernel.mk
38
39# have to set this variable after including the Makefiles
40ifneq ($(CONFIG_BATMAN_ADV_DEV),)
41        STAMP_PREPARED:=$(STAMP_PREPARED)_dev
42else
43        STAMP_PREPARED:=$(STAMP_PREPARED)_maint
44endif
45STAMP_PREPARED:=$(STAMP_PREPARED)$(if $(CONFIG_KMOD_BATMAN_ADV_BATCTL),_batctl)
46STAMP_BUILT:=$(STAMP_BUILT)$(if $(CONFIG_KMOD_BATMAN_ADV_DEBUG_LOG),_debug)
47
48define Package/batman-adv/Default
49  URL:=http://www.open-mesh.org/
50  MAINTAINER:=Marek Lindner <lindner_marek@yahoo.de>
51endef
52
53define KernelPackage/batman-adv-kernelland
54$(call Package/batman-adv/Default)
55  SUBMENU:=Network Support
56  DEPENDS:=@LINUX_2_6
57  TITLE:=B.A.T.M.A.N. layer 2
58  FILES:=$(PKG_KMOD_BUILD_DIR)/batman-adv.$(LINUX_KMOD_SUFFIX)
59  AUTOLOAD:=$(call AutoLoad,50,batman-adv)
60endef
61
62define KernelPackage/batman-adv-kernelland/config
63        source "$(SOURCE)/Config.in"
64endef
65
66define KernelPackage/batman-adv-kernelland/description
67B.A.T.M.A.N. layer 2
68endef
69
70define Download/batman-adv-kernelland
71  FILE:=$(PKG_KMOD_FNAME)
72  URL:=http://git.open-mesh.org/snapshot/$(PKG_KMOD_VERSION)/
73endef
74$(eval $(call Download,batman-adv-kernelland))
75
76ifneq ($(DEVELOPER)$(CONFIG_KMOD_BATMAN_ADV_BATCTL),)
77define Download/batctl
78  FILE:=$(PKG_TOOL_FNAME)
79  URL:=$(PKG_TOOL_URL)
80  PROTO:=svn
81  VERSION:=$(PKG_TOOL_VERSION)
82  SUBDIR:=$(PKG_SOURCE_SUBDIR)/batctl
83endef
84$(eval $(call Download,batctl))
85endif
86
87ifneq ($(DEVELOPER)$(CONFIG_KMOD_BATMAN_ADV_BATCTL),)
88ifneq ($(DEVELOPER)$(CONFIG_BATMAN_ADV_DEV),)
89define Download/batman
90  FILE:=batman-$(PKG_REV).tar.gz
91  URL:=http://downloads.open-mesh.org/svn/batman/trunk/batman
92  PROTO:=svn
93  VERSION:=$(PKG_REV)
94  SUBDIR:=$(PKG_SOURCE_SUBDIR)/batman
95endef
96$(eval $(call Download,batman))
97endif
98endif
99
100define Build/Prepare
101        tar xzf "$(DL_DIR)/$(PKG_KMOD_FNAME)" -C "$(PKG_BUILD_DIR)"
102ifneq ($(DEVELOPER)$(CONFIG_KMOD_BATMAN_ADV_BATCTL),)
103        tar xzf "$(DL_DIR)/$(PKG_TOOL_FNAME)" -C "$(BUILD_DIR)"
104ifneq ($(DEVELOPER)$(CONFIG_BATMAN_ADV_DEV),)
105        tar xzf "$(DL_DIR)/batman-$(PKG_REV).tar.gz" -C "$(BUILD_DIR)"
106endif
107endif
108        mv "$(PKG_BUILD_DIR)/batman-adv" "$(PKG_KMOD_BUILD_DIR)"
109        $(call PatchDir,$(PKG_BUILD_DIR),$(PATCH_DIR),)
110ifneq ($(CONFIG_BATMAN_ADV_DEV),)
111        $(call PatchDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/dev,)
112else
113        $(call PatchDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/maint,)
114endif
115        cp $(PKG_KMOD_BUILD_DIR)/Makefile.kbuild $(PKG_KMOD_BUILD_DIR)/Makefile
116endef
117
118MAKE_BATADV_KERNELLAND_ARGS += \
119        CROSS_COMPILE="$(TARGET_CROSS)" \
120        ARCH="$(LINUX_KARCH)" \
121        PATH="$(TARGET_PATH)" \
122        $(if $(CONFIG_KMOD_BATMAN_ADV_DEBUG_LOG),EXTRA_CFLAGS="-DCONFIG_BATMAN_ADV_DEBUG") \
123        SUBDIRS="$(PKG_KMOD_BUILD_DIR)" \
124        LINUX_VERSION="$(LINUX_VERSION)" \
125        REVISION="$(PKG_REV)" modules
126
127MAKE_BATCTL_ARGS += \
128        CFLAGS="$(TARGET_CFLAGS)" \
129        CCFLAGS="$(TARGET_CFLAGS)" \
130        OFLAGS="$(TARGET_CFLAGS)" \
131        REVISION="$(PKG_REV)" \
132        CC="$(TARGET_CC)" \
133        NODEBUG=1 \
134        UNAME="Linux" \
135        INSTALL_PREFIX="$(PKG_INSTALL_DIR)" \
136        STRIP="/bin/true" \
137        batctl install
138
139define Build/Configure
140endef
141
142ifneq ($(DEVELOPER)$(CONFIG_PACKAGE_kmod-batman-adv-kernelland),)
143        BUILD_KMOD_ADV = $(MAKE) -C "$(LINUX_DIR)" $(MAKE_BATADV_KERNELLAND_ARGS)
144        BUILD_BATCTL = $(MAKE) -C $(PKG_TOOL_BUILD_DIR) $(MAKE_BATCTL_ARGS)
145endif
146
147define Build/Compile
148        $(BUILD_KMOD_ADV)
149ifneq ($(DEVELOPER)$(CONFIG_KMOD_BATMAN_ADV_BATCTL),)
150        $(BUILD_BATCTL)
151endif
152endef
153
154define Build/Clean
155        rm -rf $(PKG_KMOD_BUILD_DIR)
156endef
157
158define KernelPackage/batman-adv-kernelland/install
159        $(INSTALL_DIR) $(1)/etc/config $(1)/etc/init.d
160        $(INSTALL_BIN) ./files/etc/init.d/batman-adv-kernelland $(1)/etc/init.d
161        $(INSTALL_DATA) ./files/etc/config/batman-adv-kernelland $(1)/etc/config
162ifneq ($(DEVELOPER)$(CONFIG_KMOD_BATMAN_ADV_BATCTL),)
163        $(INSTALL_DIR) $(1)/usr/sbin
164        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/batctl $(1)/usr/sbin/
165endif
166endef
167
168$(eval $(call KernelPackage,batman-adv-kernelland))
Note: See TracBrowser for help on using the repository browser.