add common functions for the new config file format
[openwrt.git] / openwrt / package / click / Makefile
1 # $Id$
2
3 include $(TOPDIR)/rules.mk
4
5 PKG_NAME:=click
6 PKG_VERSION:=cvs.2006.03.02
7 PKG_RELEASE:=1
8 PKG_MD5SUM:=7aed4ba94926010d76febb797b288e98
9
10 ROOFNET_VERSION:=0.0.1
11
12 PKG_SOURCE_URL:=http://pdos.csail.mit.edu/~jbicket/click_snapshots/
13 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
14 PKG_CAT:=zcat
15
16 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
17 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
18
19 include $(TOPDIR)/package/rules.mk
20
21 $(eval $(call PKG_template,CLICK,$(PKG_NAME),$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
22 $(eval $(call PKG_template,ROOFNET,roofnet,$(ROOFNET_VERSION),$(ARCH)))
23
24 $(PKG_BUILD_DIR)/.configured:
25 (cd $(PKG_BUILD_DIR); \
26 ./configure; \
27 cp include/click/config.h include/click/config-host.h; \
28 rm -rf config.{cache,status} ; \
29 $(TARGET_CONFIGURE_OPTS) \
30 CXXFLAGS="-static -O2 -MD" \
31 CFLAGS="-static -MD" \
32 CPPFLAGS="-I$(STAGING_DIR)/usr/include" \
33 LDFLAGS="-L$(STAGING_DIR)/usr/lib" \
34 ./configure \
35 --prefix=/usr \
36 --target=$(GNU_TARGET_NAME) \
37 --host=$(GNU_TARGET_NAME) \
38 --build=$(GNU_HOST_NAME) \
39 --enable-wifi \
40 --disable-linuxmodule \
41 --enable-tools=mixed \
42 --disable-dynamic-linking \
43 )
44 touch $@
45
46
47 # don't build the full click (it's huge), but only include
48 # the elements needed for roofnet
49 $(PKG_BUILD_DIR)/.built: $(PKG_BUILD_DIR)/.configured
50 rm -rf $(PKG_INSTALL_DIR)
51 mkdir -p $(PKG_INSTALL_DIR)
52 $(MAKE) -C $(PKG_BUILD_DIR) \
53 BUILD_CXX="g++ -include $(PKG_BUILD_DIR)/include/click/config-host.h" \
54 tools elementmap.xml
55 (cd $(PKG_BUILD_DIR)/userlevel; \
56 ../tools/click-mkmindriver/click-mkmindriver -p roofnet -C .. \
57 -f $(PKG_BUILD_DIR)/conf/wifi/sample.click \
58 -A --all -E IPNameInfo -E FromHost -E ToHost -E Discard; \
59 $(MAKE) -f Makefile.roofnet; \
60 )
61 touch $@
62
63 $(IPKG_CLICK):
64 install -d -m0755 $(IDIR_CLICK)/usr/bin
65 $(CP) $(PKG_BUILD_DIR)/userlevel/roofnetclick $(IDIR_CLICK)/usr/bin/click
66 $(CP) $(PKG_BUILD_DIR)/tools/click-align/click-align $(IDIR_CLICK)/usr/bin/click-align
67 $(RSTRIP) $(IDIR_CLICK)
68 $(IPKG_BUILD) $(IDIR_CLICK) $(PACKAGE_DIR)
69
70
71 $(IPKG_ROOFNET):
72 install -d -m0755 $(IDIR_ROOFNET)/usr/bin
73 $(CP) $(PKG_BUILD_DIR)/conf/wifi/gen_config_roofnet.sh $(IDIR_ROOFNET)/usr/bin
74 $(CP) $(PKG_BUILD_DIR)/conf/wifi/srcr.click $(IDIR_ROOFNET)/usr/bin
75 $(CP) $(PKG_BUILD_DIR)/conf/wifi/read_handler $(IDIR_ROOFNET)/usr/bin
76 $(CP) $(PKG_BUILD_DIR)/conf/wifi/write_handler $(IDIR_ROOFNET)/usr/bin
77 mkdir -p $(IDIR_ROOFNET)/etc/init.d
78 install -m 755 ./files/S50roofnet $(IDIR_ROOFNET)/etc/init.d/
79 $(IPKG_BUILD) $(IDIR_ROOFNET) $(PACKAGE_DIR)
This page took 0.072885 seconds and 5 git commands to generate.