move source file to src/ and let the kernel tree build the modules.
[openwrt.git] / package / wlcompat / Makefile
1 # $Id$
2
3 include $(TOPDIR)/rules.mk
4 include $(TOPDIR)/package/kernel.mk
5
6 PKG_NAME:=kmod-wlcompat
7 PKG_RELEASE:=3
8
9 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
10
11 include $(TOPDIR)/package/rules.mk
12
13 define Package/kmod-wlcompat
14 SECTION:=drivers
15 CATEGORY:=Drivers
16 DEPENDS:=
17 TITLE:=Wrapper providing Wireless Extensions for Broadcom wl module
18 DESCRIPTION:= \\\
19 A wrapper module, that provides Wireless Extension support for the \\\
20 proprietary Broadcom wl module.
21 VERSION:=$(LINUX_VERSION)+$(BOARD)-$(PKG_RELEASE)
22 endef
23
24 define Package/kmod-wlcompat-debug
25 $(call Package/kmod-wlcompat)
26 TITLE:=Wrapper providing Wireless Extensions for Broadcom wl module (debug)
27 DESCRIPTION:= \\\
28 A wrapper module, that provides Wireless Extension support for the \\\
29 proprietary Broadcom wl module.
30 endef
31
32 define Build/Prepare
33         mkdir -p $(PKG_BUILD_DIR)
34         $(CP) ./src/* $(PKG_BUILD_DIR)/
35 endef
36
37 define Build/Compile
38         $(MAKE) -C "$(LINUX_DIR)" \
39                 CROSS_COMPILE="$(TARGET_CROSS)" \
40                 ARCH="$(LINUX_KARCH)" \
41                 PATH="$(TARGET_PATH)" \
42                 SUBDIRS="$(PKG_BUILD_DIR)" \
43                 EXTRA_CFLAGS="-DDEBUG -I$(LINUX_DIR)/arch/mips/bcm947xx/include -I$(PKG_BUILD_DIR)/include" \
44                 modules
45         mv $(PKG_BUILD_DIR)/wlcompat.o $(PKG_BUILD_DIR)/wlcompat-debug.o
46         $(MAKE) -C "$(LINUX_DIR)" \
47                 CROSS_COMPILE="$(TARGET_CROSS)" \
48                 ARCH="$(LINUX_KARCH)" \
49                 PATH="$(TARGET_PATH)" \
50                 SUBDIRS="$(PKG_BUILD_DIR)" \
51                 EXTRA_CFLAGS="-I$(LINUX_DIR)/arch/mips/bcm947xx/include -I$(PKG_BUILD_DIR)/include" \
52                 modules
53 endef
54
55 define Package/kmod-wlcompat/install
56         install -d -m0755 $(1)/etc/modules.d
57         echo "wlcompat" > $(1)/etc/modules.d/30-wlcompat
58         install -d -m0755 $(1)/lib/modules/$(LINUX_VERSION)
59         $(CP) $(PKG_BUILD_DIR)/wlcompat.o $(1)/lib/modules/$(LINUX_VERSION)/
60 endef
61
62 define Package/kmod-wlcompat-debug/install
63         install -d -m0755 $(1)/lib/modules/$(LINUX_VERSION)
64         $(CP) $(PKG_BUILD_DIR)/wlcompat-debug.o $(1)/lib/modules/$(LINUX_VERSION)/
65 endef
66
67 $(eval $(call BuildPackage,kmod-wlcompat))
68 $(eval $(call BuildPackage,kmod-wlcompat-debug))