net/click: update to click-20101002 git (#8072)
[openwrt/svn-archive/archive.git] / net / click / Makefile
1 #
2 # Copyright (C) 2006-2010 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:=20101002
12
13 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
14 PKG_SOURCE_URL:=git://read.cs.ucla.edu/git/click
15 PKG_SOURCE_PROTO:=git
16 PKG_SOURCE_VERSION:=04f9a6ea146793881caa6b1721872a92d8c2ddcf
17 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
18 PKG_MD5SUM:=e2f144265b5b61804b0634bf567bee5b
19 PKG_CAT:=zcat
20
21 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
22
23 include $(INCLUDE_DIR)/package.mk
24
25 define Package/click
26 SECTION:=net
27 CATEGORY:=Network
28 DEPENDS:=@BROKEN
29 TITLE:=Click Modular Router
30 URL:=http://read.cs.ucla.edu/click
31 endef
32
33 define Package/click/Description
34 The Click Modular Router userspace package
35 endef
36
37 TARGET_CFLAGS += "-static -O2 -MD"
38 TARGET_CXXFLAGS += "-static -O2 -MD"
39
40 define Build/Configure
41 (cd $(PKG_BUILD_DIR); \
42 rm -rf config.{cache,status} ; \
43 "./configure \
44 --prefix=/usr \
45 --enable-userlevel \
46 --enable-wifi \
47 --enable-fixincludes \
48 --disable-linuxmodule" ; \
49 rm -rf config.{cache,status} ; \
50 ./configure \
51 --prefix=/usr \
52 --target=$(GNU_TARGET_NAME) \
53 --host=$(GNU_TARGET_NAME) \
54 --build=$(GNU_HOST_NAME) \
55 --enable-tools=mixed \
56 --enable-userlevel \
57 --enable-wifi \
58 --enable-fixincludes \
59 --disable-linuxmodule \
60 )
61 endef
62
63 define Build/Compile
64 $(MAKE) -C $(PKG_BUILD_DIR) \
65 tools elementmap.xml
66 (cd $(PKG_BUILD_DIR)/userlevel; \
67 ../tools/click-mkmindriver/click-mkmindriver -p $(PKG_NAME) -C .. \
68 -f $(PKG_BUILD_DIR)/conf/wifi/dump.click \
69 -A --all -E Discard -E Print; \
70 )
71 $(MAKE) -C $(PKG_BUILD_DIR) MINDRIVER=$(PKG_NAME)
72 endef
73
74 define Package/click/install
75 $(INSTALL_DIR) $(1)/usr
76 $(INSTALL_DIR) $(1)/usr/bin
77 $(INSTALL_DIR) $(1)/usr/share/click
78 $(CP) $(PKG_BUILD_DIR)/userlevel/$(PKG_NAME)click $(1)/usr/bin/click
79 $(CP) $(PKG_BUILD_DIR)/tools/click-align/click-align $(1)/usr/bin/click-align
80 $(CP) $(PKG_BUILD_DIR)/elementmap.xml $(1)/usr/share/click/elementmap.xml
81 endef
82
83 $(eval $(call BuildPackage,click))