package/lantiq: make lantiq kernel modules work with xway_legacy
[openwrt/openwrt.git] / package / kernel / lantiq / ltq-adsl-mei / Makefile
1 # Copyright (C) 2012 OpenWrt.org
2 #
3 # This is free software, licensed under the GNU General Public License v2.
4 # See /LICENSE for more information.
5
6 include $(TOPDIR)/rules.mk
7 include $(INCLUDE_DIR)/kernel.mk
8
9 PKG_NAME:=ltq-adsl-mei
10 PKG_RELEASE:=1
11 PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/ltq-adsl-mei-$(BUILD_VARIANT)/
12
13 PKG_MAINTAINER:=John Crispin <john@phrozen.org>
14 PKG_CHECK_FORMAT_SECURITY:=0
15
16 include $(INCLUDE_DIR)/package.mk
17
18 define KernelPackage/ltq-adsl-mei-template
19 SECTION:=sys
20 CATEGORY:=Kernel modules
21 SUBMENU:=Network Devices
22 TITLE:=mei driver for $(1)
23 URL:=http://www.lantiq.com/
24 VARIANT:=$(1)
25 DEPENDS:=@$(2)
26 FILES:=$(PKG_BUILD_DIR)/ltq_mei_$(1).ko
27 AUTOLOAD:=$(call AutoLoad,50,ltq_mei_$(1))
28 endef
29
30 KernelPackage/ltq-adsl-danube-mei=$(call KernelPackage/ltq-adsl-mei-template,danube,(TARGET_lantiq_xway||TARGET_lantiq_xway_legacy))
31 KernelPackage/ltq-adsl-ar9-mei=$(call KernelPackage/ltq-adsl-mei-template,ar9,TARGET_lantiq_xway)
32 KernelPackage/ltq-adsl-ase-mei=$(call KernelPackage/ltq-adsl-mei-template,ase,TARGET_lantiq_ase)
33
34 define Build/Prepare
35 $(INSTALL_DIR) $(PKG_BUILD_DIR)/
36 $(CP) ./src/* $(PKG_BUILD_DIR)/
37 endef
38
39 define Build/Configure
40 endef
41
42 define Build/Compile
43 cd $(LINUX_DIR); \
44 ARCH=mips CROSS_COMPILE="$(KERNEL_CROSS)" \
45 $(MAKE) BUILD_VARIANT=$(BUILD_VARIANT) M=$(PKG_BUILD_DIR)/ V=1 modules
46 endef
47
48 $(eval $(call KernelPackage,ltq-adsl-danube-mei))
49 $(eval $(call KernelPackage,ltq-adsl-ase-mei))
50 $(eval $(call KernelPackage,ltq-adsl-ar9-mei))