[packages] Use default templates instead of custom reimplementations where applicable
[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 $(CONF_OPTS) \
80 $(MAKE) -C $(PKG_BUILD_DIR) \
81 $(BUILDOPTS) \
82 tools elementmap.xml
83 (cd $(PKG_BUILD_DIR)/userlevel; \
84 ../tools/click-mkmindriver/click-mkmindriver -p roofnet -C .. \
85 -f $(PKG_BUILD_DIR)/conf/wifi/sample.click \
86 -A --all -E IPNameInfo -E FromHost -E ToHost -E Discard; \
87 $(MAKE) -f Makefile.roofnet; \
88 )
89 endef
90
91 define Package/click/install
92 $(INSTALL_DIR) $(1)/usr/bin
93 $(CP) $(PKG_BUILD_DIR)/userlevel/roofnetclick $(1)/usr/bin/click
94 $(CP) $(PKG_BUILD_DIR)/tools/click-align/click-align $(1)/usr/bin/click-align
95 endef
96
97 define Package/roofnet/install
98 $(INSTALL_DIR) $(1)/usr/bin
99 $(CP) $(PKG_BUILD_DIR)/conf/wifi/gen_config_roofnet.sh $(1)/usr/bin
100 $(CP) $(PKG_BUILD_DIR)/conf/wifi/srcr.click $(1)/usr/bin
101 $(CP) $(PKG_BUILD_DIR)/conf/wifi/read_handler $(1)/usr/bin
102 $(CP) $(PKG_BUILD_DIR)/conf/wifi/write_handler $(1)/usr/bin
103 $(INSTALL_DIR) $(1)/etc/init.d
104 $(INSTALL_BIN) ./files/roofnet.init $(1)/etc/init.d/roofnet
105 endef
106
107 $(eval $(call BuildPackage,click))
108 $(eval $(call BuildPackage,roofnet))