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