summaryrefslogtreecommitdiffstats
path: root/target/linux/package/bcm43xx-dscape/Makefile
blob: efdede6169919cf4dad0ca7f091ca325671d22df (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# $Id$

include $(TOPDIR)/rules.mk
include ../../rules.mk

PKG_NAME := bcm43xx-dscape
PKG_VERSION := 20060104
PKG_RELEASE := 1

PKG_SOURCE_URL := http://ftp.berlios.de/pub/bcm43xx/snapshots/bcm43xx
PKG_SOURCE := $(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_CAT := bzcat

PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)

FIRMWARE_BLOB := wl_apsta-3.130.20.0.o
FIRMWARE_BLOB_URL := http://downloads.openwrt.org/sources
FIRMWARE_BLOB_MD5SUM := e08665c5c5b66beb9c3b2dd54aa80cb3

include $(TOPDIR)/package/rules.mk

$(eval $(call PKG_template,KMOD_BCM43XX_DSCAPE,kmod-$(PKG_NAME),$(LINUX_VERSION)-$(BOARD)+0.$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH),kernel ($(LINUX_VERSION)-$(BOARD)-$(KERNEL_RELEASE))))

ifeq ($(KERNEL_DIR),)
KERNEL_DIR:=$(LINUX_DIR)
endif
KERNEL_VERSION=$(shell echo "$(LINUX_VERSION)" | cut -d. -f1,2)

$(PKG_BUILD_DIR)/.configured:
	touch $@

$(PKG_BUILD_DIR)/fwcutter/.built:
	mkdir -p $(PKG_BUILD_DIR)/fwcutter
	cp ./fwcutter/* $(PKG_BUILD_DIR)/fwcutter/
	$(SCRIPT_DIR)/download.pl "$(PKG_BUILD_DIR)/fwcutter" "$(FIRMWARE_BLOB)" "$(FIRMWARE_BLOB_MD5SUM)" $(FIRMWARE_BLOB_URL)
	$(MAKE) -C $(PKG_BUILD_DIR)/fwcutter
	$(PKG_BUILD_DIR)/fwcutter/fwcutter -w $(PKG_BUILD_DIR)/fwcutter $(PKG_BUILD_DIR)/fwcutter/$(FIRMWARE_BLOB)
	touch $@

$(PKG_BUILD_DIR)/.built: $(PKG_BUILD_DIR)/fwcutter/.built
	$(MAKE) -C "$(KERNEL_DIR)" \
		CROSS_COMPILE="$(TARGET_CROSS)" \
		ARCH="$(LINUX_KARCH)" \
		PATH="$(TARGET_PATH)" \
		SUBDIRS="$(PKG_BUILD_DIR)" \
		LINUXINCLUDE="-I$(STAGING_DIR)/usr/include/ieee80211-dscape -I$(KERNEL_DIR)/include -DBCM47XX=1" \
		modules
	touch $@
	
$(IPKG_KMOD_BCM43XX_DSCAPE):
	install -m0755 -d $(IDIR_KMOD_BCM43XX_DSCAPE)/lib/modules/$(LINUX_VERSION)
	install -m0755 -d $(IDIR_KMOD_BCM43XX_DSCAPE)/etc/modules.d
	( \
		echo 80211; \
		echo rate_control; \
		echo bcm43xx; \
	) >& $(IDIR_KMOD_BCM43XX_DSCAPE)/etc/modules.d/50-bcm43xx
	cp -fpR $(PKG_BUILD_DIR)/*.ko $(IDIR_KMOD_BCM43XX_DSCAPE)/lib/modules/$(LINUX_VERSION)
	install -m0755 -d $(IDIR_KMOD_BCM43XX_DSCAPE)/lib/firmware
	cp -fpR $(PKG_BUILD_DIR)/fwcutter/*.fw $(IDIR_KMOD_BCM43XX_DSCAPE)/lib/firmware/
	$(IPKG_BUILD) $(IDIR_KMOD_BCM43XX_DSCAPE) $(PACKAGE_DIR)