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