4c8bf30032c6e2ecda6ab61e68a753970f1c2d02
[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:=3
15 PKG_EXTRA_CFLAGS=-DDEBUG_MALLOC -DMEMORY_USAGE -DPROFILE_DATA -DREVISION_VERSION=\"\ rv$(PKG_REV)\" -D_GNU_SOURCE
16
17 PKG_HASH:=3c72ce2aae889944acfc898434c6e9573b20815862db1938f3132cc50b669667
18 PKG_SOURCE_VERSION:=$(PKG_REV)
19 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
20 PKG_SOURCE_URL:=https://sources.lede-project.org https://downloads.openwrt.org/sources
21 PKG_LICENSE:=GPL-2.0
22
23 PKG_KMOD_BUILD_DIR:=$(PKG_BUILD_DIR)/batman/linux/modules
24
25 include $(INCLUDE_DIR)/package.mk
26
27 define Package/batmand/Default
28 URL:=http://www.open-mesh.org/
29 MAINTAINER:=Corinna "Elektra" Aichele <onelektra@gmx.net>
30 endef
31
32 define Package/batmand
33 $(call Package/batmand/Default)
34 SECTION:=net
35 CATEGORY:=Network
36 SUBMENU:=Routing and Redirection
37 DEPENDS:=+libpthread +kmod-tun
38 TITLE:=B.A.T.M.A.N. layer 3 routing daemon
39 endef
40
41 define Package/batmand/description
42 B.A.T.M.A.N. layer 3 routing daemon
43 endef
44
45 define Package/vis
46 $(call Package/batmand/Default)
47 SECTION:=net
48 CATEGORY:=Network
49 SUBMENU:=Routing and Redirection
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 @BROKEN
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/batmand/conffiles
135 /etc/config/batmand
136 endef
137
138 define Package/vis/install
139 $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/config $(1)/etc/init.d
140 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/vis $(1)/usr/sbin/
141 $(INSTALL_BIN) ./files/etc/init.d/vis $(1)/etc/init.d
142 $(INSTALL_DATA) ./files/etc/config/vis $(1)/etc/config
143 endef
144
145 define Package/vis/conffiles
146 /etc/config/vis
147 endef
148
149 $(eval $(call BuildPackage,batmand))
150 $(eval $(call BuildPackage,vis))
151 $(eval $(call KernelPackage,batgat))