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

Last change on this file since 14503 was 14503, checked in by jow, 7 years ago

[packages] fix batman-advanced compilation as package, thanks russell

File size: 3.6 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:=batmand-adv
12PKG_REV:=1220
13PKG_VERSION:=r$(PKG_REV)
14PKG_RELEASE:=1
15PKG_BRANCH:=batman-adv-userspace
16
17PKG_SOURCE_PROTO:=svn
18PKG_SOURCE_VERSION:=$(PKG_REV)
19PKG_SOURCE_SUBDIR:=batman-adv-$(PKG_VERSION)
20PKG_SOURCE_URL:=http://downloads.open-mesh.net/svn/batman/trunk/
21PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.gz
22PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
23
24PKG_KMOD_BUILD_DIR:=$(PKG_BUILD_DIR)/batman-adv-kernelland
25
26PKG_TOOL_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-battool-install
27PKG_TOOL_BUILD_DIR:=$(PKG_BUILD_DIR)/battool
28
29include $(INCLUDE_DIR)/package.mk
30include $(INCLUDE_DIR)/kernel.mk
31
32define Package/batman-adv/Default
33  URL:=https://www.open-mesh.net/
34  MAINTAINER:=Marek Lindner <lindner_marek@yahoo.de>
35endef
36
37define Package/batmand-adv
38$(call Package/batman-adv/Default)
39  SECTION:=net
40  CATEGORY:=Network
41  DEPENDS:=+libpthread +kmod-tun
42  TITLE:=B.A.T.M.A.N. layer 2 routing daemon
43endef
44
45define Package/batmand-adv/description
46B.A.T.M.A.N. layer 2 routing daemon
47endef
48
49define Package/battool
50$(call Package/batman-adv/Default)
51  SECTION:=net
52  CATEGORY:=Network
53  TITLE:=B.A.T.M.A.N. layer 2 debug tools
54endef
55
56define Package/battool/description
57B.A.T.M.A.N. layer 2 debug tools
58endef
59
60define KernelPackage/batman-advanced
61$(call Package/batman-adv/Default)
62  SUBMENU:=Network Support
63  DEPENDS:=@LINUX_2_6
64  TITLE:=Kernel routing module for B.A.T.M.A.N. layer 2
65  FILES:=$(PKG_KMOD_BUILD_DIR)/batman-adv.$(LINUX_KMOD_SUFFIX)
66  AUTOLOAD:=$(call AutoLoad,50,batman-adv)
67endef
68
69
70define KernelPackage/batman-advanced/description
71Kernel routing module for B.A.T.M.A.N. layer 2
72endef
73
74MAKE_ARGS += \
75        CFLAGS="$(TARGET_CFLAGS)" \
76        CCFLAGS="$(TARGET_CFLAGS)" \
77        OFLAGS="$(TARGET_CFLAGS)" \
78        REVISION="$(PKG_REV)" \
79        CC="$(TARGET_CC)" \
80        NODEBUG=1 \
81        UNAME="Linux" \
82        INSTALL_PREFIX="$(PKG_INSTALL_DIR)" \
83        STRIP="/bin/true" \
84        batmand-adv install
85       
86MAKE_KMOD_ARGS += \
87        CROSS_COMPILE="$(TARGET_CROSS)" \
88        ARCH="$(LINUX_KARCH)" \
89        PATH="$(TARGET_PATH)" \
90        SUBDIRS="$(PKG_KMOD_BUILD_DIR)" \
91        LINUX_VERSION="$(LINUX_VERSION)" \
92        REVISION="$(PKG_REV)" modules
93
94MAKE_TOOL_ARGS += \
95        CFLAGS="$(TARGET_CFLAGS)" \
96        CCFLAGS="$(TARGET_CFLAGS)" \
97        OFLAGS="$(TARGET_CFLAGS)" \
98        REVISION="$(PKG_REV)" \
99        CC="$(TARGET_CC)" \
100        NODEBUG=1 \
101        UNAME="Linux" \
102        INSTALL_PREFIX="$(PKG_INSTALL_DIR)" \
103        STRIP="/bin/true" \
104        battool install
105
106define Build/Configure
107endef
108
109ifneq ($(CONFIG_PACKAGE_batmand-adv),n)
110        BUILD_ADV = $(MAKE) -C $(PKG_BUILD_DIR)/batman-adv-userspace $(MAKE_ARGS)
111endif
112
113ifneq ($(CONFIG_PACKAGE_kmod-batman-advanced),n)
114        BUILD_KMOD_ADV = $(MAKE) -C "$(LINUX_DIR)" $(MAKE_KMOD_ARGS)
115endif
116
117ifneq ($(CONFIG_PACKAGE_battool),n)
118        BUILD_BATTOOL = $(MAKE) -C $(PKG_TOOL_BUILD_DIR) $(MAKE_TOOL_ARGS)
119endif
120
121define Build/Compile
122        $(BUILD_ADV)
123        cp $(PKG_KMOD_BUILD_DIR)/Makefile.kbuild $(PKG_KMOD_BUILD_DIR)/Makefile
124        $(BUILD_KMOD_ADV)
125        $(BUILD_BATTOOL)
126endef
127
128define Package/batmand-adv/install
129        $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/config $(1)/etc/init.d
130        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/batmand-adv $(1)/usr/sbin/
131        $(INSTALL_BIN) ./files/etc/init.d/batmand-adv $(1)/etc/init.d
132        $(INSTALL_DATA) ./files/etc/config/batmand-adv $(1)/etc/config
133endef
134
135define Package/battool/install
136        $(INSTALL_DIR) $(1)/usr/sbin
137        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/battool $(1)/usr/sbin/
138endef
139
140$(eval $(call BuildPackage,batmand-adv))
141$(eval $(call BuildPackage,battool))
142$(eval $(call KernelPackage,batman-advanced))
Note: See TracBrowser for help on using the repository browser.