convert ar7-net to KernelPackage template
[openwrt/openwrt.git] / package / ar7-atm / 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:=sangam-atm
13 PKG_VERSION:=0.1
14 PKG_RELEASE:=1
15
16 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
17 PKG_SOURCE_URL:=http://downloads.openwrt.org/sources
18 PKG_MD5SUM:=90c10702c9c3129e2ad1c01ce3975bf5
19 PKG_CAT:=bzcat
20
21 PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
22
23 include $(INCLUDE_DIR)/package.mk
24
25 define Package/kmod-sangam-atm-annex-a
26 SECTION:=kernel
27 CATEGORY:=Kernel modules
28 SUBMENU:=Network Devices
29 DEPENDS:=@LINUX_2_4_AR7 +kmod-atm
30 DEFAULT:=y
31 TITLE:=AR7 ADSL driver (Annex A)
32 DESCRIPTION:=The AR7 ADSL driver for Annex A
33 VERSION:=$(PKG_VERSION)+$(LINUX_VERSION)-$(BOARD)-$(PKG_RELEASE)
34 endef
35
36 define Package/kmod-sangam-atm-annex-b
37 $(call Package/kmod-sangam-atm-annex-a)
38 TITLE:=AR7 ADSL driver (Annex B)
39 DESCRIPTION:=The AR7 ADSL driver for Annex B
40 endef
41
42 define Build/Compile
43 $(MAKE) -C "$(LINUX_DIR)" \
44 CROSS_COMPILE="$(TARGET_CROSS)" \
45 ARCH="$(LINUX_KARCH)" \
46 SUBDIRS="$(PKG_BUILD_DIR)" \
47 modules
48 endef
49
50 define install
51 install -m0755 -d $(1)/lib/modules/$(LINUX_VERSION)
52 $(CP) $(PKG_BUILD_DIR)/tiatm.$(LINUX_KMOD_SUFFIX) \
53 $(1)/lib/modules/$(LINUX_VERSION)
54 install -m0644 $(PKG_BUILD_DIR)/ar0700xx_a.bin $(1)/lib/modules/ar0700xx.bin
55 install -m0755 -d $(1)/etc/modules.d/
56 printf 'tiatm\n' > $(1)/etc/modules.d/20-switch
57 endef
58
59 define Package/kmod-sangam-atm-annex-a/install
60 $(call install,$(1),a)
61 endef
62
63 define Package/kmod-sangam-atm-annex-b/install
64 $(call install,$(1),b)
65 endef
66
67 $(eval $(call BuildPackage,kmod-sangam-atm-annex-a))
68 $(eval $(call BuildPackage,kmod-sangam-atm-annex-b))