a80765088832663a55bb5dc8b580ae41488b1a81
[feed/routing.git] / batmand / Makefile
1 #
2 # Copyright (C) 2008-2011 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:=2
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 PKG_LICENSE:=GPL-2.0
24
25 PKG_KMOD_BUILD_DIR:=$(PKG_BUILD_DIR)/batman/linux/modules
26
27 include $(INCLUDE_DIR)/package.mk
28
29 define Package/batmand/Default
30 URL:=http://www.open-mesh.org/
31 MAINTAINER:=Marek Lindner <lindner_marek@yahoo.de>
32 endef
33
34 define Package/batmand
35 $(call Package/batmand/Default)
36 SECTION:=net
37 CATEGORY:=Network
38 SUBMENU:=Routing and Redirection
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 Package/vis
48 $(call Package/batmand/Default)
49 SECTION:=net
50 CATEGORY:=Network
51 SUBMENU:=Routing and Redirection
52 DEPENDS:=+libpthread
53 TITLE:=visualization server for B.A.T.M.A.N. layer 3
54 endef
55
56 define Package/vis/description
57 visualization server for B.A.T.M.A.N. layer 3
58 endef
59
60 define KernelPackage/batgat
61 $(call Package/batmand/Default)
62 SUBMENU:=Network Support
63 DEPENDS:=+batmand @BROKEN
64 TITLE:=B.A.T.M.A.N. gateway module
65 FILES:=$(PKG_KMOD_BUILD_DIR)/batgat.$(LINUX_KMOD_SUFFIX)
66 AUTOLOAD:=$(call AutoLoad,50,batgat)
67 endef
68
69
70 define KernelPackage/batgat/description
71 Kernel gateway module for B.A.T.M.A.N. for better tunnel performance
72 endef
73
74 MAKE_BATMAND_ARGS += \
75 EXTRA_CFLAGS='$(TARGET_CFLAGS) $(PKG_EXTRA_CFLAGS)' \
76 CCFLAGS="$(TARGET_CFLAGS)" \
77 OFLAGS="$(TARGET_CFLAGS)" \
78 REVISION="$(PKG_REV)" \
79 CC="$(TARGET_CC)" \
80 NODEBUG=1 \
81 UNAME="Linux" \
82 INSTALL_PREFIX="$(PKG_INSTALL_DIR)" \
83 STRIP="/bin/true" \
84 batmand install
85
86 MAKE_VIS_ARGS += \
87 EXTRA_CFLAGS='$(TARGET_CFLAGS) $(PKG_EXTRA_CFLAGS)' \
88 CCFLAGS="$(TARGET_CFLAGS)" \
89 OFLAGS="$(TARGET_CFLAGS)" \
90 REVISION="$(PKG_REV)" \
91 CC="$(TARGET_CC)" \
92 NODEBUG=1 \
93 UNAME="Linux" \
94 INSTALL_PREFIX="$(PKG_INSTALL_DIR)" \
95 STRIP="/bin/true" \
96 vis install
97
98 MAKE_BATGAT_ARGS += \
99 CROSS_COMPILE="$(TARGET_CROSS)" \
100 ARCH="$(LINUX_KARCH)" \
101 PATH="$(TARGET_PATH)" \
102 SUBDIRS="$(PKG_KMOD_BUILD_DIR)" \
103 LINUX_VERSION="$(LINUX_VERSION)" \
104 REVISION="$(PKG_REV)" modules
105
106
107 define Build/Configure
108 endef
109
110 ifneq ($(DEVELOPER)$(CONFIG_PACKAGE_batmand),)
111 BUILD_BATMAND := $(MAKE) -C $(PKG_BUILD_DIR)/batman $(MAKE_BATMAND_ARGS)
112 endif
113
114 ifneq ($(DEVELOPER)$(CONFIG_PACKAGE_vis),)
115 BUILD_VIS := $(MAKE) -C $(PKG_BUILD_DIR)/vis $(MAKE_VIS_ARGS)
116 endif
117
118 ifneq ($(DEVELOPER)$(CONFIG_PACKAGE_kmod-batgat),)
119 BUILD_BATGAT := $(MAKE) -C "$(LINUX_DIR)" $(MAKE_BATGAT_ARGS)
120 endif
121
122 define Build/Compile
123 $(BUILD_BATMAND)
124 $(BUILD_VIS)
125 cp $(PKG_KMOD_BUILD_DIR)/Makefile.kbuild $(PKG_KMOD_BUILD_DIR)/Makefile
126 $(BUILD_BATGAT)
127 endef
128
129 define Package/batmand/install
130 $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/config $(1)/etc/init.d
131 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/batmand $(1)/usr/sbin/
132 $(INSTALL_BIN) ./files/etc/init.d/batmand $(1)/etc/init.d
133 $(INSTALL_DATA) ./files/etc/config/batmand $(1)/etc/config
134 endef
135
136 define Package/batmand/conffiles
137 /etc/config/batmand
138 endef
139
140 define Package/vis/install
141 $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/config $(1)/etc/init.d
142 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/vis $(1)/usr/sbin/
143 $(INSTALL_BIN) ./files/etc/init.d/vis $(1)/etc/init.d
144 $(INSTALL_DATA) ./files/etc/config/vis $(1)/etc/config
145 endef
146
147 define Package/vis/conffiles
148 /etc/config/vis
149 endef
150
151 $(eval $(call BuildPackage,batmand))
152 $(eval $(call BuildPackage,vis))
153 $(eval $(call KernelPackage,batgat))