fix aodv-uu build on 2.6.19, Makefile cleanup
[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 Package/kmod-aodv-uu
44 $(call Package/aodv-uu/Default)
45 SECTION:=kernel
46 CATEGORY=Kernel drivers
47 TITLE+= (kernel module)
48 DESCRIPTION+=\\\
49 \\\
50 This package contains the AODV kernel module.
51 endef
52
53 ifeq ($(CONFIG_LINUX_2_6),y)
54 define Build/Compile/linux26
55 $(MAKE) -C $(LINUX_DIR) \
56 ARCH="$(LINUX_KARCH)" \
57 CROSS_COMPILE="$(TARGET_CROSS)" \
58 PATCHLEVEL="$(LINUX_VERSION)" \
59 KERNDIR="$(LINUX_DIR)" \
60 SUBDIRS="$(PKG_BUILD_DIR)/lnx" \
61 modules
62 endef
63 else
64 # We assume 2.4 builds are only for brcm-2.4 yet
65 define Build/Compile/linux24-brcm
66 $(call Build/Compile/Default,\
67 KERNEL_DIR="$(LINUX_DIR)" \
68 KCC="$(TARGET_CC)" \
69 CFLAGS="$(TARGET_CFLAGS)" \
70 kaodv-mips \
71 )
72 cp $(PKG_BUILD_DIR)/lnx/kaodv-mips.$(LINUX_KMOD_SUFFIX) $(PKG_BUILD_DIR)/lnx/kaodv.$(LINUX_KMOD_SUFFIX)
73 endef
74 endif
75
76 define Build/Compile
77 $(call Build/Compile/linux26)
78 $(call Build/Compile/linux24-brcm)
79 $(call Build/Compile/Default,\
80 KERNEL_DIR="$(LINUX_DIR)" \
81 KCC="$(TARGET_CC)" \
82 CFLAGS="$(TARGET_CFLAGS)" \
83 aodvd \
84 )
85 endef
86
87 define Package/aodv-uu/install
88 $(INSTALL_DIR) $(1)/usr/sbin
89 $(INSTALL_BIN) $(PKG_BUILD_DIR)/aodvd $(1)/usr/sbin
90 endef
91
92 define Package/kmod-aodv-uu/install
93 $(INSTALL_DIR) $(1)/etc/modules.d
94 $(INSTALL_DATA) ./files/aodv-uu.modules $(1)/etc/modules.d/80-aodv-uu
95 $(INSTALL_DIR) $(1)/lib/modules/$(LINUX_VERSION)
96 $(CP) $(PKG_BUILD_DIR)/lnx/kaodv.$(LINUX_KMOD_SUFFIX) $(1)/lib/modules/$(LINUX_VERSION)/
97 endef
98
99 $(eval $(call BuildPackage,aodv-uu))
100 $(eval $(call BuildPackage,kmod-aodv-uu))