1bd439895f2486a5a9f8cf7d7355e4bf53ae870a
[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
7 include $(TOPDIR)/rules.mk
8
9 PKG_NAME:=click
10 PKG_VERSION:=cvs.2006.03.02
11 PKG_RELEASE:=1
12 PKG_MD5SUM:=7aed4ba94926010d76febb797b288e98
13
14 ROOFNET_VERSION:=0.0.1
15
16 PKG_SOURCE_URL:=http://pdos.csail.mit.edu/~jbicket/click_snapshots/
17 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
18
19 include $(INCLUDE_DIR)/package.mk
20
21 define Package/click
22 SECTION:=net
23 CATEGORY:=Network
24 DEPENDS:=@BROKEN
25 MENU:=1
26 TITLE:=The Click Modular Router
27 URL:=http://www.read.cs.ucla.edu/click/
28 endef
29
30 define Package/click/description
31 The Click Modular Router
32 endef
33
34 define Package/roofnet
35 SECTION:=net
36 CATEGORY:=Network
37 DEPENDS:=@BROKEN click
38 TITLE:=roofnet mesh networking scripts
39 URL:=http://pdos.csail.mit.edu/roofnet/
40 endef
41
42 define Package/roofnet/description
43 roofnet mesh networking scripts
44 endef
45
46 BUILDOPTS = \
47 BUILD_CXX="g++ -I $(PKG_BUILD_DIR)/include-host" \
48 BUILD_DL_LIBS="-ldl"
49
50 define Build/Configure
51 (cd $(PKG_BUILD_DIR); \
52 rm -rf config.{cache,status} ; \
53 CONFIG_SITE= \
54 ./configure; \
55 rm -rf include-host; \
56 $(CP) include include-host; \
57 rm -rf config.{cache,status} ; \
58 $(TARGET_CONFIGURE_OPTS) \
59 CXXFLAGS="-static -Os -MD" \
60 CFLAGS="-static -MD" \
61 CPPFLAGS="-I$(STAGING_DIR)/usr/include" \
62 LDFLAGS="-L$(STAGING_DIR)/usr/lib" \
63 $(BUILDOPTS) \
64 ./configure \
65 --prefix=/usr \
66 --target=$(GNU_TARGET_NAME) \
67 --host=$(GNU_TARGET_NAME) \
68 --build=$(GNU_HOST_NAME) \
69 --enable-wifi \
70 --disable-linuxmodule \
71 --enable-tools=mixed \
72 --disable-dynamic-linking \
73 )
74 endef
75
76
77 define Build/Compile
78 rm -rf $(PKG_INSTALL_DIR)
79 mkdir -p $(PKG_INSTALL_DIR)
80 $(CONF_OPTS) \
81 $(MAKE) -C $(PKG_BUILD_DIR) \
82 $(BUILDOPTS) \
83 tools elementmap.xml
84 (cd $(PKG_BUILD_DIR)/userlevel; \
85 ../tools/click-mkmindriver/click-mkmindriver -p roofnet -C .. \
86 -f $(PKG_BUILD_DIR)/conf/wifi/sample.click \
87 -A --all -E IPNameInfo -E FromHost -E ToHost -E Discard; \
88 $(MAKE) -f Makefile.roofnet; \
89 )
90 endef
91
92 define Package/click/install
93 $(INSTALL_DIR) $(1)/usr/bin
94 $(CP) $(PKG_BUILD_DIR)/userlevel/roofnetclick $(1)/usr/bin/click
95 $(CP) $(PKG_BUILD_DIR)/tools/click-align/click-align $(1)/usr/bin/click-align
96 endef
97
98 define Package/roofnet/install
99 $(INSTALL_DIR) $(1)/usr/bin
100 $(CP) $(PKG_BUILD_DIR)/conf/wifi/gen_config_roofnet.sh $(1)/usr/bin
101 $(CP) $(PKG_BUILD_DIR)/conf/wifi/srcr.click $(1)/usr/bin
102 $(CP) $(PKG_BUILD_DIR)/conf/wifi/read_handler $(1)/usr/bin
103 $(CP) $(PKG_BUILD_DIR)/conf/wifi/write_handler $(1)/usr/bin
104 mkdir -p $(1)/etc/init.d
105 $(INSTALL_BIN) ./files/roofnet.init $(1)/etc/init.d/roofnet
106 endef
107
108 $(eval $(call BuildPackage,click))
109 $(eval $(call BuildPackage,roofnet))