ec4254c1118b49cbbd41dde69fb6c340c8e6683b
[openwrt/svn-archive/archive.git] / net / batman / 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$
8
9 include $(TOPDIR)/rules.mk
10
11 PKG_NAME:=batmand
12 PKG_REV:=963
13 PKG_VERSION:=r$(PKG_REV)
14 PKG_RELEASE:=1
15 PKG_BRANCH:=batman
16
17 PKG_SOURCE_PROTO:=svn
18 PKG_SOURCE_VERSION:=$(PKG_REV)
19 PKG_SOURCE_SUBDIR:=$(PKG_BRANCH)d-$(PKG_VERSION)
20 PKG_SOURCE_URL:=http://downloads.open-mesh.net/svn/batman/trunk/$(PKG_BRANCH)
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)/linux/modules
26
27 include $(INCLUDE_DIR)/package.mk
28 include $(INCLUDE_DIR)/kernel.mk
29
30 define Package/batmand/Default
31 SECTION:=net
32 CATEGORY:=Network
33 URL:=https://www.open-mesh.net/
34 MAINTAINER:=Marek Lindner <lindner_marek@yahoo.de>
35 endef
36
37 define Package/batmand
38 $(call Package/batmand/Default)
39 DEPENDS:=+libpthread +kmod-tun
40 TITLE:=B.A.T.M.A.N. layer 3 routing daemon
41 endef
42
43 define Package/batmand/description
44 B.A.T.M.A.N. layer 3 routing daemon
45 endef
46
47 define KernelPackage/batgat
48 $(call Package/batmand/Default)
49 DEPENDS:=batmand
50 TITLE:=B.A.T.M.A.N. gateway module
51 FILES:=$(PKG_KMOD_BUILD_DIR)/batgat.$(LINUX_KMOD_SUFFIX)
52 AUTOLOAD:=$(call AutoLoad,50,batgat)
53 endef
54
55
56 define KernelPackage/batgat/description
57 Kernel gateway module for B.A.T.M.A.N.
58 endef
59
60 MAKE_ARGS += \
61 EXTRA_CFLAGS="$(TARGET_CFLAGS)" \
62 CCFLAGS="$(TARGET_CFLAGS)" \
63 OFLAGS="$(TARGET_CFLAGS)" \
64 REVISION="$(PKG_REV)" \
65 CC="$(TARGET_CC)" \
66 NODEBUG=1 \
67 UNAME="Linux" \
68 INSTALL_PREFIX="$(PKG_INSTALL_DIR)" \
69 STRIP="/bin/true" \
70 batmand install
71
72 define Build/Configure
73 endef
74
75 define Build/Compile
76 $(MAKE) -C $(PKG_BUILD_DIR) $(MAKE_ARGS)
77 cp $(PKG_KMOD_BUILD_DIR)/Makefile.kbuild $(PKG_KMOD_BUILD_DIR)/Makefile
78 $(MAKE) -C "$(LINUX_DIR)" \
79 CROSS_COMPILE="$(TARGET_CROSS)" \
80 ARCH="$(LINUX_KARCH)" \
81 PATH="$(TARGET_PATH)" \
82 SUBDIRS="$(PKG_KMOD_BUILD_DIR)" \
83 LINUX_VERSION="$(LINUX_VERSION)" \
84 REVISION="$(PKG_REV)" modules
85 endef
86
87 define Package/batmand/install
88 $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/config $(1)/etc/init.d
89 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/batmand $(1)/usr/sbin/
90 $(INSTALL_BIN) ./files/etc/init.d/batmand $(1)/etc/init.d
91 $(INSTALL_DATA) ./files/etc/config/batmand $(1)/etc/config
92 endef
93
94 $(eval $(call BuildPackage,batmand))
95 $(eval $(call KernelPackage,batgat))