6a0daa25c9007990206bc3aa27c089bcebee293d
[openwrt.git] / package / kernel / lantiq / ltq-adsl / Makefile
1 #
2 # Copyright (C) 2011 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9 include $(INCLUDE_DIR)/kernel.mk
10
11 PKG_NAME:=ltq-adsl
12 PKG_VERSION:=3.24.4.4
13 PKG_RELEASE:=1
14 PKG_SOURCE:=drv_dsl_cpe_api_danube-$(PKG_VERSION).tar.gz
15 PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/ltq-dsl-$(BUILD_VARIANT)/drv_dsl_cpe_api-$(PKG_VERSION)
16 PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources/
17 PKG_MD5SUM:=c45bc531c1ed2ac80f68fb986b63bb87
18 PKG_MAINTAINER:=John Crispin <blogic@openwrt.org>
19
20 include $(INCLUDE_DIR)/package.mk
21
22 define KernelPackage/ltq-adsl-template
23   SECTION:=sys
24   CATEGORY:=Kernel modules
25   SUBMENU:=Network Devices
26   TITLE:=adsl driver for $(1)
27   URL:=http://www.lantiq.com/
28   VARIANT:=$(1)
29   DEPENDS:=@TARGET_lantiq_$(2) +kmod-ltq-adsl-$(1)-mei
30   FILES:=$(PKG_BUILD_DIR)/src/drv_dsl_cpe_api.ko
31   AUTOLOAD:=$(call AutoLoad,51,drv_dsl_cpe_api)
32 endef
33
34 KernelPackage/ltq-adsl-danube=$(call KernelPackage/ltq-adsl-template,danube,xway)
35 KernelPackage/ltq-adsl-ar9=$(call KernelPackage/ltq-adsl-template,ar9,xway)
36 KernelPackage/ltq-adsl-ase=$(call KernelPackage/ltq-adsl-template,ase,ase)
37
38 define KernelPackage/ltq-dsl/config
39         source "$(SOURCE)/Config.in"
40 endef
41
42 IFX_DSL_MAX_DEVICE=1
43 IFX_DSL_LINES_PER_DEVICE=1
44 IFX_DSL_CHANNELS_PER_LINE=1
45
46 CONFIGURE_ARGS += --enable-kernel-include="$(LINUX_DIR)/include" \
47         --with-max-device="$(IFX_DSL_MAX_DEVICE)" \
48         --with-lines-per-device="$(IFX_DSL_LINES_PER_DEVICE)" \
49         --with-channels-per-line="$(IFX_DSL_CHANNELS_PER_LINE)" \
50         --disable-dsl-delt-static \
51         --disable-adsl-led \
52         --enable-dsl-ceoc \
53         --enable-dsl-pm \
54         --enable-dsl-pm-total \
55         --enable-dsl-pm-history \
56         --enable-dsl-pm-showtime \
57         --enable-dsl-pm-channel-counters \
58         --enable-dsl-pm-datapath-counters \
59         --enable-dsl-pm-line-counters \
60         --enable-dsl-pm-channel-thresholds \
61         --enable-dsl-pm-datapath-thresholds \
62         --enable-dsl-pm-line-thresholds \
63         --enable-dsl-pm-optional-parameters \
64         --enable-linux-26 \
65         --enable-kernelbuild="$(LINUX_DIR)" \
66         ARCH=$(LINUX_KARCH)
67
68 CONFIG_TAG_danube:=DANUBE
69 CONFIG_TAG_ase:=AMAZON_SE
70 CONFIG_TAG_ar9:=AR9
71 CONFIGURE_ARGS += --enable-add-drv-cflags="-DMODULE -DCONFIG_$(CONFIG_TAG_$(BUILD_VARIANT))"
72
73 CONFIGURE_ARGS += --enable-danube
74
75 ifeq ($(CONFIG_LANTIQ_DSL_DEBUG),y)
76 CONFIGURE_ARGS += \
77         --enable-debug=yes \
78         --enable-debug-prints=yes
79 EXTRA_CFLAGS += -DDEBUG
80 endif
81
82 EXTRA_CFLAGS = -fno-pic -mno-abicalls -mlong-calls -G 0
83
84 define Build/Configure
85         (cd $(PKG_BUILD_DIR); aclocal && autoconf && automake)
86         $(call Build/Configure/Default)
87 endef
88
89 define Build/InstallDev
90         $(INSTALL_DIR) $(1)/usr/include/adsl
91         $(CP) $(PKG_BUILD_DIR)/src/include/drv_dsl_cpe_*.h $(1)/usr/include/adsl/
92 endef
93
94 $(eval $(call KernelPackage,ltq-adsl-danube))
95 $(eval $(call KernelPackage,ltq-adsl-ase))
96 $(eval $(call KernelPackage,ltq-adsl-ar9))