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

Last change on this file since 21880 was 21880, checked in by marek, 6 years ago

batman-adv: hotfix for maint branch

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