172d9911feae2a23903193e3fd4eb3bb03741052
[openwrt.git] / package / switch / 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:=kmod-switch
13 PKG_RELEASE:=1
14
15 PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_NAME)
16
17 include $(INCLUDE_DIR)/package.mk
18
19 define KernelPackage/switch
20 SUBMENU:=Other modules
21 DEPENDS:=@LINUX_2_6_BRCM||LINUX_2_4_BRCM||LINUX_2_6_BRCM47XX
22 TITLE:=Switch drivers
23 DESCRIPTION:=\
24 This package contains switch drivers for ADM6996L and BCM53XX RoboSwitch.
25 VERSION:=$(LINUX_VERSION)-$(BOARD)-$(PKG_RELEASE)
26 FILES:= \
27 $(PKG_BUILD_DIR)/switch-core.$(LINUX_KMOD_SUFFIX) \
28 $(PKG_BUILD_DIR)/switch-adm.$(LINUX_KMOD_SUFFIX) \
29 $(PKG_BUILD_DIR)/switch-robo.$(LINUX_KMOD_SUFFIX)
30 AUTOLOAD:=$(call AutoLoad,20,switch-core switch-robo switch-adm)
31 endef
32
33 define Build/Prepare
34 mkdir -p $(PKG_BUILD_DIR)
35 $(CP) ./src/* $(PKG_BUILD_DIR)/
36 endef
37
38 ifeq ($(BOARD),brcm)
39 BUILDFLAGS := -DBROADCOM -DBCMDRIVER
40 else
41 ifeq ($(BOARD),brcm47xx)
42 BUILDFLAGS := -DBROADCOM
43 endif
44 endif
45
46
47 define Build/Compile
48 $(MAKE) -C "$(LINUX_DIR)" \
49 CROSS_COMPILE="$(TARGET_CROSS)" \
50 ARCH="$(LINUX_KARCH)" \
51 SUBDIRS="$(PKG_BUILD_DIR)" \
52 EXTRA_CFLAGS="$(BUILDFLAGS)" \
53 modules
54 endef
55
56 define KernelPackage/switch/install
57 $(INSTALL_DIR) $(1)/lib/network/
58 $(INSTALL_BIN) ./files/switch.sh $(1)/lib/network/
59 endef
60
61 $(eval $(call KernelPackage,switch))
This page took 0.040495 seconds and 3 git commands to generate.