4e88b31ac283180ca47a12f1f9a3387c7f595ed3
[openwrt/svn-archive/archive.git] / net / click / Makefile
1 # Copyright (C) 2006 OpenWrt.org
2 #
3 # This is free software, licensed under the GNU General Public License v2.
4 # See /LICENSE for more information.
5 #
6 # $Id$
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=click
11 PKG_VERSION:=cvs.2006.03.02
12 PKG_RELEASE:=1
13 PKG_MD5SUM:=7aed4ba94926010d76febb797b288e98
14
15 ROOFNET_VERSION:=0.0.1
16
17 PKG_SOURCE_URL:=http://pdos.csail.mit.edu/~jbicket/click_snapshots/
18 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
19 PKG_CAT:=zcat
20
21 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
22 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
23
24 include $(INCLUDE_DIR)/package.mk
25
26 define Package/click
27 SECTION:=net
28 CATEGORY:=Network
29 MENU:=1
30 TITLE:=The Click Modular Router
31 DESCRIPTION:=The Click Modular Router
32 URL:=http://pdos.csail.mit.edu/click/
33 endef
34
35 define Package/roofnet
36 SECTION:=net
37 CATEGORY:=Network
38 DEPENDS:=click
39 TITLE:=roofnet mesh networking scripts
40 DESCRIPTION:=roofnet mesh networking scripts
41 URL:=http://pdos.csail.mit.edu/roofnet/
42 endef
43
44 CONF_OPTS= \
45 ac_cv_int64_t=no \
46 ac_cv_sizeof_off_t=4
47
48 define Build/Configure
49 (cd $(PKG_BUILD_DIR); \
50 $(CONF_OPTS) \
51 ./configure; \
52 cp include/click/config.h include/click/config-host.h; \
53 rm -rf config.{cache,status} ; \
54 $(TARGET_CONFIGURE_OPTS) \
55 CXXFLAGS="-static -O2 -MD" \
56 CFLAGS="-static -MD" \
57 CPPFLAGS="-I$(STAGING_DIR)/usr/include" \
58 LDFLAGS="-L$(STAGING_DIR)/usr/lib" \
59 $(CONF_OPTS) \
60 ./configure \
61 --prefix=/usr \
62 --target=$(GNU_TARGET_NAME) \
63 --host=$(GNU_TARGET_NAME) \
64 --build=$(GNU_HOST_NAME) \
65 --enable-wifi \
66 --disable-linuxmodule \
67 --enable-tools=mixed \
68 --disable-dynamic-linking \
69 )
70 endef
71
72
73 define Build/Compile
74 rm -rf $(PKG_INSTALL_DIR)
75 mkdir -p $(PKG_INSTALL_DIR)
76 $(CONF_OPTS) \
77 $(MAKE) -C $(PKG_BUILD_DIR) \
78 BUILD_CXX="g++ -include $(PKG_BUILD_DIR)/include/click/config-host.h" \
79 tools elementmap.xml
80 (cd $(PKG_BUILD_DIR)/userlevel; \
81 ../tools/click-mkmindriver/click-mkmindriver -p roofnet -C .. \
82 -f $(PKG_BUILD_DIR)/conf/wifi/sample.click \
83 -A --all -E IPNameInfo -E FromHost -E ToHost -E Discard; \
84 $(MAKE) -f Makefile.roofnet; \
85 )
86 endef
87
88 define Package/click/install
89 install -d -m0755 $(1)/usr/bin
90 $(CP) $(PKG_BUILD_DIR)/userlevel/roofnetclick $(1)/usr/bin/click
91 $(CP) $(PKG_BUILD_DIR)/tools/click-align/click-align $(1)/usr/bin/click-align
92 endef
93
94 define Package/roofnet/install
95 install -d -m0755 $(1)/usr/bin
96 $(CP) $(PKG_BUILD_DIR)/conf/wifi/gen_config_roofnet.sh $(1)/usr/bin
97 $(CP) $(PKG_BUILD_DIR)/conf/wifi/srcr.click $(1)/usr/bin
98 $(CP) $(PKG_BUILD_DIR)/conf/wifi/read_handler $(1)/usr/bin
99 $(CP) $(PKG_BUILD_DIR)/conf/wifi/write_handler $(1)/usr/bin
100 mkdir -p $(1)/etc/init.d
101 install -m 755 ./files/S50roofnet $(1)/etc/init.d/
102 endef
103
104 $(eval $(call BuildPackage,click))
105 $(eval $(call BuildPackage,roofnet))