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