ea42a7f89b45da65d4e41bcd5a15ba60511df088
[openwrt/svn-archive/archive.git] / net / aodv-uu / 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 include $(INCLUDE_DIR)/kernel.mk
11
12 PKG_NAME:=aodv-uu
13 PKG_VERSION:=0.9.3
14 PKG_RELEASE:=1
15
16 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
17 PKG_SOURCE_URL:=http://core.it.uu.se/core/files/
18 PKG_MD5SUM:=05460543054449cb4b170252a7168c65
19 PKG_CAT:=zcat
20
21 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
22
23 include $(INCLUDE_DIR)/package.mk
24
25 define Package/aodv-uu/Default
26 TITLE:=Ad-hoc On-demand Distance Vector Routing
27 DESCRIPTION:=\
28 AODV is the Ad-hoc On-demand Distance Vector routing protocol \\\
29 implementation created at Uppsala University.
30 URL:=http://core.it.uu.se/core/index.php/AODV-UU
31 endef
32
33 define Package/aodv-uu
34 $(call Package/aodv-uu/Default)
35 SECTION:=net
36 CATEGORY:=Network
37 TITLE+= (daemon)
38 DESCRIPTION+=\\\
39 \\\
40 This package contains the AODV userland daemon.
41 endef
42
43 define KernelPackage/aodv-uu
44 $(call Package/aodv-uu/Default)
45 TITLE+= (kernel module)
46 DESCRIPTION+=\\\
47 \\\
48 This package contains the AODV kernel module.
49 FILES:=$(PKG_BUILD_DIR)/lnx/kaodv.$(LINUX_KMOD_SUFFIX)
50 SUBMENU:=Network Support
51 AUTOLOAD:=$(call AutoLoad,80,$(shell cat ./files/aodv-uu.modules))
52 VERSION:=$(LINUX_VERSION)+$(PKG_VERSION)-$(BOARD)-$(PKG_RELEASE)
53 endef
54
55 ifeq ($(CONFIG_LINUX_2_6),y)
56 define Build/Compile/linux26
57 $(MAKE) -C $(LINUX_DIR) \
58 ARCH="$(LINUX_KARCH)" \
59 CROSS_COMPILE="$(TARGET_CROSS)" \
60 PATCHLEVEL="$(LINUX_VERSION)" \
61 KERNDIR="$(LINUX_DIR)" \
62 SUBDIRS="$(PKG_BUILD_DIR)/lnx" \
63 modules
64 endef
65 else
66 # We assume 2.4 builds are only for brcm-2.4 yet
67 define Build/Compile/linux24-brcm
68 $(call Build/Compile/Default,\
69 KERNEL_DIR="$(LINUX_DIR)" \
70 KCC="$(TARGET_CC)" \
71 CFLAGS="$(TARGET_CFLAGS)" \
72 kaodv-mips \
73 )
74 cp $(PKG_BUILD_DIR)/lnx/kaodv-mips.$(LINUX_KMOD_SUFFIX) $(PKG_BUILD_DIR)/lnx/kaodv.$(LINUX_KMOD_SUFFIX)
75 endef
76 endif
77
78 define Build/Compile
79 $(call Build/Compile/linux26)
80 $(call Build/Compile/linux24-brcm)
81 $(call Build/Compile/Default,\
82 KERNEL_DIR="$(LINUX_DIR)" \
83 KCC="$(TARGET_CC)" \
84 CFLAGS="$(TARGET_CFLAGS)" \
85 aodvd \
86 )
87 endef
88
89 define Package/aodv-uu/install
90 $(INSTALL_DIR) $(1)/usr/sbin
91 $(INSTALL_BIN) $(PKG_BUILD_DIR)/aodvd $(1)/usr/sbin
92 endef
93
94 define Package/kmod-aodv-uu/install
95 $(INSTALL_DIR) $(1)/etc/modules.d
96 $(INSTALL_DATA) ./files/aodv-uu.modules $(1)/etc/modules.d/80-aodv-uu
97 $(INSTALL_DIR) $(1)/lib/modules/$(LINUX_VERSION)
98 $(CP) $(PKG_BUILD_DIR)/lnx/kaodv.$(LINUX_KMOD_SUFFIX) $(1)/lib/modules/$(LINUX_VERSION)/
99 endef
100
101 $(eval $(call BuildPackage,aodv-uu))
102 $(eval $(call KernelPackage,aodv-uu))