f4ebb14b60e0b48a77dca4543a22c258236a91c0
[openwrt/svn-archive/archive.git] / net / wing / Makefile
1 #
2 # Copyright (C) 2006-2009 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:=wing
11
12 ifneq ($(CONFIG_WING_STABLE),)
13 PKG_VERSION:=20100903
14 PKG_RELEASE:=4
15 PKG_REV:=520e3168a5af4d26bec3779cfa4901d128a4bc6f
16 else
17 PKG_VERSION:=$(shell date +%Y%m%d)
18 PKG_RELEASE:=1
19 PKG_REV:=HEAD
20 endif
21
22 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
23 PKG_SOURCE_URL:=http://github.com/create-net/click-wing.git
24 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
25 PKG_SOURCE_VERSION:=$(PKG_REV)
26 PKG_SOURCE_PROTO:=git
27
28 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
29 PKG_BUILD_PARALLEL:=1
30 PKG_INSTALL:=1
31
32 include $(INCLUDE_DIR)/package.mk
33
34 define Package/wing
35 TITLE:=Wireless mesh networking toolkit
36 SECTION:=net
37 CATEGORY:=Network
38 MAINTAINER:=Roberto Riggio <roberto.riggio@create-net.org>
39 DEPENDS:=+kmod-tun
40 URL:=http://www.wing-project.org/
41 endef
42
43 define Package/wing/Description
44 Wing is a wireless mesh routing software. The routing protocol
45 is derived from Roofnet. It supports multiple radio interfaces and
46 link quality routing using the ETX, ETT, and WCETT metrics.
47 endef
48
49 define Package/wing/config
50 source "$(SOURCE)/Config.in"
51 endef
52
53 EXTRA_LDFLAGS:=-ldl
54
55 MAKE_FLAGS+=\
56 V=1 \
57 MINDRIVER=$(PKG_NAME) \
58 BUILD_CC=$(TARGET_CC) \
59 BUILD_CXX=$(TARGET_CXX)
60
61 HOST_MAKE_FLAGS:=\
62 V=1 \
63 MINDRIVER=$(PKG_NAME)
64
65 define Build/Configure
66 (cd $(PKG_BUILD_DIR); \
67 rm -rf config.{cache,status}; \
68 ./configure \
69 --prefix=/usr \
70 --enable-userlevel \
71 --enable-wifi \
72 --enable-wing \
73 --disable-linuxmodule \
74 );
75 $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) $(HOST_MAKE_FLAGS) tools
76 $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) $(HOST_MAKE_FLAGS) elementmap.xml
77 $(CP) $(PKG_BUILD_DIR)/tools/click-mkmindriver/click-mkmindriver $(PKG_BUILD_DIR)/
78 rm -rf $(PKG_BUILD_DIR)/config.{cache,status}
79 $(call Build/Configure/Default, \
80 --enable-tools=mixed \
81 --enable-userlevel \
82 --enable-wifi \
83 --enable-wing \
84 --disable-linuxmodule \
85 )
86 (cd $(PKG_BUILD_DIR)/userlevel; \
87 ../click-mkmindriver -p $(PKG_NAME) -C .. \
88 -f $(PKG_BUILD_DIR)/conf/wing/sample.click \
89 -A --all -E Discard -E Print -E Null \
90 -E InfiniteSource -E RatedSource -E EtherEncap -E UDPIPEncap \
91 -E RadiotapDecap -E RadiotapEncap \
92 -E ProbeTXRate -E MadwifiRate -E AutoRateFallback \
93 -E RoundRobinSched -E DRRSched; \
94 )
95 endef
96
97 define Package/wing/install
98 $(INSTALL_DIR) $(1)/usr/bin
99 $(INSTALL_DIR) $(1)/etc/wing
100 $(INSTALL_DIR) $(1)/usr/share/click
101 $(CP) ./files/* $(1)/
102 $(CP) $(PKG_BUILD_DIR)/conf/wing/click_config $(1)/usr/bin/
103 $(CP) $(PKG_BUILD_DIR)/conf/wing/write_handler $(1)/usr/bin/
104 $(CP) $(PKG_BUILD_DIR)/conf/wing/read_handler $(1)/usr/bin/
105 $(CP) $(PKG_INSTALL_DIR)/usr/bin/$(PKG_NAME)click $(1)/usr/bin/click
106 $(CP) $(PKG_INSTALL_DIR)/usr/bin/click-align $(1)/usr/bin/click-align
107 $(CP) $(PKG_BUILD_DIR)/conf/wing/*click $(1)/etc/wing/
108 $(CP) $(PKG_INSTALL_DIR)/usr/share/click/elementmap.xml $(1)/usr/share/click/elementmap.xml
109 endef
110
111 $(eval $(call BuildPackage,wing))
112