ifndef is not supported inside make variable expansion
[openwrt.git] / package / p54 / Makefile
1 #
2 # Copyright (C) 2007-2008 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:=p54
13 PKG_RELEASE:=1
14
15 PKG_FWP54_NAME:=2.7.0.0.arm
16 PKG_FWP54_URL:=http://prism54.org/firmware
17 PKG_FWP54_MD5SUM:=09f9da7ea757173c9de1a0322a1f9782
18
19 include $(INCLUDE_DIR)/package.mk
20
21 # XXX: remove @!TARGET_* later when we have PCI & USB support properly detected on all targets
22
23 define KernelPackage/p54/Default
24 SUBMENU:=Wireless Drivers
25 TITLE:=Prism Wireless Support (mac80211)
26 DEPENDS:=+kmod-mac80211 @!TARGET_ar7 @!TARGET_atheros @!TARGET_uml
27 endef
28
29 define KernelPackage/p54-common
30 $(call KernelPackage/p54/Default)
31 TITLE+= (COMMON)
32 DEPENDS+= @PCI_SUPPORT||USB_SUPPORT
33 FILES:=$(PKG_BUILD_DIR)/p54common.$(LINUX_KMOD_SUFFIX)
34 AUTOLOAD:=$(call AutoLoad,30,p54common)
35 endef
36
37 define KernelPackage/p54-pci
38 $(call KernelPackage/p54/Default)
39 TITLE+= (PCI)
40 DEPENDS+= @PCI_SUPPORT +kmod-p54-common
41 FILES:=$(PKG_BUILD_DIR)/p54pci.$(LINUX_KMOD_SUFFIX)
42 AUTOLOAD:=$(call AutoLoad,31,p54pci)
43 endef
44
45 define KernelPackage/p54-usb
46 $(call KernelPackage/p54/Default)
47 TITLE+= (USB)
48 DEPENDS+= @USB_SUPPORT +kmod-usb-core +kmod-p54-common
49 FILES:=$(PKG_BUILD_DIR)/p54usb.$(LINUX_KMOD_SUFFIX)
50 AUTOLOAD:=$(call AutoLoad,31,p54usb)
51 endef
52
53 define KernelPackage/p54/description
54 Kernel module for Prism54 chipsets (mac80211)
55 endef
56
57 $(STAMP_PREPARED): $(DL_DIR)/$(PKG_FWP54_NAME)
58
59 $(DL_DIR)/$(PKG_FWP54_NAME):
60 $(SCRIPT_DIR)/download.pl "$(DL_DIR)" "$(PKG_FWP54_NAME)" "$(PKG_FWP54_MD5SUM)" $(PKG_FWP54_URL)
61
62 PKG_EXTRA_KCONFIG:= \
63 CONFIG_P54_COMMON=m \
64
65 ifneq ($(CONFIG_PACKAGE_kmod-p54-pci),)
66 PKG_EXTRA_KCONFIG+= CONFIG_P54_PCI=m
67 endif
68 ifneq ($(CONFIG_PACKAGE_kmod-p54-usb),)
69 PKG_EXTRA_KCONFIG+= CONFIG_P54_USB=m
70 endif
71
72 EXTRA_CFLAGS:= \
73 $(patsubst CONFIG_%, -DCONFIG_%=1, $(patsubst %=m,%,$(filter %=m,$(PKG_EXTRA_KCONFIG)))) \
74 $(patsubst CONFIG_%, -DCONFIG_%=1, $(patsubst %=y,%,$(filter %=y,$(PKG_EXTRA_KCONFIG)))) \
75
76 MAKE_OPTS:= \
77 ARCH="$(LINUX_KARCH)" \
78 CROSS_COMPILE="$(TARGET_CROSS)" \
79 SUBDIRS="$(PKG_BUILD_DIR)" \
80 EXTRA_CFLAGS="$(EXTRA_CFLAGS)" \
81 LINUXINCLUDE="-I$(STAGING_DIR)/usr/include/mac80211 -I$(LINUX_DIR)/include -include linux/autoconf.h" \
82 $(PKG_EXTRA_KCONFIG)
83
84 ifneq ($(findstring 2.6.23,$(LINUX_VERSION)),)
85 define Build/Prepare
86 mkdir -p $(PKG_BUILD_DIR)
87 $(CP) ./src/* $(PKG_BUILD_DIR)/
88 $(CP) $(DL_DIR)/$(PKG_FWP54_NAME) $(PKG_BUILD_DIR)
89 endef
90
91 define Build/Configure
92 endef
93
94 define Build/Compile
95 $(MAKE) -C "$(LINUX_DIR)" \
96 $(MAKE_OPTS) \
97 modules
98 endef
99 else
100 override CONFIG_PACKAGE_kmod-p54-common=
101 override CONFIG_PACKAGE_kmod-p54-pci=
102 override CONFIG_PACKAGE_kmod-p54-usb=
103 endif
104
105 define KernelPackage/p54-pci/install
106 $(INSTALL_DIR) $(1)/lib/firmware
107 $(INSTALL_DATA) $(PKG_BUILD_DIR)/2.7.0.0.arm $(1)/lib/firmware/isl3886
108 endef
109
110 define KernelPackage/p54-usb/install
111 $(INSTALL_DIR) $(1)/lib/firmware
112 $(INSTALL_DATA) $(PKG_BUILD_DIR)/2.7.0.0.arm $(1)/lib/firmware/isl3886
113 endef
114
115
116 $(eval $(call KernelPackage,p54-common))
117 $(eval $(call KernelPackage,p54-pci))
118 $(eval $(call KernelPackage,p54-usb))
This page took 0.043064 seconds and 5 git commands to generate.