c6dd8e106f497c425056f95a6f645b0f368c27e9
[openwrt/svn-archive/archive.git] / openwrt / target / linux / package / madwifi / Makefile
1 # $Id$
2
3 include $(TOPDIR)/rules.mk
4 include ../../rules.mk
5
6 PKG_NAME:=madwifi
7 PKG_VERSION:=r1358-20051215
8 PKG_RELEASE:=1
9 PKG_MD5SUM:=0ef00a095359e5af313f52446ebfbbf1
10
11 PKG_SOURCE_URL:=http://snapshots.madwifi.org/madwifi-ng
12 PKG_SOURCE:=$(PKG_NAME)-ng-$(PKG_VERSION).tar.gz
13 PKG_CAT:=zcat
14
15 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-ng-$(PKG_VERSION)
16
17 ifeq ($(ARCH),mips)
18 HAL_TARGET:=mips-be-elf
19 endif
20 ifeq ($(ARCH),mipsel)
21 HAL_TARGET:=mips-le-elf
22 endif
23 ifeq ($(ARCH),i386)
24 HAL_TARGET:=i386-elf
25 endif
26
27 ifneq ($(BR2_LINUX_2_4_AR531X),)
28 BUS := AHB
29 bus := ahb
30 else
31 BUS := PCI
32 bus := pci
33 endif
34
35 include $(TOPDIR)/package/rules.mk
36
37 $(eval $(call PKG_template,KMOD_MADWIFI,kmod-madwifi,$(LINUX_VERSION)+$(PKG_VERSION)-$(BOARD)-$(PKG_RELEASE),$(ARCH),kernel-$(LINUX_VERSION)-$(BOARD) ($(LINUX_RELEASE))))
38
39 $(PKG_BUILD_DIR)/.configured:
40 touch $@
41
42 $(PKG_BUILD_DIR)/.built:
43 $(MAKE) -C $(PKG_BUILD_DIR) \
44 PATH="$(TARGET_PATH)" \
45 ARCH="$(LINUX_KARCH)" \
46 CROSS_COMPILE="$(TARGET_CROSS)" \
47 TARGET="$(HAL_TARGET)" \
48 TOOLPREFIX="$(KERNEL_CROSS)" \
49 TOOLPATH="$(KERNEL_CROSS)" \
50 KERNELPATH="$(LINUX_DIR)" \
51 BUS="$(BUS)" \
52 all
53 touch $@
54
55 $(IPKG_KMOD_MADWIFI):
56 mkdir -p $(IDIR_KMOD_MADWIFI)/etc/modules.d
57 mkdir -p $(IDIR_KMOD_MADWIFI)/etc/init.d
58 mkdir -p $(IDIR_KMOD_MADWIFI)/lib/modules/$(LINUX_VERSION)
59 install -m0644 ./files/madwifi.modules $(IDIR_KMOD_MADWIFI)/etc/modules.d/20-madwifi
60 install -m0755 ./files/madwifi.init $(IDIR_KMOD_MADWIFI)/etc/init.d/S20madwifi
61 cp -fpR $(PKG_BUILD_DIR)/net80211/wlan*.$(LINUX_KMOD_SUFFIX) \
62 $(PKG_BUILD_DIR)/ath_hal/ath_hal.$(LINUX_KMOD_SUFFIX) \
63 $(PKG_BUILD_DIR)/ath/ath_$(bus).$(LINUX_KMOD_SUFFIX) \
64 $(PKG_BUILD_DIR)/ath_rate/sample/ath_rate_sample.$(LINUX_KMOD_SUFFIX) \
65 $(PKG_BUILD_DIR)/net80211/*.$(LINUX_KMOD_SUFFIX) \
66 $(IDIR_KMOD_MADWIFI)/lib/modules/$(LINUX_VERSION)/
67 $(IPKG_BUILD) $(IDIR_KMOD_MADWIFI) $(PACKAGE_DIR)
68
69 $(STAGING_DIR)/usr/include/madwifi/net80211/ieee80211.h: $(PKG_BUILD_DIR)/.built
70 mkdir -p $(STAGING_DIR)/usr/include/madwifi
71 cp -fpR $(PKG_BUILD_DIR)/include $(STAGING_DIR)/usr/include/madwifi/
72 mkdir -p $(STAGING_DIR)/usr/include/madwifi/net80211
73 cp -fpR $(PKG_BUILD_DIR)/net80211/*.h $(STAGING_DIR)/usr/include/madwifi/net80211/
74 touch $@
75
76 install-dev: $(STAGING_DIR)/usr/include/madwifi/net80211/ieee80211.h
77
78 uninstall-dev:
79 rm -rf $(STAGING_DIR)/usr/include/madwifi
80
81 compile-targets: install-dev
82 clean-targets: uninstall-dev