[net] Routing and Redirection: Moved programs for routing and redirecting/relaying...
[openwrt/svn-archive/archive.git] / net / batman / Makefile
1 #
2 # Copyright (C) 2008-2010 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 include $(INCLUDE_DIR)/kernel.mk
10
11 PKG_NAME:=batmand
12 PKG_REV:=1439
13 PKG_VERSION:=r$(PKG_REV)
14 PKG_RELEASE:=1
15 PKG_EXTRA_CFLAGS=-DDEBUG_MALLOC -DMEMORY_USAGE -DPROFILE_DATA -DREVISION_VERSION=\"\ rv$(PKG_REV)\"
16
17 PKG_SOURCE_PROTO:=svn
18 PKG_SOURCE_VERSION:=$(PKG_REV)
19 PKG_SOURCE_SUBDIR:=$(if $(PKG_BRANCH),$(PKG_BRANCH),$(PKG_NAME))-$(PKG_VERSION)
20 PKG_SOURCE_URL:=http://downloads.open-mesh.org/svn/batman/trunk/
21 PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.gz
22 PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
23
24 PKG_KMOD_BUILD_DIR:=$(PKG_BUILD_DIR)/batman/linux/modules
25
26 include $(INCLUDE_DIR)/package.mk
27
28 define Package/batmand/Default
29 URL:=http://www.open-mesh.org/
30 MAINTAINER:=Marek Lindner <lindner_marek@yahoo.de>
31 endef
32
33 define Package/batmand
34 $(call Package/batmand/Default)
35 SECTION:=net
36 CATEGORY:=Network
37 SUBMENU:=Routing and Redirection
38 DEPENDS:=+libpthread +kmod-tun
39 TITLE:=B.A.T.M.A.N. layer 3 routing daemon
40 endef
41
42 define Package/batmand/description
43 B.A.T.M.A.N. layer 3 routing daemon
44 endef
45
46 define Package/vis
47 $(call Package/batmand/Default)
48 SECTION:=net
49 CATEGORY:=Network
50 DEPENDS:=+libpthread
51 TITLE:=visualization server for B.A.T.M.A.N. layer 3
52 endef
53
54 define Package/vis/description
55 visualization server for B.A.T.M.A.N. layer 3
56 endef
57
58 define KernelPackage/batgat
59 $(call Package/batmand/Default)
60 SUBMENU:=Network Support
61 DEPENDS:=+batmand
62 TITLE:=B.A.T.M.A.N. gateway module
63 FILES:=$(PKG_KMOD_BUILD_DIR)/batgat.$(LINUX_KMOD_SUFFIX)
64 AUTOLOAD:=$(call AutoLoad,50,batgat)
65 endef
66
67
68 define KernelPackage/batgat/description
69 Kernel gateway module for B.A.T.M.A.N. for better tunnel performance
70 endef
71
72 MAKE_BATMAND_ARGS += \
73 EXTRA_CFLAGS='$(TARGET_CFLAGS) $(PKG_EXTRA_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 install
83
84 MAKE_VIS_ARGS += \
85 EXTRA_CFLAGS='$(TARGET_CFLAGS) $(PKG_EXTRA_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 vis install
95
96 MAKE_BATGAT_ARGS += \
97 CROSS_COMPILE="$(TARGET_CROSS)" \
98 ARCH="$(LINUX_KARCH)" \
99 PATH="$(TARGET_PATH)" \
100 SUBDIRS="$(PKG_KMOD_BUILD_DIR)" \
101 LINUX_VERSION="$(LINUX_VERSION)" \
102 REVISION="$(PKG_REV)" modules
103
104
105 define Build/Configure
106 endef
107
108 ifneq ($(DEVELOPER)$(CONFIG_PACKAGE_batmand),)
109 BUILD_BATMAND := $(MAKE) -C $(PKG_BUILD_DIR)/batman $(MAKE_BATMAND_ARGS)
110 endif
111
112 ifneq ($(DEVELOPER)$(CONFIG_PACKAGE_vis),)
113 BUILD_VIS := $(MAKE) -C $(PKG_BUILD_DIR)/vis $(MAKE_VIS_ARGS)
114 endif
115
116 ifneq ($(DEVELOPER)$(CONFIG_PACKAGE_kmod-batgat),)
117 BUILD_BATGAT := $(MAKE) -C "$(LINUX_DIR)" $(MAKE_BATGAT_ARGS)
118 endif
119
120 define Build/Compile
121 $(BUILD_BATMAND)
122 $(BUILD_VIS)
123 cp $(PKG_KMOD_BUILD_DIR)/Makefile.kbuild $(PKG_KMOD_BUILD_DIR)/Makefile
124 $(BUILD_BATGAT)
125 endef
126
127 define Package/batmand/install
128 $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/config $(1)/etc/init.d
129 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/batmand $(1)/usr/sbin/
130 $(INSTALL_BIN) ./files/etc/init.d/batmand $(1)/etc/init.d
131 $(INSTALL_DATA) ./files/etc/config/batmand $(1)/etc/config
132 endef
133
134 define Package/vis/install
135 $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/config $(1)/etc/init.d
136 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/vis $(1)/usr/sbin/
137 $(INSTALL_BIN) ./files/etc/init.d/vis $(1)/etc/init.d
138 $(INSTALL_DATA) ./files/etc/config/vis $(1)/etc/config
139 endef
140
141 $(eval $(call BuildPackage,batmand))
142 $(eval $(call BuildPackage,vis))
143 $(eval $(call KernelPackage,batgat))