implement target profiles in menuconfig
[openwrt.git] / package / wlcompat / 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$
8
9 include $(TOPDIR)/rules.mk
10 include $(INCLUDE_DIR)/kernel.mk
11
12 PKG_NAME:=kmod-wlcompat
13 PKG_RELEASE:=4
14
15 PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_NAME)
16
17 include $(INCLUDE_DIR)/package.mk
18
19 define Package/kmod-wlcompat/Default
20   SECTION:=kernel
21   CATEGORY:=Kernel drivers
22   DEPENDS:=@PACKAGE_kmod-brcm-wl||PACKAGE_kmod-brcm-wl-mimo +wireless-tools
23   DEFAULT:=y
24   TITLE:=Broadcom wl wrapper module
25   DESCRIPTION:=\
26         This package contains a wrapper module, that provides Wireless Extension \\\
27         support for the proprietary Broadcom wl module.
28   VERSION:=$(LINUX_VERSION)+$(BOARD)-$(PKG_RELEASE)
29 endef
30
31 define Package/kmod-wlcompat
32   $(call Package/kmod-wlcompat/Default)
33 endef
34
35 define Package/kmod-wlcompat-debug
36   $(call Package/kmod-wlcompat/Default)
37   TITLE+= (debug)
38   DESCRIPTION+=\\\
39         \\\
40         This is a debugging version.
41 endef
42
43 define Build/Prepare
44         mkdir -p $(PKG_BUILD_DIR)
45         $(CP) ./src/* $(PKG_BUILD_DIR)/
46 endef
47
48 define Build/Compile
49         $(MAKE) -C "$(LINUX_DIR)" \
50                 CROSS_COMPILE="$(TARGET_CROSS)" \
51                 ARCH="$(LINUX_KARCH)" \
52                 SUBDIRS="$(PKG_BUILD_DIR)" \
53                 EXTRA_CFLAGS="-DDEBUG -I$(LINUX_DIR)/arch/mips/bcm947xx/include -I$(PKG_BUILD_DIR)/include" \
54                 modules
55         mv $(PKG_BUILD_DIR)/wlcompat.o $(PKG_BUILD_DIR)/wlcompat-debug.o
56         $(MAKE) -C "$(LINUX_DIR)" \
57                 CROSS_COMPILE="$(TARGET_CROSS)" \
58                 ARCH="$(LINUX_KARCH)" \
59                 SUBDIRS="$(PKG_BUILD_DIR)" \
60                 EXTRA_CFLAGS="-I$(LINUX_DIR)/arch/mips/bcm947xx/include -I$(PKG_BUILD_DIR)/include" \
61                 modules
62 endef
63
64 define Package/kmod-wlcompat/install
65         install -d -m0755 $(1)/lib/modules/$(LINUX_VERSION)
66         $(CP) $(PKG_BUILD_DIR)/wlcompat.o $(1)/lib/modules/$(LINUX_VERSION)/
67         install -d -m0755 $(1)/etc/modules.d
68         echo "wlcompat" > $(1)/etc/modules.d/30-wlcompat
69 endef
70
71 define Package/kmod-wlcompat-debug/install
72         install -d -m0755 $(1)/lib/modules/$(LINUX_VERSION)
73         $(CP) $(PKG_BUILD_DIR)/wlcompat-debug.o $(1)/lib/modules/$(LINUX_VERSION)/
74 endef
75
76 $(eval $(call BuildPackage,kmod-wlcompat))
77 $(eval $(call BuildPackage,kmod-wlcompat-debug))