292c923414562a2ec80c8de095ba2b7ae3d533ef
[lede.git] / package / zd1211 / Makefile
1
2 # Copyright (C) 2006 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 # $Id: Makefile 6582 2007-03-16 20:21:39Z nbd $
8
9 include $(TOPDIR)/rules.mk
10 include $(INCLUDE_DIR)/kernel.mk
11
12 PKG_NAME:=zd1211
13 PKG_VERSION:=r85
14 PKG_RELEASE:=1
15
16 PKG_SOURCE:=$(PKG_NAME)-driver-$(PKG_VERSION).tgz
17 PKG_SOURCE_URL:=@openwrt/
18 PKG_MD5SUM:=885cf08742c95cc416258257b5842b22
19
20 PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_NAME)-driver-$(PKG_VERSION)
21
22 include $(INCLUDE_DIR)/package.mk
23
24 #FIXME: add proper dependency handling on kmod-usb-core packages
25 define KernelPackage/zd1211
26   SUBMENU:=Wireless Drivers
27   DEPENDS:=@LINUX_2_6&&!LINUX_2_6_UML
28   TITLE:=Driver for Zydas 1211 based USB devices
29   DESCRIPTION:=\
30         This package contains a Linux driver for the ZyDAS ZD1211 802.11b/g \\\
31         USB-WLAN-Chip.\\\
32         Initially contributed by ZyDAS, this driver is actively maintained by the \\\
33         open source community.
34   FILES:=$(PKG_BUILD_DIR)/zd1211.$(LINUX_KMOD_SUFFIX)
35   AUTOLOAD:=$(call AutoLoad,60,zd1211) 
36 endef
37
38 define Package/zd1211-utils
39   SECTION:=utils
40   CATEGORY:=Utilities
41   TITLE:=zd1211 user-space utilities
42   DESCRIPTION:=zd1211 user-space utilities : apdbg, zd1211-sta
43 endef
44
45 define Build/Compile
46         $(MAKE) -C $(PKG_BUILD_DIR) \
47                 ARCH="$(LINUX_KARCH)" \
48                 CROSS_COMPILE="$(TARGET_CROSS)" \
49                 CC="$(TARGET_CC)" \
50                 CPP="$(TARGET_CC)" \
51                 LD="$(TARGET_CROSS)ld" \
52                 KERNELVERSION="$(KERNEL)" \
53                 KERNEL_SOURCE="$(LINUX_DIR)" \
54                 KDIR="$(LINUX_DIR)" \
55                 all
56         $(TARGET_CC) $(PKG_BUILD_DIR)/apdbg.c -o $(PKG_BUILD_DIR)/apdbg
57 endef
58
59 define Package/zd1211-utils/install
60         $(INSTALL_DIR) $(1)/usr/sbin
61         $(CP) $(PKG_BUILD_DIR)/apdbg $(1)/usr/sbin/
62         $(CP) $(PKG_BUILD_DIR)/sta $(1)/usr/sbin/$(PKG_NAME)-sta
63 endef
64
65 $(eval $(call Package,zd1211-utils))
66 $(eval $(call KernelPackage,zd1211))