9f4fbdc31d13e779b58ecb718b967761877b44b5
[openwrt.git] / target / linux / package / madwifi / Makefile
1 # $Id$
2
3 include $(TOPDIR)/rules.mk
4
5 PKG_NAME:=madwifi
6 PKG_VERSION:=2005-08-13
7 PKG_RELEASE:=1
8 PKG_MD5SUM:=188127127aebd8815595c025a787d729
9
10 PKG_SOURCE_URL:=http://madwifi.otaku42.de/2005/08/
11 PKG_SOURCE:=$(PKG_NAME)-cvs-snapshot-$(PKG_VERSION).tar.bz2
12 PKG_CAT:=bzcat
13
14 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
15
16 ifeq ($(KERNEL_DIR),)
17 KERNEL_DIR:=$(LINUX_DIR)
18 endif
19
20 ifeq ($(ARCH),mips)
21 HAL_TARGET:=mips-be-elf
22 endif
23 ifeq ($(ARCH),mipsel)
24 HAL_TARGET:=mips-le-elf
25 endif
26 ifeq ($(ARCH),i386)
27 HAL_TARGET:=i386-elf
28 endif
29
30 include $(TOPDIR)/package/rules.mk
31
32 $(eval $(call PKG_template,KMOD_MADWIFI,kmod-madwifi,$(LINUX_VERSION)$(BOARD)+$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH),kernel-$(LINUX_VERSION)-$(BOARD) ($(KERNEL_RELEASE))))
33
34 $(PKG_BUILD_DIR)/.configured:
35         touch $@
36
37 $(PKG_BUILD_DIR)/.built:
38         $(MAKE) -C $(PKG_BUILD_DIR) \
39                 TARGET="$(HAL_TARGET)" \
40                 TOOLPREFIX="$(KERNEL_CROSS)" \
41                 KERNELPATH="$(KERNEL_DIR)"
42         touch $@
43
44 $(IPKG_KMOD_MADWIFI):
45         mkdir -p $(IDIR_KMOD_MADWIFI)/etc/modules.d
46         mkdir -p $(IDIR_KMOD_MADWIFI)/etc/init.d
47         mkdir -p $(IDIR_KMOD_MADWIFI)/lib/modules/$(LINUX_VERSION)
48         install -m0644 ./files/madwifi.modules $(IDIR_KMOD_MADWIFI)/etc/modules.d/20-madwifi
49         install -m0755 ./files/madwifi.init $(IDIR_KMOD_MADWIFI)/etc/init.d/S20madwifi
50         cp -fpR $(PKG_BUILD_DIR)/net80211/wlan*.o \
51                 $(PKG_BUILD_DIR)/ath_hal/ath_hal.o \
52                 $(PKG_BUILD_DIR)/ath_rate/sample/ath_rate_sample.o \
53                 $(PKG_BUILD_DIR)/ath/ath_pci.o \
54                 $(IDIR_KMOD_MADWIFI)/lib/modules/$(LINUX_VERSION)/
55         $(IPKG_BUILD) $(IDIR_KMOD_MADWIFI) $(PACKAGE_DIR)
56